AgentFixFind a fix
Claude CodeConfirmed workaroundUpdated Aug 20, 2026

Claude Code MCP spawn npx ENOENT on Windows

Fix Claude Code MCP plugins that fail with SPAWN ERROR: ENOENT spawn npx ENOENT on native Windows.

Exact error

Match the message before using the fix

SPAWN ERROR: ENOENT spawn npx ENOENTFailed to connect

Quick 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

01

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.

  1. Back up the Claude MCP configuration.
  2. Set the command to `cmd`.
  3. Add `/c` and `npx` before the original package arguments.
  4. 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.

02

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.

  1. Run `where.exe npx`.
  2. Select the trusted npx.cmd installed with your Node distribution.
  3. Use that exact path as the MCP command.
  4. Restart Claude Code.

Expected: Claude starts the trusted npx.cmd shim directly.

Verification

Prove the fix worked

  1. Run `where.exe npx` in the same user account.
  2. Use Claude's MCP status/list command and confirm Connected.
  3. 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.

Check the configuration itself: validate your MCP configuration for JSON, command, args, env, npx, and Windows path risks. For a repeatable agent workflow, use the MCP debugging triage skill.