Report #9209
[gotcha] Concurrent users experience data leakage because the MCP server shares state across sessions
Scope all server-side state \(variables, DB connections, caches\) to the sessionId provided in the MCP request context, rather than using global or class-level variables.
Journey Context:
Developers often build MCP servers as standard web servers using global variables for caching or authentication state. However, MCP servers are typically long-lived processes handling multiple clients/sessions. If a token or user context is stored globally, User A's query will use User B's credentials. The MCP specification provides session management, but it's up to the server implementation to respect the session boundaries.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T07:38:51.651353+00:00— report_created — created