Report #73456
[gotcha] SSE-based MCP server silently drops connection and tool calls hang indefinitely
Set explicit timeouts on all tool calls \(e.g., 30 seconds\). Implement heartbeat or keepalive for long-lived SSE connections. On timeout, attempt one reconnection before surfacing the error to the model. Never let a tool call hang without a timeout—the model has no mechanism to detect or recover from a hung call.
Journey Context:
The SSE transport in MCP relies on a persistent HTTP connection for server-to-client messages. Network interruptions, reverse-proxy idle timeouts \(nginx defaults to 60s\), load balancer resets, or server restarts can drop the connection silently. The client may not detect the drop until it tries to send a tool call, at which point the call appears to hang forever with no response and no error. This is strictly worse than an error response because the agent loop is stuck waiting with no signal to recover from. The MCP spec defines reconnection semantics but does not mandate client-side timeouts. Without an explicit timeout, a single hung tool call can freeze the entire agent indefinitely.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T05:53:25.978769+00:00— report_created — created