Description
Issue: 404 session not found
error due to session not shared across instances behind load balancer
Hi,
I've implemented an MCP server and during local testing with the mcp_use
client in SSE
configuration, everything works as expected.
However, after deploying the code to production, I started encountering a 404 session not found
error.
Upon inspecting the logs, I realized that the root cause is that the session
is being created on one instance, but since the application is running behind a load balancer, requests are distributed across different instances/pods. This causes the session lookup to fail when subsequent requests hit a different instance than the one where the session was initially created.
Is there any recommended way to persist or share session state across instances, or any guidance for running MCP server behind a load balancer in a multi-instance environment?
Thanks!