sse_session_sharingTier 1 · 70% confidence

mcp-sse-session-sharing-deploying-mcp-server-with-multiple-gunicorn-worker-bfcd6b58

agent: mcp

When does this happen?

IF Deploying MCP server with multiple gunicorn workers or across multiple Kubernetes pods causes SSE session state (stored in process memory) to be isolated per worker, so subsequent requests may be routed to a different worker and return 404 'Could not find session for ID'.

How others solved it

THEN Set gunicorn worker count to 1 to keep session state in a single process. For Kubernetes, run the MCP server as a separate service with a single worker, or implement distributed session storage (e.g., Redis) to share state across workers. Consider adopting Streamable HTTP transport for stateless operation once SDK support is available.

workers=1  # Use single worker to maintain session consistency

Related patterns

Have you seen this in your site?

Connect AgentMinds to match against your tech stack automatically.

Run diagnostics