[BUG] MCP Server Connection Failures on Windows
Title: MCP Server Connection Failures on Windows - All stdio MCP servers fail to connect
Environment:
- OS: Windows 11
- Claude Code CLI Version: 1.0.62
- Installation: npm-global
- Node.js: [your version]
Issue Description:
All MCP servers fail to connect with "Connection closed" errors, regardless of configuration. Even simple test commands fail.
Evidence:
- Manual MCP protocol test WORKS:
echo {"jsonrpc": "2.0", "id": 1, "method": "initialize", "params": {"protocolVersion": "2024-11-05", "capabilities": {}, "clientInfo": {"name": "test", "version": "1.0"}}} | context7-mcp
Returns proper JSON response.
- ALL Claude Code CLI configurations FAIL:
context7-mcppowershell -Command context7-mcpcmd /c "C:\Users\LILIAN C\AppData\Roaming\npm\context7-mcp.cmd"cmd /c C:\Users\LILIAN~1\AppData\Roaming\npm\context7-mcp.cmdcmd /c echo MCP_TEST(simple test)
Debug Output Shows:
- Error:
/usr/bin/bash: Files\Git\bin\bash.exe: No such file or directory - Claude CLI tries to use bash even when cmd/powershell specified
- Path with spaces gets mangled:
Files\Git\bin\bash.exe
Root Cause:
Claude Code CLI's MCP stdio transport appears to force bash execution on Windows, with broken path handling for spaces.
Expected Behavior:
MCP servers should connect when properly configured, especially when manual protocol test succeeds.
Reproduction:
- Install any MCP server on Windows
- Add with
claude mcp add test "echo hello" - Run
claude mcp list - Observe "Failed to connect" for all servers
This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗