🩺Free

Fix Cursor MCP `spawn npx ENOENT` on macOS, Linux, and Windows

Published: 2026-07-30Updated: 2026-08-12~8 min

MCP Radar Editorial · Facts verified: 2026-08-12 · Refresh due: 2026-09-12

Direct answer

`spawn npx ENOENT` means Cursor could not launch the configured executable; the MCP package has not run yet. Verify the `npx` path visible to the Cursor process, relaunch Cursor after PATH changes, and use the OS-appropriate executable or launcher. Then continue testing package resolution and MCP discovery as separate stages.

The launch pipeline

1

Locate executable

Cursor resolves `command` using its own environment.

2

Resolve package

npx contacts a registry or cache for the named package.

3

Start server

The package loads runtime, config, and credentials.

4

Discover MCP

Cursor connects and learns the exposed capabilities.

ENOENT is stage one. Fixing it only proves that the operating system located a command.
Observed errorFailed stageFirst check
spawn npx ENOENTExecutable lookupCursor process PATH or full command path
npm E404 / package not foundPackage resolutionPackage identifier and registry
Process exits immediatelyServer startupstderr, runtime version, required environment
Handshake/discovery errorMCP protocolServer logs and current protocol support
Connected but no toolsCapability discoveryMCP Logs and tools/resources exposed
Classify the first failed stage before editing package names, timeouts, or credentials.

Run the 60-second checklist

Open Cursor's Output panel with Cmd+Shift+U on macOS or Ctrl+Shift+U on Windows/Linux, choose MCP Logs, and copy the first error without secrets. In a terminal, locate `npx`; then compare that path with the command in `.cursor/mcp.json` or `~/.cursor/mcp.json`. If Node was installed or changed while Cursor was open, fully quit and relaunch the app.

  • Confirm Node and npm/npx are installed for the same user that runs Cursor.
  • Confirm the config uses `command` for stdio and `url` for a remote server.
  • Test the package command in a clean terminal before testing inside Cursor.
  • Do not add a long timeout to an executable-not-found error.

Why the terminal and Cursor can see different PATH values

A GUI application may inherit its environment from the desktop session rather than an interactive shell startup file. Node version managers commonly modify PATH only when a shell initializes. Cursor therefore may not see the same `npx` that `which npx` or `where npx` finds in your terminal.

An absolute path is a useful diagnostic and sometimes a stable fix, but version-manager paths can change after upgrades. Prefer a stable launcher path or ensure the desktop environment receives the intended Node installation.

macOS and Linux checks

Use `command -v npx` or `which npx`, then run that exact path with `--version`. Put the resolved executable in the config temporarily, relaunch Cursor, and watch MCP Logs. If this fixes ENOENT, decide whether to keep the stable path or repair the environment that launches Cursor.

Locate and test npx

command -v npx
npx --version
# Example diagnostic only:
# "command": "/absolute/path/to/npx"

Windows checks: `npx.cmd` and `cmd.exe /c`

Use `where npx` and `where node` in Command Prompt. Node's child-process documentation explains that `.cmd` files are not executable on their own on Windows; a launcher may need a shell or `cmd.exe /c`. Cursor's current docs require the command to be on PATH or supplied as a full path. Preserve JSON escaping for backslashes and quote paths with spaces correctly.

Locate Windows launchers

where node
where npm
where npx
npx --version

Fallback config shape when direct npx launch fails

{
  "mcpServers": {
    "example": {
      "type": "stdio",
      "command": "C:\\Windows\\System32\\cmd.exe",
      "args": ["/d", "/s", "/c", "npx.cmd", "-y", "example-mcp-server"]
    }
  }
}

Verify the fix in MCP Logs

After ENOENT disappears, expect a different result: a running process, a package error, an initialization/discovery error, or listed capabilities. Cursor documents MCP Logs in the Output panel and shows server initialization, tool calls, and errors there. A successful process launch is not proof that the package initialized, exposed tools, or is safe.

Know when this guide no longer applies

If npm reports a missing package, correct the package name or registry. If the process exits, read stderr for runtime or credential requirements. If it connects but times out or exposes no tools, move to protocol, auth, or handler diagnostics. Keep the original error and sanitized config in an escalation packet so maintainers can reproduce the same stage.

Methodology and limitations

  • Cursor configuration and log locations were verified from current official Cursor docs on 2026-08-12.
  • Windows `.cmd` behavior is based on official Node child-process documentation.
  • Cursor IDE is not installed in this environment, and Windows/Linux were not locally reproduced. Those experience gaps are disclosed rather than presented as tests.

Frequently asked questions

Does `spawn npx ENOENT` mean the MCP package is broken?

No. The operating system could not locate or execute the configured `npx` command, so the package did not start.

Should I always hardcode an absolute npx path?

No. It is a strong diagnostic and can be a fix, but version-manager paths may change. A stable Node installation or launcher environment can be easier to maintain.

Where are Cursor MCP logs?

Open the Output panel with Cmd+Shift+U or Ctrl+Shift+U and select MCP Logs from the dropdown.

Sources

  1. Cursor — Model Context Protocol · retrieved 2026-08-12
  2. Node.js — child process · retrieved 2026-08-12

Continue reading