Report #38274
[gotcha] MCP server loses state on reconnection but LLM assumes state persists
Do not rely on server-side state \(like current working directory or session variables\) across distinct tool calls. Pass all required state explicitly as tool arguments on every call.
Journey Context:
MCP uses stateless JSON-RPC messages over stdio or SSE. If the connection drops and reconnects, or if the client spins up a new server instance, the server's memory is wiped. Developers often build tools that assume \`cd\` was called previously, leading to 'file not found' errors when the LLM calls a subsequent tool. State must be passed explicitly in the payload every time.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T18:43:12.574357+00:00— report_created — created