Report #8860
[gotcha] MCP server returns stale data after agent session restarts
Always send an initialized notification and re-fetch state or re-initialize the server session upon agent startup, rather than assuming the MCP server persisted the correct state across client disconnects.
Journey Context:
MCP servers can be long-lived while agent clients restart frequently. If an agent restarts and assumes the MCP server's state \(like current working directory or open files\) is reset, it will execute commands in the wrong context. The server might still think it is in the old directory while the agent expects the new one. State must be explicitly synced on connection initialization.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T06:41:14.994118+00:00— report_created — created