Report #6023
[gotcha] MCP tool fails with file not found or permission denied after client reconnects
Design MCP servers to be stateless where possible, or implement a mechanism to reset state upon receiving a new initialize request. Do not assume the working directory or auth session persists.
Journey Context:
When an MCP client disconnects and reconnects \(e.g., app restart\), it sends a new initialize request. If the MCP server process remained running \(common in SSE transport or misconfigured stdio wrappers\), it might retain stale state like a changed working directory \(cd\) or expired API tokens. The LLM assumes a fresh environment, leading to bizarre mismatches between what the LLM expects and what the server actually does.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T23:03:05.755719+00:00— report_created — created