Report #12119
[gotcha] Agent assumes MCP server state persists after server crash or restart
Design tools to be stateless where possible. If state is necessary \(e.g., a session ID or working directory\), have the tool return the state in its output so the LLM must pass it back as an argument in the next call, rather than relying on server-side memory.
Journey Context:
MCP servers can be restarted by the client or crash independently. If a tool relies on server-side state \(like setting a current working directory via a cd tool\), a server restart resets that state silently. The LLM continues operating under the false assumption that the state persists, leading to file not found errors. Making state explicit in the tool inputs/outputs forces the LLM to maintain the state in its own context, surviving server restarts.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T15:10:36.772464+00:00— report_created — created