Windows: MCP servers using npx require 'cmd /c' wrapper

Resolved 💬 2 comments Opened Oct 15, 2025 by adamkane Closed Oct 15, 2025

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

  1. Install Claude Code on Windows
  2. Create .mcp.json with any npx-based MCP server:

``json
{
"mcpServers": {
"fetch": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-fetch"]
}
}
}
``

  1. Run Claude Code
  2. 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 npx directly in many cases
  • The warning doesn't specify whether the servers will actually fail without the wrapper

Questions

  1. Do npx-based servers actually fail on Windows without the wrapper?
  2. Should the wrapper be added automatically by Claude Code?
  3. Is this a Git Bash vs CMD/PowerShell issue?

Related

---

How to Submit

  1. Configure GitHub token in .env:

``bash
GITHUB_PERSONAL_ACCESS_TOKEN=ghp_your_token_here
``

  1. 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
``

  1. Or visit: https://github.com/anthropics/claude-code/issues/new

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗