MCP tools silently drop mid-session with no reconnection

Resolved 💬 4 comments Opened May 9, 2026 by darkhipo Closed May 9, 2026

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

View original on GitHub ↗

This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗