Problem
All official MCP server READMEs recommend config like:
{ "command": "npx", "args": ["-y", "@modelcontextprotocol/server-filesystem", ...] }
This silently fails on Windows because npx is installed as npx.cmd (a batch script shim), and child_process.spawn() — used by Claude Desktop and Claude Code — cannot execute .cmd files directly.
Expected Behavior
Server READMEs and config examples should include a Windows note, e.g.:
// macOS / Linux
{ "command": "npx", "args": ["-y", "@modelcontextprotocol/server-filesystem", ...] }
// Windows
{ "command": "cmd", "args": ["/c", "npx", "-y", "@modelcontextprotocol/server-filesystem", ...] }
Affected Servers
Any server installed via npx, including at minimum:
@modelcontextprotocol/server-filesystem
@modelcontextprotocol/server-gdrive
Root Cause
On Windows, npm installs npx as npx.cmd. Node.js child_process.spawn() cannot execute .cmd files unless shell: true is passed (which MCP clients don't do). The cmd /c wrapper runs the batch script through the Windows command interpreter.
This is a longstanding Node.js-on-Windows issue, not specific to MCP — but since MCP configs are copy-pasted from READMEs, Windows users hit it immediately.
Suggestion
- Add a "Windows" note to server READMEs showing the
cmd /c wrapper
- Consider adding a note to the MCP SDK docs about this platform difference
Environment
- Windows 11
- Claude Desktop + Claude Code (
/doctor warns about this)
- Node.js with npx
Workaround
Change config from "command": "npx" to "command": "cmd" with ["/c", "npx", ...] in args.
Problem
All official MCP server READMEs recommend config like:
{ "command": "npx", "args": ["-y", "@modelcontextprotocol/server-filesystem", ...] }This silently fails on Windows because
npxis installed asnpx.cmd(a batch script shim), andchild_process.spawn()— used by Claude Desktop and Claude Code — cannot execute.cmdfiles directly.Expected Behavior
Server READMEs and config examples should include a Windows note, e.g.:
Affected Servers
Any server installed via npx, including at minimum:
@modelcontextprotocol/server-filesystem@modelcontextprotocol/server-gdriveRoot Cause
On Windows, npm installs
npxasnpx.cmd. Node.jschild_process.spawn()cannot execute.cmdfiles unlessshell: trueis passed (which MCP clients don't do). Thecmd /cwrapper runs the batch script through the Windows command interpreter.This is a longstanding Node.js-on-Windows issue, not specific to MCP — but since MCP configs are copy-pasted from READMEs, Windows users hit it immediately.
Suggestion
cmd /cwrapperEnvironment
/doctorwarns about this)Workaround
Change config from
"command": "npx"to"command": "cmd"with["/c", "npx", ...]in args.