Windows: MCP servers using npx require 'cmd /c' wrapper
GitHub Issue: Windows npx Wrapper Warning
Repository: https://github.com/anthropics/claude-code/issues
Title: Windows: MCP servers using npx require 'cmd /c' wrapper
---
Issue Description
When using MCP servers with npx on Windows, Claude Code generates warnings that the command requires a cmd /c wrapper to execute properly.
Environment
- OS: Windows 11 (10.0.26200)
- Shell: Git Bash (MINGW64_NT)
- Claude Code Version: 2.0.17
- Platform: win32
Current Behavior
All MCP servers configured with "command": "npx" generate the following warning:
[Warning] [server-name] mcpServers.server-name: Windows requires 'cmd /c' wrapper to execute npx
This affects all 12 npx-based servers in the configuration:
- fetch
- github
- gitlab
- slack
- sentry
- google-maps
- brave-search
- postgres
- context7
- notion
- cloudflare
- browserbase
Example Configuration
{
"mcpServers": {
"slack": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-slack"],
"env": {
"SLACK_BOT_TOKEN": "${SLACK_BOT_TOKEN}",
"SLACK_TEAM_ID": "${SLACK_TEAM_ID}"
}
}
}
}
Expected Behavior
Option 1: Auto-wrapper
Claude Code should automatically wrap npx commands with cmd /c on Windows platforms without requiring explicit configuration.
Option 2: No warning
If the current implementation works correctly without the wrapper, the warning should not appear.
Option 3: Documentation
If users must manually add the wrapper, provide clear documentation on the correct format.
Steps to Reproduce
- Install Claude Code on Windows
- Create
.mcp.jsonwith any npx-based MCP server:
``json``
{
"mcpServers": {
"fetch": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-fetch"]
}
}
}
- Run Claude Code
- Check MCP server diagnostics
Possible Solutions
Solution A: Auto-detect Platform and Wrap
// In MCP server loader
if (process.platform === 'win32' && command === 'npx') {
command = 'cmd';
args = ['/c', 'npx', ...args];
}
Solution B: Update Documentation
Provide Windows-specific configuration example:
{
"mcpServers": {
"fetch": {
"command": "cmd",
"args": ["/c", "npx", "-y", "@modelcontextprotocol/server-fetch"]
}
}
}
Solution C: Shell Detection
Detect if user is running in Git Bash/PowerShell and adjust accordingly, as Git Bash may not require the wrapper.
Impact
- Severity: Medium (warnings but functionality may work)
- Frequency: Affects all Windows users with npx-based MCP servers
- Workaround: Unknown if manual wrapper is needed
Additional Context
- This warning appears even for the official
@modelcontextprotocol/*packages - Git Bash on Windows can execute
npxdirectly in many cases - The warning doesn't specify whether the servers will actually fail without the wrapper
Questions
- Do npx-based servers actually fail on Windows without the wrapper?
- Should the wrapper be added automatically by Claude Code?
- Is this a Git Bash vs CMD/PowerShell issue?
Related
- Repository: https://github.com/anthropics/claude-code
- MCP Specification: https://modelcontextprotocol.io
- Affected servers: All official MCP servers using npx
---
How to Submit
- Configure GitHub token in
.env:
``bash``
GITHUB_PERSONAL_ACCESS_TOKEN=ghp_your_token_here
- Use GitHub CLI:
``bash``
gh issue create --repo anthropics/claude-code --title "Windows: MCP servers using npx require 'cmd /c' wrapper" --body-file github-issue-npx-windows-wrapper.md
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗