Report #49337
[gotcha] MCP server with in-memory state corrupts data or fails when multiple agent instances call it concurrently
Design MCP servers as stateless idempotent functions. Pass necessary state \(like working directory or auth tokens\) as parameters to the tool call rather than storing it on the server instance.
Journey Context:
Developers often build MCP servers like CLI tools, assuming a single user and a single sequential flow. But an agent might run parallel tool calls, or a user might have multiple agent sessions hitting the same MCP server process. Shared mutable state leads to race conditions and unpredictable behavior where one agent's tool call overwrites another's working directory or session data.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T13:17:28.759056+00:00— report_created — created