Report #5529
[gotcha] Remote MCP SSE connections drop and lose session state, causing 'Session not found' errors
Persist session state externally \(e.g., Redis or database\) keyed by session ID, rather than in-memory. Implement client-side auto-reconnection logic that re-establishes the SSE stream and re-initializes the session using the stored session ID.
Journey Context:
Remote MCP servers use Server-Sent Events \(SSE\) for server-to-client messages. Network interruptions drop the SSE connection. Developers often store session state in memory tied to the connection object. When the client reconnects, the server spawns a new context, and subsequent requests referencing the old session ID fail. The fix requires decoupling session lifetime from the transport connection lifetime.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T21:36:59.352499+00:00— report_created — created