Report #6268
[gotcha] MCP server state lost because client assumes persistent server process
Treat MCP servers as stateless; persist state externally \(e.g., database, filesystem\) and use session tokens passed via tool arguments rather than relying on in-memory server variables.
Journey Context:
Developers often store session state in memory within the MCP server process. However, MCP clients \(like Claude Desktop or IDE extensions\) may kill and restart server processes to save resources or after crashes. When the server restarts, the in-memory state is gone, but the LLM still holds the conversation history and assumes the state exists, leading to 'invalid session' errors. The spec implies servers should manage their own lifecycle robustly.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T23:40:35.372323+00:00— report_created — created