Skip to content

Cursor MCP spawn npx ENOENT: what it means and how to fix it

Better Design

Direct answer

spawn npx ENOENT usually means the process starting the MCP server could not find the npx executable; ENOENT is Node's 'no such file or directory' error, so a missing working directory can raise it too. Fix the usual case by giving command the full path to npx, making sure your shell's environment reaches Cursor and restarting it, or on Windows by wrapping npx with cmd /c.

A hand-drawn terminal showing the command or error this guide covers: cursor mcp spawn npx enoent.

Commands that find and fix the missing npx

Each command below comes from the official docs, read on November 12, 2026. The comment above each line says what it does.

commands and config
# Cursor's docs say command must be on your system path or contain its full path; use the full path from which npx.
{
  "mcpServers": {
    "server-name": {
      "command": "/full/path/to/npx",
      "args": ["-y", "mcp-server"]
    }
  }
}

# Cursor's help says variables from your shell profile must be available to Cursor, then restart it.
Restart Cursor after updating your shell profile

# On Windows, the official MCP servers README says to wrap npx with cmd /c.
{
  "mcpServers": {
    "memory": {
      "command": "cmd",
      "args": ["/c", "npx", "-y", "@modelcontextprotocol/server-memory"]
    }
  }
}

# Run the server command in a terminal to see whether it starts outside the client.
npx -y @modelcontextprotocol/server-filesystem /Users/username/Desktop /Users/username/Downloads

# Shows the exact startup error in Cursor.
Output panel (Cmd+Shift+U / Ctrl+Shift+U) > MCP Logs

# MCP docs: on Windows, npx may keep failing if npm is not installed globally (%APPDATA%\npm missing).
npm install -g npm

The steps for cursor mcp spawn npx enoent

Four steps take you from the problem to a working MCP server.

A hand-drawn four-step path: Read the error in Cursor's MCP logs, Find the full path to npx, Put that path in mcp.json, or wrap it on Windows, Restart the server in Cursor's MCP settings.
  1. Step 1: Read the error in Cursor's MCP logs
  2. Step 2: Find the full path to npx
  3. Step 3: Put that path in mcp.json, or wrap it on Windows
  4. Step 4: Restart the server in Cursor's MCP settings

Causes and the documented fixes

npx is not on the PATH the client sees
Fix

Set command to the full path of npx

Source

Cursor docs, MCP debugging guide

Shell profile variables not available to Cursor
Fix

Make them available to Cursor and restart it

Source

Cursor help

Windows cannot launch npx directly
Fix

Use command cmd with args ["/c", "npx", ...]

Source

MCP servers README

${APPDATA} in a path on Windows
Fix

Add the expanded APPDATA value to env

Source

MCP connect local servers

Caveats the docs call out

  • Servers started over stdio inherit only a limited, platform-dependent set of environment variables; pass what they need in env.
  • The server's working directory may be undefined, so use absolute paths in the config and in .env files.
  • Node's docs state that on Windows .bat and .cmd files are not executable without a terminal and must be run through cmd.exe or a shell.
  • Apply the cmd /c wrapper only to npx entries; the servers README says to leave uvx entries unchanged.

Steal this workflow

Run this guide in your own assistant. The prompt carries the guide link and the workflow summary, so the assistant can adapt it to your project.

Read the guide "Cursor MCP spawn npx ENOENT: what it means and how to fix it" at https://better-design.com/blog/cursor-mcp-spawn-npx-enoent and help me apply it to my project.

spawn npx ENOENT usually means the process starting the MCP server could not find the npx executable; ENOENT is Node's 'no such file or directory' error, so a missing working directory can raise it too. Fix the usual case by giving command the full path to npx, making sure your shell's environment reaches Cursor and restarting it, or on Windows by wrapping npx with cmd /c.

Start by asking what I am building and which tools I use. Then walk me through the workflow step by step, adapted to my answers.

Claude and ChatGPT open with the prompt filled in. Gemini copies the prompt to your clipboard first, so paste it when the app opens.

Questions

Why does the server run in my terminal but not in Cursor?

Stdio servers inherit only a limited set of environment variables, so the PATH your terminal uses may not reach the server; use the full command path or pass env.

Where do I see the real error?

Open the Output panel and select MCP Logs.

What does ENOENT mean?

No such file or directory: no entity was found at the given path.

Where these commands and paths come from

Each command, path and caveat comes from the official docs, read on November 12, 2026. Commands change between releases, so check the docs for your version.

Add design guidance to the same setup

MCP servers give your coding agent tools and data. Better Design is an MCP server too: it gives the agent a design system, interface principles and review rules, so the screens it builds look designed.