Skip to content

Commit 3f9438f

Browse files
committed
fix: default listening host to all interfaces for container compatibility
When running inside a container, binding to localhost only accepts connections from within the container itself. Traffic from port forwarding arrives via the bridge network interface, not loopback, causing connection resets. Defaulting to all interfaces ensures the server is reachable without requiring an explicit override.
1 parent d55ab69 commit 3f9438f

4 files changed

Lines changed: 7 additions & 9 deletions

File tree

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ You can also set the following variables to override the default configuration:
212212
- `SYSDIG_MCP_MOUNT_PATH`: The URL prefix for the streamable-http/sse deployment. Defaults to: `/sysdig-mcp-server`
213213
- `SYSDIG_MCP_LOGLEVEL`: Log Level of the application (`DEBUG`, `INFO`, `WARNING`, `ERROR`). Defaults to: `INFO`
214214
- `SYSDIG_MCP_LISTENING_PORT`: The port for the server when it is deployed using remote protocols (`streamable-http`, `sse`). Defaults to: `8080`
215-
- `SYSDIG_MCP_LISTENING_HOST`: The host for the server when it is deployed using remote protocols (`streamable-http`, `sse`). Defaults to: `localhost`
215+
- `SYSDIG_MCP_LISTENING_HOST`: The host for the server when it is deployed using remote protocols (`streamable-http`, `sse`). Defaults to all interfaces (`:port`). Set to `127.0.0.1` for local-only access.
216216

217217
You can find your API token in the Sysdig Secure UI under **Settings > Sysdig Secure API**. Make sure to copy the token as it will not be shown again.
218218

@@ -242,7 +242,7 @@ SYSDIG_MCP_TRANSPORT=streamable-http
242242
# SYSDIG_MCP_API_HOST=https://us2.app.sysdig.com
243243
# SYSDIG_MCP_API_TOKEN=your-api-token-here
244244
SYSDIG_MCP_LISTENING_PORT=8080
245-
SYSDIG_MCP_LISTENING_HOST=localhost
245+
SYSDIG_MCP_LISTENING_HOST=
246246
SYSDIG_MCP_MOUNT_PATH=/sysdig-mcp-server
247247
```
248248

@@ -354,8 +354,6 @@ spec:
354354
env:
355355
- name: SYSDIG_MCP_TRANSPORT
356356
value: "streamable-http"
357-
- name: SYSDIG_MCP_LISTENING_HOST
358-
value: "0.0.0.0"
359357
envFrom:
360358
- secretRef:
361359
name: mcp-server-secrets

internal/config/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ func Load() (*Config, error) {
3434
APIToken: getEnv("SYSDIG_MCP_API_TOKEN", ""),
3535
SkipTLSVerification: getEnv("SYSDIG_MCP_API_SKIP_TLS_VERIFICATION", false),
3636
Transport: getEnv("SYSDIG_MCP_TRANSPORT", "stdio"),
37-
ListeningHost: getEnv("SYSDIG_MCP_LISTENING_HOST", "localhost"),
37+
ListeningHost: getEnv("SYSDIG_MCP_LISTENING_HOST", ""),
3838
ListeningPort: getEnv("SYSDIG_MCP_LISTENING_PORT", "8080"),
3939
MountPath: getEnv("SYSDIG_MCP_MOUNT_PATH", "/sysdig-mcp-server"),
4040
LogLevel: getEnv("SYSDIG_MCP_LOGLEVEL", "INFO"),

internal/config/config_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ var _ = Describe("Config", func() {
7878
cfg, err := config.Load()
7979
Expect(err).NotTo(HaveOccurred())
8080
Expect(cfg.Transport).To(Equal("stdio"))
81-
Expect(cfg.ListeningHost).To(Equal("localhost"))
81+
Expect(cfg.ListeningHost).To(BeEmpty())
8282
Expect(cfg.ListeningPort).To(Equal("8080"))
8383
Expect(cfg.MountPath).To(Equal("/sysdig-mcp-server"))
8484
Expect(cfg.LogLevel).To(Equal("INFO"))
@@ -96,7 +96,7 @@ var _ = Describe("Config", func() {
9696
cfg, err := config.Load()
9797
Expect(err).NotTo(HaveOccurred())
9898
Expect(cfg.Transport).To(Equal("streamable-http"))
99-
Expect(cfg.ListeningHost).To(Equal("localhost"))
99+
Expect(cfg.ListeningHost).To(BeEmpty())
100100
Expect(cfg.ListeningPort).To(Equal("8080"))
101101
Expect(cfg.MountPath).To(Equal("/sysdig-mcp-server"))
102102
Expect(cfg.LogLevel).To(Equal("INFO"))

package.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{ buildGo126Module, versionCheckHook }:
22
buildGo126Module (finalAttrs: {
33
pname = "sysdig-mcp-server";
4-
version = "1.0.2";
4+
version = "1.0.3";
55
src = ./.;
66
# This hash is automatically re-calculated with `just rehash-package-nix`. This is automatically called as well by `just update`.
7-
vendorHash = "sha256-7UtPcgvKrpSIUGEgIOTH/BBG9PacBeVtSEsrfBtgWxs=";
7+
vendorHash = "sha256-IjVs+Mm9kV9pXoEOE3En2u+/jd/ITXZi0kp2+L92Mso=";
88

99
subPackages = [
1010
"cmd/server"

0 commit comments

Comments
 (0)