MCP: re-enumerate tools mid-session for remote-control sessions (mcp_reconnect works but is unreachable)
Problem
A Claude Code session enumerates each MCP server's tools once, at attach (tools/list). If that probe is cancelled by the attach timeout (e.g. a slow HTTP MCP upstream), the server is registered with ZERO tools and is never re-listed for the session's life — even after the upstream fully recovers. The same freeze blocks any mid-session change: a tool added/removed on an MCP server is invisible until the session is killed and recreated.
What I verified (Claude Code 2.1.146 AND 2.1.158, throwaway streamable-HTTP MCP servers)
- Server-side signals do NOT recover it:
notifications/tools/list_changedis ignored; a server-closed SSE stream is silently re-opened with no re-init; a full transport drop does not re-initialize. - The control channel DOES recover it: injecting
{"type":"control_request","request":{"subtype":"mcp_reconnect","serverName":"<name>"}}on the stream-json stdin triggers a freshinitialize+tools/listAND re-exposes the new tools to the model (the agent then successfully called a tool that only existed post-reconnect). SoreconnectMcpServer()works end-to-end.
The gap
mcp_reconnect works, but there is no way to deliver it to a claude remote-control session. Its stdin is a supervisor-owned socketpair bridged to the cloud, and remote-control --help exposes no inject/MCP/control surface. So the one working recovery lever is unreachable for exactly the sessions (cloud-bridged, headless, claude.ai/code + mobile) that hit this.
Requests (either solves it)
- Auto-fire
mcp_reconnectfor any MCP server that attached with zero tools, once it becomes reachable again (periodic retry or on next successful ping). - Expose
mcp_reconnectto remote-control sessions — a claude.ai/code per-server "Reconnect" action, or a local IPC/signal the supervisor honors.
Why it matters
Long-running headless/remote-control sessions lose an entire toolset to a brief upstream blip — or never see a newly added tool — and can only recover by being killed + respawned, losing all context.
Environment
Claude Code 2.1.146 and 2.1.158; sessions run headless via claude remote-control --spawn worktree (claude.exe --print --input-format stream-json); MCP server is HTTP/streamable-HTTP
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗