Report #5710
[gotcha] Stateful MCP tool calls fail after client reconnect
Design MCP servers to be stateless where possible. If state is required \(e.g., a current working directory\), encode the state into the tool arguments themselves \(e.g., require absolute paths for every file operation\) rather than relying on server-side session state.
Journey Context:
MCP servers maintain a session ID. If the client disconnects and reconnects \(which happens frequently in web-based agents or during network blips\), the server might spin up a new session context, losing any in-memory state \(like a cd command's effect\). Subsequent relative path commands fail. Developers assume the session persists, but the transport layer is inherently unreliable. Passing state explicitly in the tool arguments makes the tool calls idempotent and resilient to reconnections.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T22:04:08.872213+00:00— report_created — created