[BUG] "Error: unknown option '-y'" when adding mcp with npx in native windows installation
Environment
- Platform (select one):
- [ x ] Anthropic API
- Claude CLI version: 1.0.53 (Claude Code)
- Operating System: Windows 10 Pro 22H2
- Terminal: PowerShell
Bug Description
Trying to add mcp servers that work through npx locally, for example
claude mcp add context7 -- npx -y @upstash/context7-mcp
Result: error: unknown option '-y received, no server added
Tried reinstalling CC, rebooting terminal and PC, nothing works Not sure if it's the problem in Claude Code or somewhere else
Steps to Reproduce
- CC installed natively on Windows
- run
claude mcp add context7 -- npx -y @upstash/context7-mcpin PowerShell
Expected Behavior
MCP server added successfully
Actual Behavior
error: unknown option '-y received, no server added
Additional Context
It seems HTTP and SSE transport work fine
Quick Fix:
{
"mcpServers": {
"context7": {
"command": "cmd",
"args": ["/c", "npx", "-y", "@upstash/context7-mcp"]
}
}
}
Hey, I think this is a mirror of:
https://github.com/issues/assigned?issue=anthropics%7Cclaude-code%7C3369
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.