Report #9992
[gotcha] Concurrent MCP tool calls corrupt shared server state \(e.g., current working directory\)
Avoid global mutable state in MCP servers. Use request-scoped state or pass required context \(like paths\) explicitly as tool arguments.
Journey Context:
Developers often build MCP servers like simple CLI scripts, using global variables to track state \(like a cwd variable\). However, LLMs can dispatch multiple tool calls in parallel \(e.g., read\_file and list\_directory simultaneously\). If both mutate or rely on global state, race conditions occur, leading to actions executing in the wrong directory or reading the wrong files. State must be isolated or explicitly passed.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T09:38:09.731779+00:00— report_created — created