Exact error
Match the message before using the fix
SPAWN ERROR: ENOENT spawn npx ENOENTFailed to connectQuick answer
Start here
Configure the MCP server to launch through `cmd /c npx` on native Windows. The reporter verified this across six plugins. A direct edit inside a plugin cache can be overwritten by updates, so prefer a user-owned MCP definition or wrapper that you control.
Diagnosis
Why it happens
- The native Windows process launcher fails to resolve the bare `npx` command in the affected plugin definitions.
- Launching through the Windows command processor lets the `.cmd` shim resolve.
Safest first
Fixes, in order
Use cmd /c npx in a user-owned MCP definition
Applies when: Best match for native Windows and bare-npx plugin entries
The first-hand report connected Context7, Chrome DevTools, Azure, MongoDB, Desktop Commander, and Playwright after this change.
- Back up the Claude MCP configuration.
- Set the command to `cmd`.
- Add `/c` and `npx` before the original package arguments.
- Restart Claude Code and list MCP connections.
command: cmd
args: /c, npx, -y, <package-name>Expected: The MCP server shows Connected instead of spawn npx ENOENT.
Use an explicit npx.cmd path
Applies when: Alternative when command lookup is restricted
An absolute path removes PATH ambiguity but must be updated if Node is moved.
- Run `where.exe npx`.
- Select the trusted npx.cmd installed with your Node distribution.
- Use that exact path as the MCP command.
- Restart Claude Code.
Expected: Claude starts the trusted npx.cmd shim directly.
Verification
Prove the fix worked
- Run `where.exe npx` in the same user account.
- Use Claude's MCP status/list command and confirm Connected.
- Call one read-only tool from the server.
Escalation
If it still fails
- Run the effective command manually and check whether the package exits with its own error.
- Record Node, npm, Claude Code, Windows, and plugin versions.
- Do not keep the only fix inside an auto-updated plugin cache.
Scope
Environment and version notes
- The confirmed report covered Claude Code 2.1.139, Windows 10/11, and Node 20/22.
- The issue was closed as stale/not planned, not as a documented shipped fix.
- Sources rechecked August 20, 2026.
Evidence
Sources
Source labels describe the evidence available on the checked date. A closed issue is not automatically a shipped fix.