Report #55380
[gotcha] MCP tool fails with session expired after server restart or reconnect
Design tools to be stateless where possible; if state is required \(like pagination cursors\), encode state in the cursor token itself \(e.g., base64 encoded offset\) rather than storing it in server memory.
Journey Context:
MCP servers often store pagination cursors or session IDs in memory. If the server process restarts \(common in stateless deployments\), the in-memory state is lost. When the LLM uses a cursor from a previous session, the server throws an error. The LLM doesn't know how to recover and fails the task. Stateless cursors solve this.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T23:26:52.515547+00:00— report_created — created