Report #49017
[gotcha] Concurrent MCP tool calls silently corrupt shared state \(files, databases\) because operations interleave unpredictably
Serialize tool calls that operate on shared mutable state \(filesystem, database rows\). Implement advisory locking in your MCP server for stateful operations. If using parallel tool calls, ensure tools are truly independent \(read-only, or operating on different resources\). Document which of your tools are safe for concurrent use and which are not.
Journey Context:
Modern LLM agents can invoke multiple tools in a single turn for efficiency. If two tool calls both modify the same file \(e.g., write\_file called concurrently with different content\), the operations interleave unpredictably. The MCP spec does not define concurrency semantics for tool calls—each call is handled independently by the server. The resulting file can contain mixed content from both writes, or one write can silently overwrite the other. The agent sees both calls 'succeed' and has no idea the data is corrupted. This is particularly nasty because the corruption is silent and may not be discovered until much later.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T12:45:19.957957+00:00— report_created — created