feat(mcp): deploy the MCP layer on central instead of tunnelling to a workstation
All checks were successful
CI Smoke / host-smoke (push) Successful in 0s
CI Smoke / container-smoke (push) Successful in 1s

No MCP server ran on central, so remote agents reached dev-hub only through a
reverse tunnel back to the workstation — routing a request for a service on
their own machine out to another host and back.

Adds a gated mcp Deployment and ClusterIP Service running the same image with
`-m mcp_server.server`, API_BASE defaulted to the in-cluster API Service, and
tcpSocket probes. No Ingress: the MCP layer proxies an unauthenticated API and
must not be reachable from outside the cluster.

Two fixes were needed before the manifests could work:

- server.py hardcoded host="127.0.0.1". A Service routes to the pod IP, so a
  loopback bind is unreachable. Now MCP_HOST, still defaulting to loopback so
  local runs do not silently expose an unauthenticated proxy.
- The container runs `-m mcp_server.server`, not the file path, so /app lands
  on sys.path rather than /app/mcp_server.

mcp.enabled stays false in the deploy values: the running image predates
MCP_HOST, so enabling it before the tag is bumped would ship a pod that never
becomes reachable.

Refs CUST-WP-0067-T08

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

Assistant: claude-code
Assistant-Model: opus
Assistant-Process: 2583210@bnt-lap001
Assistant-Session: f2bff2d5-e9b2-4338-92ca-10282a927006
This commit is contained in:
tegwick 2026-08-24 22:54:24 +02:00
parent 4e68176492
commit 6d04544368
5 changed files with 159 additions and 2 deletions

View file

@ -3212,4 +3212,9 @@ if __name__ == "__main__":
mcp.run(transport="stdio")
else:
port = int(os.environ.get("MCP_PORT", "8001"))
mcp.run(transport=transport, host="127.0.0.1", port=port)
# Default to loopback: this server is an unauthenticated proxy over the
# API, so it must not land on every interface by accident. In-cluster
# deployment sets MCP_HOST=0.0.0.0 because a Service routes to the pod
# IP, and a loopback bind is unreachable there (CUST-WP-0067-T08).
host = os.environ.get("MCP_HOST", "127.0.0.1")
mcp.run(transport=transport, host=host, port=port)