[BUG] Long-lived VS Code session keeps stale claude.ai connector ID and cannot recover from 404 Server not found
Preflight Checklist
- [x] I searched existing issues and did not find this exact failure mode.
- [x] This is a single bug report.
- [x] I am using the latest Claude Code version (2.1.220, also current on npm at the time of filing).
What's Wrong?
A long-lived Claude Code session in the VS Code extension kept using a stale claude.ai remote-connector ID after the connector catalog had changed to a replacement connector record.
When the old session next invoked a tool, mcp-proxy.anthropic.com returned:
{"type":"error","error":{"type":"not_found_error","message":"Server not found"}}
Claude Code correctly logged that the MCP session was stale and cleared its connection cache, but its recovery path immediately retried the same obsolete mcpsrv_... ID. The retry returned the same 404, and every later tool call failed immediately with:
MCP server "claude.ai Mnemoverse" is not connected
At the same time, a fresh Claude Code session under the same machine/account fetched a newer connector record with a different mcpsrv_... ID and successfully called the same upstream MCP service.
This failure happens entirely on the claudeai-proxy path. The request producing the 404 did not reach the upstream MCP or its OAuth server.
What Should Happen?
When mcp-proxy.anthropic.com returns 404 not_found_error: Server not found for a claude.ai connector, Claude Code should:
- Invalidate the stale remote connector entry.
- Re-fetch the claude.ai connector catalog.
- Rebuild/rebind the MCP tool registry from the current connector records.
- Retry through the current connector, or surface an actionable "connector was removed or replaced" error.
It should not clear only the transport cache and then retry the same stale mcpsrv_... ID indefinitely.
Error Messages / Logs
Connector IDs are shortened below. Full IDs can be correlated from the two Anthropic request IDs.
Old long-lived session:
2026-07-28T22:18:29.076Z [DEBUG] MCP server "claude.ai Mnemoverse": CLAUDEAI-PROXY connection dropped after 19316s uptime
2026-07-28T22:18:29.078Z [DEBUG] MCP server "claude.ai Mnemoverse": Connection error: Streamable HTTP error: Error POSTing to endpoint: {"type":"error","error":{"type":"not_found_error","message":"Server not found"},"request_id":"req_011CdVENXVSeM64GkRAGDg2f"}
2026-07-28T22:18:29.082Z [DEBUG] MCP server "claude.ai Mnemoverse": MCP session expired during tool call (stale session), clearing connection cache for re-initialization
2026-07-28T22:18:29.093Z [DEBUG] MCP server "claude.ai Mnemoverse": Retrying tool after session recovery
2026-07-28T22:18:29.094Z [DEBUG] MCP server "claude.ai Mnemoverse": Using claude.ai proxy at https://mcp-proxy.anthropic.com/v1/mcp/mcpsrv_01Xe...
2026-07-28T22:18:29.363Z [DEBUG] MCP server "claude.ai Mnemoverse": claude.ai proxy connection failed after 269ms: Streamable HTTP error: Error POSTing to endpoint: {"type":"error","error":{"type":"not_found_error","message":"Server not found"},"request_id":"req_011CdVENYsHhQ1xsuGi3ZGZP"}
2026-07-28T22:18:29.364Z [DEBUG] MCP server "claude.ai Mnemoverse": Connection failed after 269ms (404)
2026-07-28T22:18:29.365Z [DEBUG] mcp__claude_ai_Mnemoverse__memory_join_room tool error (910ms): MCP server "claude.ai Mnemoverse" is not connected
Fresh session/current connector:
2026-07-28T22:38:40.985Z [DEBUG] [claudeai-mcp] Fetched 5 servers
2026-07-28T22:38:41.003Z [DEBUG] MCP server "claude.ai Mnemoverse Memory": Using claude.ai proxy at https://mcp-proxy.anthropic.com/v1/mcp/mcpsrv_01GF...
2026-07-28T22:38:43.406Z [DEBUG] MCP server "claude.ai Mnemoverse Memory": Successfully connected (transport: claudeai-proxy) in 2403ms
2026-07-28T22:39:36.485Z [DEBUG] MCP server "claude.ai Mnemoverse Memory": Calling MCP tool: memory_list_rooms
2026-07-28T22:39:37.287Z [DEBUG] MCP server "claude.ai Mnemoverse Memory": Tool 'memory_list_rooms' completed successfully in 802ms
The old and new connector records had different names and different mcpsrv_... IDs, despite pointing to the same upstream service and being used under the same account.
Steps to Reproduce
The following is derived from the observed sequence. The exact UI action that caused the connector record to change (reconnect/recreate versus workspace-context refresh) was not independently isolated.
- Add an OAuth-backed custom connector through claude.ai.
- Start a Claude Code session in the VS Code extension and verify its tools work.
- Keep that session/process alive.
- Replace or recreate the remote connector so the claude.ai connector catalog contains a new
mcpsrv_...record. - Start a fresh Claude Code session and verify it fetches the new record and can call its tools.
- Invoke a connector tool from the old session.
- Observe the proxy return
404 Server not found. - Observe Claude Code identify a stale MCP session but retry the obsolete connector ID rather than re-fetching the catalog.
- Subsequent calls in the old session fail immediately as "not connected"; restarting the session restores service.
Claude Model
Not sure / Multiple models
Is this a regression?
I don't know.
Last Working Version
Unknown.
Claude Code Version
2.1.220 (Claude Code)
VS Code extension: anthropic.claude-code-2.1.220-darwin-arm64
Platform
Anthropic API / claude.ai remote connector proxy
Operating System
macOS 26.6 (Build 25G72), Apple Silicon
Terminal / Shell
VS Code extension / VS Code integrated environment
Additional Information
- The upstream MCP uses stateless Streamable HTTP, with a fresh server transport per request and no server-side MCP session ID.
- Browser and another machine could use the upstream service during the incident.
- The stale-session request returned from
mcp-proxy.anthropic.com; it did not reach the upstream MCP/OAuth logs. - Restarting or opening a fresh Claude Code session is a reliable workaround because it fetches the current connector catalog.
Possibly related, but not duplicates:
- #45533 —
Server not foundwhile re-adding/re-authenticating a remote server. - #78911 — claude.ai connector transport wedges after idle; fresh process succeeds.
- #9608 — recovery after an MCP 404 session error.
- #46328 — OAuth refresh gap on the claude.ai proxy path. This incident differs because the proxy returned
Server not foundbefore the request reached upstream OAuth.