Skip to content

Kubernetes and Docker recipes bind or publish debug and MCP ports wider than they need #1390

Backlog

Description

@debugmcpdev

Found by a sweep of every listener after #1387. These are in the recipes and docs, not in the server's code. Each needs a run before it changes, so nothing here is asserted beyond what was read.

1. The Kubernetes sidecar recipe puts the MCP endpoint on the pod IP

The image sets MCP_HTTP_BIND=0.0.0.0 (Dockerfile), which a published Docker port needs. The sidecar recipe (examples/kubernetes/debug-sidecar.sh, docs/kubernetes.md, docs/jit-diagnostics/README.md) inherits it, so the endpoint, which has no authentication and can launch programs, listens on the pod's IP and any pod in the cluster can reach it. "Never a Service" does not prevent that.

docs/kubernetes.md says 0.0.0.0 is needed "so kubectl port-forward can reach it". containerd's port-forward dials localhost inside the pod's network namespace (read in containerd's source), so a loopback bind should be enough. That has to be confirmed on the weekly kind job, and for CRI-O, before the recipe changes.

Candidate change: the recipe passes --env=MCP_HTTP_BIND=127.0.0.1, and the sentence is corrected.

2. The example manifests bind their debug ports on every pod interface

examples/kubernetes/java-app.yaml, javascript-app.yaml, python-app.yaml and ruby-app.yaml start their debuggers on all interfaces. Port-forward and the sidecar (which shares the pod's network) need loopback only. Same confirmation as above.

3. Docker docs

  • docs/docker-support.md shows -p 5679:5679 (and -p 5680:5679): a port nothing in the shipped image serves, published on every host interface. EXPOSE 5679 in the Dockerfile is stale in the same way.
  • docs/ruby/README.md shows -p 12345:12345 for the remote-attach demo, against the warning a few lines above it. It should be -p 127.0.0.1:12345:12345.
  • docs/tool-reference.md suggests --network host; with http that puts the endpoint on every host interface, and the server reports it at info level only.

One thing that is as it has to be: inside a container the server must bind 0.0.0.0 for a published port to work, so other containers on the same bridge network can reach it whatever the -p 127.0.0.1: says. That deserves a sentence in the Docker docs.

Activity

  1. added
    documentation
    blocked
    on Nov 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    blockeddocumentation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions