[BUG] MCP Server Connection Fails on Windows — `cmd /c` wrapper corrupted by CLI parser
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Environment
- OS: Windows 11
- Claude Code version: 2.1.80
- Terminal: PowerShell
- Python: installed
- uv/uvx: installed
Description
On Windows, it is impossible to configure a local MCP server via the claude mcp add CLI command. The official documentation states that Windows requires a cmd /c wrapper for npx/uvx commands, but the CLI parser corrupts the /c flag in two ways:
- When using
-- cmd /cin the command, the/cflag gets converted toC:/(a Windows drive path), breaking the configuration entirely. - In some cases the
/cflag is converted to/schedule, also breaking the configuration.
This makes it impossible to follow the official documentation for Windows MCP setup using the CLI.
Steps to Reproduce
- On Windows, run:
claude mcp add my-server -s user -- cmd /c uvx some-mcp-package
- Run
claude mcp get my-server - Observe that Args show
/scheduleorC:/instead of/c - MCP server fails to connect
Workaround Attempted
Editing C:\Users\<user>\.claude.json directly — this works to write the correct config, but the MCP server still fails to connect because Claude Code appears to re-parse or re-interpret the /c argument at runtime.
Expected Behaviorcmd /c should be passed through as-is and the MCP server should start correctly.
Actual Behavior
MCP server always shows Status: ✗ Failed to connect on Windows regardless of configuration method.
Impact
Windows users cannot use any local MCP servers with Claude Code, making a core advertised feature completely unavailable on Windows.
What Should Happen?
The cmd /c wrapper should be passed through as-is to the MCP server process, allowing local MCP servers to start correctly on Windows as documented in the official Claude Code documentation.
Error Messages/Logs
Status: ✗ Failed to connect
When /c flag is corrupted:
Args: /schedule uvx mcp_snowflake_server ...
or
Args: C:/ uvx mcp_snowflake_server ...
When running the MCP package directly via uvx:
AttributeError: module 'lib' has no attribute 'X509_V_FLAG_NOTIFY_POLICY'
(OpenSSL compatibility error with mcp_snowflake_server package on Windows)
Steps to Reproduce
- On Windows 11, open PowerShell
- Run: claude mcp add my-server -s user -- cmd /c uvx some-mcp-package
- Run: claude mcp get my-server
- Observe Args show
/scheduleorC:/instead of/c - Run: claude (start a session)
- Ask Claude to use the MCP tool
- Claude reports no MCP tool available
- Status permanently shows ✗ Failed to connect
Claude Model
Sonnet (default)
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.80
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
PowerShell
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗