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:
- The server process could be respawned (stdio transport)
- 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
- Configure an MCP server in .mcp.json with both stdio and HTTP transports
- Start a session - tools from both servers appear in deferred-tools
- Wait for the stdio server to die (happens naturally during long sessions, or force it by killing the child PID)
- Try to use any tool from the dead server - "No such tool available"
- ToolSearch for the server name returns nothing
- 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
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗