Advertise hereReach developers building with AI coding agents. →

Based on each vendor’s official docs, checked

Fix spawn npx ENOENT when starting an MCP server

When an MCP client tries to start a local (stdio) server and prints spawn npx ENOENT, the client never reached the server: the operating system could not find the npx executable to launch. ENOENT is a process-start failure, not an MCP protocol error. This guide follows the Model Context Protocol reference servers README (Windows cmd /c wrapper), Node.js child_process docs on spawning .cmd files on Windows, and Claude Code’s MCP docs, all checked November 6, 2026. There is no /fix/ route on this site, so the page lives under /guides/.

  1. 1. Confirm Node and npx in a fresh terminal

    Open a new terminal (so it picks up your current PATH) and check that node and npx resolve. On Windows, where.exe npx often shows npx.cmd under your Node install. If these fail, install or repair Node before changing MCP config.

    node --version
    npx --version
  2. 2. Fully quit and reopen the MCP client

    GUI apps keep the PATH they inherited at launch. After installing Node, or after changing a version manager, quit the client completely (including tray processes) and open it again so it can see npx.

  3. 3. Keep command and args as separate fields

    Stdio MCP config takes a command string and an args array. Do not put the whole launch line in command. Claude Code’s docs show npx servers the same way: command npx with args such as -y and the package name.

    {
      "mcpServers": {
        "memory": {
          "command": "npx",
          "args": ["-y", "@modelcontextprotocol/server-memory"]
        }
      }
    }
  4. 4. On Windows, wrap npx with cmd /c

    The MCP reference servers README says that on Windows you should wrap npx with cmd /c: set command to cmd and put /c, npx, then the rest of the args. Node’s docs explain why: .bat and .cmd files on Windows are not launched by a direct spawn without a shell, and spawning cmd.exe with /c is the supported pattern.

    {
      "mcpServers": {
        "memory": {
          "command": "cmd",
          "args": ["/c", "npx", "-y", "@modelcontextprotocol/server-memory"]
        }
      }
    }
  5. 5. If PATH is still wrong, use an absolute path

    When the client’s environment still lacks your Node bin directory (common with nvm, fnm or Volta, or a Node install after the app started), set command to the full path of npx or npx.cmd from where.exe / which. Prefer this over guessing shell wrappers on macOS and Linux.

Why Windows hits this more often

On Windows, npm installs npx as the batch shim npx.cmd. Node’s child_process documentation says .bat and .cmd files cannot be launched with a default execFile/spawn without a shell, and shows spawning cmd.exe with /c as the fix. MCP clients that spawn the configured command without a shell therefore fail with ENOENT on a bare "npx" until you wrap it or point at npx.cmd.

The MCP servers README documents the cmd /c wrapper for Claude Desktop-style mcpServers JSON and says to apply the same change to other npx-based entries, leaving uvx entries unchanged.

Claude Code’s position

Claude Code’s current MCP docs show stdio examples with command npx and do not require the Windows wrapper on that page. Our Claude Code on Windows guide notes that Anthropic’s changelog listed a “Windows requires cmd /c wrapper” MCP config warning as a removed false positive, so update Claude Code before you rewrite every config just because of an old warning.

If you still see spawn npx ENOENT after updating, follow the MCP project’s Windows example above, keep the fix in a config file you own (not only inside a plugin cache that updates wipe), and reconnect the server from /mcp.

After the server starts

A stdio server that starts successfully may look like it hangs in a terminal because it is waiting for JSON-RPC on stdin; that is expected. Failures after spawn (missing API key, auth, timeouts) are different problems: fix env, headers or the server itself, not PATH.

Use each agent’s status command to confirm the connection: claude mcp list or /mcp in Claude Code, Cursor’s MCP panel, codex mcp list, and the matching Copilot or Antigravity MCP UI.

Tips

Next steps

Claude Code hub

→

Cursor hub

→

OpenAI Codex hub

→

GitHub Copilot hub

→

Google Antigravity hub

→

How to add an MCP server to Codex

→

How to add an MCP server to Cursor

→

How to add an MCP server to GitHub Copilot in VS Code

→

How to add an MCP server to Google Antigravity

→

How to migrate from Gemini CLI to Antigravity CLI

→

Portable agent skills: one SKILL.md for every coding agent

→

Safe “always allow” rules for Claude Code and Codex CLI

→

GitHub Copilot CLI yolo mode: --allow-all and safer tool rules

→

Codex sandbox modes and approval policies explained

→

How to install Claude Code on macOS, Linux and Windows

→

How to install the OpenAI Codex CLI

→

Claude Code auto mode: what runs, what gets blocked, how to turn it off

→

Agent Skills moves to the Agentic AI Foundation: what changes

→

MCP security: the risks in MCP servers and how to lock them down

→

Claude Code in VS Code: install, shortcuts and CLI differences

→

What is AGENTS.md? The open instruction file for coding agents

→

Claude Code on Windows: native, WSL and common errors

→

Codex skills: create, install and use SKILL.md skills in Codex

→

GitHub Copilot CLI: install, sign in and start using it

→

Cursor Agent SDK: build, test and deploy agents as code

→

GPT-6.1 Terra in Codex and the API: setup, pricing and limits

→

MCP OAuth: connect a remote MCP server in Claude Code, Codex and Cursor

→

Codex config.toml: location, precedence and the settings to change

→

Codex on Windows: native sandbox setup, WSL and fixes

→

Antigravity CLI (agy): install, sign in, modes and commands

→

Google Antigravity on Windows: install, WSL, sandbox and fixes

→

GitHub Copilot coding agent (now cloud agent): how to use it

→

GitHub Copilot agent mode: how to use it in your IDE

→

Claude Code tips from Anthropic’s best practices

→

Claude Code with OpenRouter: setup, models and troubleshooting

→

How to add an MCP server: Claude Code, Codex, Cursor, Copilot and Antigravity

→

Supabase RLS for AI-built apps: grants, policies and tests

→

Antigravity skills: create, store and run SKILL.md skills

→

Claude Code in JetBrains IDEs: install, connect and fix issues

→

GitHub Copilot skills: create, install and use agent skills

→

Claude Code subagents: create, configure and run them

→

Check which plugins, hooks and MCP servers your agent loads

→

Cursor rules examples: .mdc files for each rule type

→

Frequently asked questions

The MCP client could not find npx (or the path you set as command) when starting a stdio server. The server process never launched.

Sources