Cursor "MCP server failed to start — spawn npx ENOENT"
Error: MCP server failed to start (code -32000): spawn npx ENOENT
- Affected versions
- 0.40.x – 0.42.x
- Fixed in
- —
- Last verified
- Cursor 0.42.3
Root cause
Cursor launches MCP stdio servers with the command from mcp.json, but `npx` is not on the PATH that the editor process inherits (common on macOS GUI launches and Windows where Node is installed per-user).
How to reproduce
Add an MCP server using `npx -y some-mcp` in mcp.json, reload, server shows red 'failed to start'.
Solutions (3)
Ordered by community votes. Always check the verified version before applying.
Use the absolute path to `npx` instead of bare `npx`. Find it with `which npx` (macOS/Linux) or `where npx` (Windows), then set `"command": "/full/path/to/npx"` in mcp.json.
Last verified: Cursor 0.42.3 · community
On Windows, set `"command": "cmd"` and `"args": ["/c", "npx", "-y", "some-mcp"]` so the shell resolves npx.
Last verified: Cursor 0.42.1 · community
Launch Cursor from a terminal (`open -a Cursor` / `cursor .`) so it inherits your shell PATH including nvm.
Last verified: Cursor 0.42.0 · community