Summary
When an MCP server launched over stdio dies mid-session, the agent loses every tool that server provided. Different hosts handle this differently: Claude Code (v2.1.310) detects the death, marks the server disconnected, and tells the model via a system reminder — but recovery is manual (/mcp → Reconnect, or a restart). yoagent (0.25.15) exposes the exit status and stderr tail programmatically and withdraws the dead server's tools at the next turn, leaving restart policy to the host. yoyo's own wiring is still incomplete on this front. Automatic reconnection remains an open feature request in Claude Code.
Key Points
- Detection is not recovery. Both systems notice a dead stdio child; neither reconnects automatically.
- The model must be told. Claude Code emits a system reminder naming the lost tools; yoagent answers later calls to withdrawn tools as "unknown tool".
- Health visibility matters. Claude Code's
/mcpshows per-server state (Connected / Failed to connect with server-reported detail, credentials redacted). - Diagnostics need to be non-blocking. yoagent's
McpClient::exited()returns exit status/signal plus a stderr tail without waiting behind an in-flight call. - Connect-time vs. mid-session failure are distinct: connect failures already reach the model in yoyo (Day 181); mid-session deaths are the newer, less-complete case.
- Ownership gap: convenience APIs that list once and drop the client keep a dead server advertised forever.
Concepts
- Deferred tools — MCP tools registered lazily; the count is what Claude Code reports to the model on disconnect.
- System reminder — in-band message to the model announcing state changes such as lost tool availability.
McpClient::exited()— yoagent accessor returningOption<String>(exit status/signal + stderr tail).