MCP servers fail on Windows with npx (use cmd /c)
Claude DesktopCursorVS Code
The error
spawn npx ENOENT • 'npx' is not recognized • Connection closed (Windows only)
Why it happens
On Windows, npx is a npx.cmd batch script, which cannot be spawned directly without a shell. Clients that spawn the command directly fail.
How to fix it
- Wrap npx with cmd /c
Makecmdthe command and pass/c npx …as args.{ "mcpServers": { "github": { "command": "cmd", "args": ["/c", "npx", "-y", "@modelcontextprotocol/server-filesystem", "C:\\Users\\you\\Desktop"] } } } - Escape backslashes
In JSON every Windows path backslash must be doubled:C:\\Users\\you. - Add APPDATA if npm cannot find its cache
Some setups needAPPDATApassed through."env": { "APPDATA": "C:\\Users\\you\\AppData\\Roaming\\" }
Related servers
Files & OS● Maintained
Filesystem
Node.js server implementing Model Context Protocol (MCP) for filesystem operations.
★ 91.3k · updated 2026-10-10
Files & OS● Maintained
Desktop Commander
This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities
★ 10.1k · updated 2026-10-14 · 🔑 auth
Browser Automation● Maintained
Playwright (Microsoft)
Playwright MCP server
★ 38.2k · updated 2026-10-08
Sources
- https://modelcontextprotocol.io/docs/develop/connect-local-servers
- https://nodejs.org/api/child_process.html#spawning-bat-and-cmd-files-on-windows
- MCP servers cannot start: npx.cmd missing (Windows) (GitHub issue, 1 comments)
- Windows: stdio MCP servers fail with "spawn npx ENOENT" (v2 engine regression) (GitHub issue, 2 comments)
- MCP server spawn fails on Windows for .cmd executables (npx, etc.) (GitHub issue, 3 comments)