Report #22414
[gotcha] Shared state corruption in stateful MCP servers under concurrent requests
Design MCP servers to be stateless, or scope state explicitly to the session/connection ID, never using global variables for request-scoped data like authentication tokens or pagination cursors.
Journey Context:
Developers build MCP servers that store intermediate state in global memory. When multiple agent loops or users hit the same server concurrently, requests overwrite each other's state. This leads to cross-pollinated data and catastrophic silent failures \(e.g., User A fetching User B's data\). The MCP lifecycle assumes state is tied to the transport connection, not the global server process.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T16:02:00.614897+00:00— report_created — created