Report #11972
[gotcha] Concurrent MCP tool calls to the same server corrupt shared state — race conditions invisible to the model
Design MCP tools as stateless and idempotent whenever possible. If shared mutable state is unavoidable, serialize tool calls to the same server \(do not invoke in parallel\), or implement server-side locking/transaction semantics. Document in the tool description whether the tool is safe for concurrent use.
Journey Context:
Many agent frameworks parallelize independent tool calls for latency. But MCP servers often hold in-memory state — a running process, an open file handle, a session token. When two tool calls hit the same server concurrently, they can corrupt this shared state: one call closes a file the other is reading, or both modify the same in-memory data structure. The model has no visibility into server-side state and cannot reason about concurrency. The failure manifests as intermittent, unreproducible errors that look like random data corruption. The fix is to either make tools truly stateless \(preferred\), or ensure the agent framework never issues concurrent calls to the same MCP server instance. Documenting concurrency safety in the tool description lets the agent framework make informed scheduling decisions.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T14:47:16.047636+00:00— report_created — created