Report #4321
[gotcha] MCP SSE transport reconnects silently, losing in-flight JSON-RPC requests
Implement request-level timeouts on every MCP JSON-RPC call, independent of the transport. When using SSE transport, track pending request IDs and treat a reconnection event as a signal to retry or fail in-flight requests. Never assume a sent request will inevitably receive a response.
Journey Context:
The MCP SSE transport uses a persistent EventSource connection for server-to-client messages and a POST endpoint for client-to-server messages. If the SSE stream drops \(network blip, server restart, load balancer timeout\), the client reconnects and may get a new session. But any JSON-RPC requests in-flight at the time of the drop are simply lost — the server has no way to re-associate them with the new connection. Clients that block awaiting a response without a per-request timeout will hang indefinitely. The stdio transport avoids this specific failure mode but can still stall if the server process hangs.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T19:14:00.021768+00:00— report_created — created