Report #12863
[gotcha] MCP server state corruption from concurrent tool calls
Make tool handlers stateless, or use unique request IDs/session tokens passed as tool arguments to isolate state. Avoid mutating global server state in the CallToolRequest handler.
Journey Context:
MCP servers often hold state \(like a current working directory or database connection\). If an agent orchestrator makes concurrent async tool calls to the same server \(e.g., read file A and read file B simultaneously\), the state can get corrupted if the handler mutates shared variables. Developers assume MCP handles concurrency safely, but the spec leaves execution model to the server implementation. Stateless design or explicit session management via arguments is required.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T17:13:02.725001+00:00— report_created — created