claude-code - 💡(How to fix) Fix MCP tools silently drop mid-session with no reconnection

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…

Error Message

  • If reconnection fails, surface a visible error rather than silently dropping tools
  • No crash log or error message indicates what happened
RAW_BUFFERClick to expand / collapse

Problem

When an MCP server stdio child process dies mid-session (e.g., BrokenResourceError from pipe close during context compaction), Claude Code permanently removes all tools from that server for the remainder of the session. There is no reconnection attempt, even when:

  1. The server process could be respawned (stdio transport)
  2. A companion HTTP transport server is still alive on the same port

The tools silently vanish from ToolSearch results and the deferred-tools list.

Reproduction

  1. Configure an MCP server in .mcp.json with both stdio and HTTP transports
  2. Start a session - tools from both servers appear in deferred-tools
  3. Wait for the stdio server to die (happens naturally during long sessions, or force it by killing the child PID)
  4. Try to use any tool from the dead server - "No such tool available"
  5. ToolSearch for the server name returns nothing
  6. The HTTP server is still alive and responsive (curl succeeds) but its tools are also gone

Expected behavior

  • Claude Code should attempt to reconnect to a failed MCP server (at least once)
  • For HTTP transport servers that are still reachable, tools should remain available
  • If reconnection fails, surface a visible error rather than silently dropping tools
  • Provide a way to re-discover MCP tools mid-session (e.g., a /mcp-reconnect command)

Impact

This is a significant issue for projects that route tool calls through MCP servers. When tools drop mid-session:

  • The model falls back to native tools (if available) or gets stuck
  • Any hook-based gating that routes to MCP tools creates a dead-end loop
  • Long autonomous sessions are interrupted by silent tool loss
  • No crash log or error message indicates what happened

Environment

  • Claude Code CLI (Max subscription)
  • macOS Darwin 25.3.0, M1 Air 8GB
  • Python MCP server using mcp library with stdio_server() transport
  • .mcp.json with both stdio and HTTP server entries

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…

FAQ

Expected behavior

  • Claude Code should attempt to reconnect to a failed MCP server (at least once)
  • For HTTP transport servers that are still reachable, tools should remain available
  • If reconnection fails, surface a visible error rather than silently dropping tools
  • Provide a way to re-discover MCP tools mid-session (e.g., a /mcp-reconnect command)

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 tools silently drop mid-session with no reconnection