[BUG] MCP reconnection fails with different patterns for direct command vs interactive menu
Resolved 💬 6 comments Opened Aug 8, 2025 by skhrshin Closed Jan 10, 2026
Environment
- Platform (select one):
- [x] Anthropic API
- [ ] AWS Bedrock
- [ ] Google Vertex AI
- [ ] Other: <!-- specify -->
- Claude CLI version: 1.0.71 (Claude Code)
- Operating System: Linux (WSL2) - 6.6.87.2-microsoft-standard-WSL2
- Terminal: VSCode integrated terminal
Bug Description
Two different MCP reconnection methods exhibit different failure patterns:
- Direct command (
/mcp reconnect <server-name>): Shows "Successfully reconnected" but always disconnects immediately - Interactive menu (
/mcp <server-name>→ Reconnect): Fails on first attempt, succeeds on second attempt
The issue is reproducible with MCP's official Rust SDK example.
Steps to Reproduce
Setup: Build MCP's official Rust SDK counter example
# Clone the official MCP Rust SDK
git clone https://github.com/modelcontextprotocol/rust-sdk.git /tmp/rust-sdk
cd /tmp/rust-sdk
# Build the counter example
cargo build --example servers_counter_stdio
Configure Claude Code
Create or update .mcp.json in your project directory:
{
"mcpServers": {
"counter-test": {
"command": "cargo",
"args": ["run", "--manifest-path", "/tmp/rust-sdk/Cargo.toml", "--example", "servers_counter_stdio"]
}
}
}
Pattern A: Direct reconnect command
- Start Claude Code in the project directory
- Initial connection to counter-test succeeds
- Use
/mcp reconnect counter-testto reconnect - Claude Code displays "Successfully reconnected to counter-test"
- However, the connection is immediately closed
- Repeat
/mcp reconnect counter-testmultiple times - All attempts show "Successfully reconnected" but immediately disconnect
Pattern B: Interactive reconnect via menu
- Start Claude Code in the project directory
- Initial connection to counter-test succeeds
- Use
/mcp counter-testto open interactive menu - Select "Reconnect" option
- Claude Code displays "Reconnected to counter-test." (note: different message)
- First reconnection fails silently (connection is lost)
- Repeat
/mcp counter-testand select "Reconnect" again - Second reconnection succeeds and remains stable
Expected Behavior
MCP server reconnection should succeed on the first attempt.
Actual Behavior
- Direct command (
/mcp reconnect counter-test): Always shows "Successfully reconnected to counter-test" but immediately disconnects - Interactive menu (
/mcp counter-test→ Reconnect): First attempt fails silently, second attempt succeeds - Different success messages indicate different code paths:
- Direct: "Successfully reconnected to counter-test" (misleading - connection always fails)
- Interactive: "Reconnected to counter-test." (accurate - but only on second attempt)
- Pattern is 100% reproducible
Additional Context
Workaround: Use /mcp counter-test and select Reconnect from the menu twice - the second attempt will succeed.
The direct /mcp reconnect counter-test command never works and should be avoided.
This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗