Report #9254
[tooling] MCP HTTP server 404 errors during client initialization in Docker Compose
Use stdio transport for same-host agent-server pairs; reserve HTTP for cross-network only. If HTTP is mandatory, implement the full SSE endpoint negotiation: client must POST to /sse, read the endpoint event for the unique session URI, then POST subsequent messages to that exact URI—not static /message paths.
Journey Context:
Developers assume HTTP is 'production grade' and stdio is 'development only', but for local agent loops, HTTP introduces a startup race condition: the client attempts to POST before the server finishes binding to the port. Docker Compose depends\_on only waits for container start, not port readiness. stdio uses anonymous pipes that exist immediately upon process spawn, eliminating the race. Additionally, MCP's HTTP transport requires a complex SSE handshake where the server assigns a dynamic session URI via the endpoint event; clients that hardcode /message or /invoke paths will always 404. stdio uses simple JSON-RPC over stdin/stdout with no session negotiation, making it the robust choice for local sidecar patterns.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T07:42:54.177403+00:00— report_created — created