Description
The /mcp command fails to reconnect to a code-mode MCP server with the error:
Failed to reconnect to code-mode.
This happens even after restarting Claude Code. However, the underlying MCP server works perfectly when run manually from the terminal.
Environment
- Claude Code version: 2.1.15 (also tested behavior persists after restart)
- macOS Darwin 24.6.0
- Node.js (npx works fine)
MCP Configuration
.mcp.json:
{
"mcpServers": {
"code-mode": {
"command": "npx",
"args": ["@utcp/code-mode-mcp"],
"env": {
"UTCP_CONFIG_FILE": "/path/to/.utcp_config.json"
}
}
}
}
The code-mode server proxies to remote MCP servers (Supabase, Cloudflare) via mcp-remote.
Reproduction Steps
- Configure code-mode MCP server as shown above
- Start Claude Code - MCP may or may not connect initially
- Run
/mcp to try to reconnect
- Observe "Failed to reconnect to code-mode" error
What Works
Running the server manually works fine:
Output shows successful connections:
- Supabase: 20 tools discovered
- Cloudflare observability: 10 tools discovered
- Cloudflare bindings: 25 tools discovered
OAuth tokens are valid and fresh. No stale processes blocking.
Expected Behavior
/mcp should successfully reconnect to the code-mode server, or provide a more descriptive error message about what's failing.
Description
The
/mcpcommand fails to reconnect to acode-modeMCP server with the error:This happens even after restarting Claude Code. However, the underlying MCP server works perfectly when run manually from the terminal.
Environment
MCP Configuration
.mcp.json:{ "mcpServers": { "code-mode": { "command": "npx", "args": ["@utcp/code-mode-mcp"], "env": { "UTCP_CONFIG_FILE": "/path/to/.utcp_config.json" } } } }The code-mode server proxies to remote MCP servers (Supabase, Cloudflare) via
mcp-remote.Reproduction Steps
/mcpto try to reconnectWhat Works
Running the server manually works fine:
Output shows successful connections:
OAuth tokens are valid and fresh. No stale processes blocking.
Expected Behavior
/mcpshould successfully reconnect to the code-mode server, or provide a more descriptive error message about what's failing.