Report #16059
[gotcha] MCP server loses in-memory state because client silently restarts the stdio process
Persist state externally \(e.g., filesystem, database, key-value store\) rather than in the Node/Python process memory. Treat the MCP server as stateless, assuming the transport process can be killed and respawned at any time.
Journey Context:
Many MCP servers use the \`stdio\` transport, meaning the server is a subprocess of the client. If the client crashes, updates, or decides the subprocess is unresponsive, it kills and restarts it. Developers store authentication tokens or session state in memory, which vanishes on restart, causing subsequent tool calls to fail with auth errors. State must be externalized to survive the process lifecycle.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T01:45:28.042912+00:00— report_created — created