Windows: claude mcp add mangles /c flag, breaks npx-based MCP servers
Resolved 💬 4 comments Opened Jan 22, 2026 by PaulNonatomic Closed Feb 28, 2026
Description
This issue documents two specific problems not fully covered by related issues:
- CLI Bug:
claude mcp addmangles/cintoC:/when users try to add the Windows wrapper manually - Regression: This broke after reinstalling Claude Code with the new native installer - previously MCP servers worked without manual
cmd /cconfiguration
Related Issues
- #19571 - Broader Windows/Git Bash shell handling (open)
- #15562 - Feature request for cross-platform MCP config with
shell: trueoption (open) - #9594 - Original report about npx needing
cmd /c(closed as "not planned" - incorrectly IMO)
This issue focuses on the CLI-specific bug that makes the workaround impossible via command line.
Steps to Reproduce
Problem 1: Missing wrapper
claude mcp add myserver npx @some/mcp-server@latest --env API_KEY=xxx
Result: Warning "Windows requires 'cmd /c' wrapper to execute npx"
Problem 2: CLI mangles /c flag
claude mcp add myserver cmd /c npx @some/mcp-server@latest --env API_KEY=xxx
Result in config:
{
"command": "cmd",
"args": ["C:/", "npx", "@some/mcp-server@latest"] // /c became C:/
}
Regression Evidence
This worked before reinstalling Claude Code with the new native installer. The previous version either:
- Auto-wrapped npx commands with
cmd /con Windows - Handled the shell spawning differently
- Or preserved existing configs that already had the fix
After reinstall, all npx-based MCP servers broke and required manual config editing.
Workaround
Manually edit your Claude config file to fix the args:
{
"mcpServers": {
"myserver": {
"type": "stdio",
"command": "cmd",
"args": ["/c", "npx", "@some/mcp-server@latest"],
"env": {
"API_KEY": "xxx"
}
}
}
}
Suggested Fixes
- Fix the CLI parser - Don't interpret
/cas a path - Auto-detect Windows - When command is
npxon Windows, auto-wrap withcmd /c - Add
shell: trueoption - As proposed in #15562
Environment
- OS: Windows 10/11
- Claude Code: Latest (post native installer update)
- Shell: Affects all shells (cmd, PowerShell, Windows Terminal, Git Bash)
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗