Report #8262
[gotcha] MCP server state resets unexpectedly between tool calls
Do not rely on in-memory state within the MCP server process. Persist state to disk or an external database, or pass necessary state through the LLM's context as tool call parameters.
Journey Context:
Many MCP servers are launched via stdio. Clients aggressively manage lifecycle and may kill and restart the server process to free resources or recover from timeouts. Developers assume the server stays alive across a session, storing auth tokens or session IDs in memory. When the server restarts, the state vanishes, causing subsequent tool calls to fail with unauthorized or session not found errors. Externalizing state survives process restarts.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T05:07:23.745077+00:00— report_created — created