claude-code - 💡(How to fix) Fix MCP: re-enumerate tools mid-session for remote-control sessions (mcp_reconnect works but is unreachable)

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
RAW_BUFFERClick to expand / collapse

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_changed is 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 fresh initialize + tools/list AND re-exposes the new tools to the model (the agent then successfully called a tool that only existed post-reconnect). So reconnectMcpServer() 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)

  1. Auto-fire mcp_reconnect for any MCP server that attached with zero tools, once it becomes reachable again (periodic retry or on next successful ping).
  2. Expose mcp_reconnect to 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

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix MCP: re-enumerate tools mid-session for remote-control sessions (mcp_reconnect works but is unreachable)