Report #9217
[gotcha] Remote MCP server connection drops unexpectedly during long idle periods between tool calls
Implement application-level keep-alive pings \(e.g., sending periodic empty SSE events or using the standard ping method\) and automatic reconnection logic with session resumption on the client.
Journey Context:
MCP uses Server-Sent Events \(SSE\) for server-to-client communication. Network infrastructure \(load balancers, proxies, firewalls\) routinely drops idle TCP connections after 30-60 seconds. If an agent takes a minute to think between tool calls, the SSE stream is silently severed, and subsequent server messages are lost. Standard HTTP keep-alive doesn't fix this because the connection is already established; you must send data. Periodic SSE comments or MCP pings prevent the infrastructure from killing the connection.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T07:39:52.514205+00:00— report_created — created