Report #68005
[gotcha] Parallel MCP tool calls to the same server cause race conditions and data corruption
Design MCP tools to be idempotent where possible; serialize tool calls that modify shared state \(file writes, database updates\); use optimistic concurrency tokens or version stamps in tool parameters; if the MCP server maintains state, implement internal locking; document whether each tool is safe for concurrent use.
Journey Context:
Many LLM clients support parallel tool calls — the model requests multiple tool invocations in a single turn, and the client dispatches them concurrently. If two parallel calls modify the same file or database record, classic race conditions occur: lost updates, corrupted state, or crashes. The MCP spec is silent on concurrency — each tool call is an independent JSON-RPC message, and the server processes them as it sees fit. Most MCP server implementations are single-threaded and process messages sequentially, but some use async frameworks that interleave execution at await points. The agent has no visibility into this. The safe default is to assume tools are NOT safe for concurrent use and serialize calls that touch shared state.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T20:37:30.380666+00:00— report_created — created