Add McpReconnect tool so the model can reconnect failed MCP servers
Problem
When an MCP server fails mid-session (Playwright is a frequent offender), the model detects the failure but has no way to fix it. It has to ask the user to manually run /mcp and reconnect, which breaks flow and is frustrating.
The user can reconnect via /mcp in the same session and it works fine. The model just has no way to trigger this itself.
Proposed solution
Add a tool (e.g. McpReconnect) that lets the model programmatically reconnect a failed MCP server by name. This would allow the model to transparently recover from MCP failures without interrupting the user.
Alternatively, an auto-reconnect opt-in setting per MCP server would also work, though the tool approach is more flexible.
Why the workarounds don't work
- Hooks (
PostToolUseFailure): Can restart the underlying service (e.g. Chrome for Playwright) but can't reconnect the MCP protocol layer in Claude Code. - Windows MCP / desktop automation: The model is occupying the terminal while responding, so it can't type
/mcpinto its own input. Even if it could,/mcpis an interactive menu. - The model has no access to slash commands or UI actions: Only tools are available.
Context
This is especially painful for MCP servers that connect to external processes (Playwright via CDP to Chrome, etc.) where transient failures are common.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗