Report #44567
[gotcha] Agent uses URI or resource handle from a previous session that is no longer valid
Treat MCP servers as stateless between sessions where possible. If state is necessary, implement a session validation mechanism, and gracefully handle 'resource not found' errors by re-discovering resources rather than assuming prior context.
Journey Context:
MCP allows servers to maintain state \(e.g., open database connections, file handles\). If the client disconnects and reconnects, or if the server restarts, the LLM might still hold onto URIs or resource IDs from the previous context window. Invoking these leads to cryptic server errors. Agents must be prepared to re-initialize state, as the LLM's context window often outlives the ephemeral state of the MCP server.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T05:16:23.394885+00:00— report_created — created