MCP spawn ENOENT and npx Not Found: What the Error Actually Points At
spawn ENOENT means the client tried to launch something and the operating system could not find it.The missing target can be the command binary itself (npx,python3, a custom server) or a path inside the arguments. This is a runtime launch failure, not a config-format error — the JSON can be perfectly valid and the launch still fails. The right first move is to read which file the error names, then fix that target.
This page is cross-client runtime troubleshooting — the config schemas are covered by thecompatibility matrix; here the format is assumed correct and the launch is what fails. The rules below are observed runtime patterns matched against pasted error logs, not official client facts.
Symptoms this page covers
Error: spawn npx ENOENTin the client’s MCP log.'npx' is not recognized as an internal or external commandon Windows.Executable not found on PATHorcommand not found.- The server works when you run the same command in a terminal, but not from the client.
Possible causes, ordered by evidence strength
- The binary is not on the PATH the client inherited (matches a known log pattern). GUI applications usually do not read your interactive shell profile, so a Node installed through a version manager (nvm, fnm, volta — each with its own directory layout) can be invisible to the client even though
npxworks in your terminal. On Windows, the client likewise gets the system/user PATH, not your shell customizations. - The ENOENT target is a path in the args, not the command (documented false-positive boundary).The
runtime.spawn-enoentrule matches the log pattern, but ENOENT can also come from a missing directory or file passed as an argument. Confirm the actual target in the error before editing the config — replacingnpxwith an absolute path does nothing when the missing file was an argument. - Windows npx vs npx.cmd (info-level boundary hint). Whether the
.cmdsuffix is required depends on the client’s spawn implementation — it is not a universal fix. The doctor flagsnpx.cmdas a hint, not an error. - A missing -y flag stalls first runs (different failure, often confused). Without
-y, npx waits for an install confirmation the client can never answer — the server hangs rather than fails with ENOENT.-ysolves the confirmation prompt; it does nothing for “npx not found”. - Wrong interpreter name (same family of problem).
pythonvspython3differs across platforms, and on Windowspythoncan resolve to a Store stub. The same PATH logic applies.
Reproduced with the production rules
Each block below is a fixture executed by this site’s verification suite through the same diagnosis engine as the homepage tool. The config is shown; the pasted error text is matched locally and never stored or echoed.
spawn ENOENT
Log line (synthetic example): Error: spawn npx ENOENT
Config under diagnosis
{
"mcpServers": {
"github": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-github"
]
}
}
}What the doctor reports for this exact input
Client claude-desktop on windows → status blocking_error · rule: runtime.spawn-enoent
- The error log reports spawn ENOENT: the command binary was not found.
npx not recognized (Windows)
Log line (synthetic example): 'npx' is not recognized as an internal or external command
Config under diagnosis
{
"mcpServers": {
"github": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-github"
]
}
}
}What the doctor reports for this exact input
Client cursor on windows → status blocking_error · rule: runtime.npx-not-found
- The error log reports npx was not found or not recognized.
Executable not found on PATH
Log line (synthetic example): Executable not found on PATH.
Config under diagnosis
{
"mcpServers": {
"tools": {
"command": "mybin",
"args": []
}
}
}What the doctor reports for this exact input
Client cursor on linux → status blocking_error · rules: os.unix-executable-permission (non-blocking), runtime.path-issue
- Server "tools" runs "mybin"; on linux confirm the executable bit is set (this tool cannot verify it).
- The error log mentions PATH together with a not-found failure; the binary may not be on the PATH the client uses.
Boundary: an ordinary “path” word is not a PATH problem
Config under diagnosis
{
"mcpServers": {
"tools": {
"command": "npx",
"args": [
"-y",
"pkg"
]
}
}
}What the doctor reports for this exact input
Client cursor on macos → status runtime_unverified
Boundary: npx.cmd on Windows is a hint, not a verdict
Config under diagnosis
{
"mcpServers": {
"tools": {
"command": "npx.cmd",
"args": [
"-y",
"pkg"
]
}
}
}What the doctor reports for this exact input
Client cursor on windows → status runtime_unverified · rule: os.npx-cmd-boundary (non-blocking)
- Server "tools" uses npx.cmd; on Windows prefer npx on PATH unless the client requires the .cmd form.
How to fix it
The commands below are for you to run on your own machine to verify PATH resolution — this website never executes anything. There is no single absolute npx path that fits every Node version manager; find yours first.
Windows
- Find where npx actually lives: run
where npxin a terminal. Note the full path (including anynpx.cmdshim). - Compare with what the client sees: GUI apps inherit the system/user PATH from Windows, not your terminal’s session changes. If Node was just installed or the PATH was just edited, sign out/in or reboot so the new PATH reaches GUI processes.
- If the client still cannot find it, put the full path in the config — for example
"command": "C:\\Program Files\\nodejs\\npx.cmd"(adjust to the pathwhere npxreported; version managers use their own directories). - If plain
npxfails but the binary exists, test the explicitnpx.cmdform — whether it is needed depends on the client’s spawn implementation. - Re-check the error target: if ENOENT names an argument path (a directory the server should read), fix that path instead of the command.
macOS / Linux
- Find the binary: run
which npx(orcommand -v npx) in a terminal. - Understand the gap: GUI apps launched from Finder, a dock, or a desktop launcher do not source
.zshrc/.bashrc, so version-manager shims on your shell PATH are invisible to the client. - Put the absolute path from step 1 into the config’s
commandfield, or install Node into a system location the GUI inherits. The exact path depends on your version manager — there is no universal one to copy. - On Linux, a bare custom executable may also need the execute bit (
chmod +x) — the doctor reminds you of this but cannot inspect your filesystem. - Re-check the error target before assuming the command is the problem: a missing directory in
argsproduces the same ENOENT family.
Verify inside your client
- Restart the client (fully quit first for desktop apps) and watch the server reach a running state.
- Open the client’s MCP log or output channel and confirm the ENOENT line is gone.
- Invoke one of the server’s tools end to end. A clean config plus a clean log plus a working tool call is the only complete verification.
What static checks cannot prove
The runtime rules on this page match patterns in a pasted error log; they cannot see your filesystem, your PATH, or whether a server actually started. runtime.spawn-enoent tells you the launch failed — it cannot tell you which file was missing until you read the error’s target, and a log line like “server not showing” is a low-confidence hint with several possible causes, never a single root cause. Likewise, a config that passes every static check is only schema-valid; runtime verification happens in your client, on your machine.
Frequently asked questions
What does "spawn npx ENOENT" mean in an MCP client?
ENOENT is the operating system reporting that a file does not exist. "spawn npx ENOENT" means the client tried to launch npx and the OS found no such executable on the PATH that client process inherited. It does not prove npx is missing from your machine - it proves the client cannot see it. GUI applications on macOS and Windows usually do not read your shell profile (.zshrc, .bashrc), so a terminal where npx works can coexist with a client where it does not.
Does spawn ENOENT always mean npx is missing?
No. ENOENT can point at the command binary or at a missing path inside the args - for example a directory argument that does not exist. Read the error for the actual target first: the name right after "spawn" is the binary the client tried to launch, while a "no such file or directory" message may name an argument path. Fix the target the error names, not a guessed one.
Does adding -y to npx args fix "npx not found"?
No. -y answers npx's install confirmation prompt, which matters because a client cannot answer prompts - but it only helps after npx itself launches. If the error says npx was not found, the problem is PATH resolution: the client needs npx on its own PATH, or the config needs a full path to the binary.
Should I write npx or npx.cmd on Windows?
It depends on how the client spawns processes. Some Windows spawn implementations only resolve .cmd shims when the extension is explicit; others resolve npx fine. The doctor reports "npx.cmd" as an info-level boundary hint, not a verdict: if plain npx fails with ENOENT on Windows, trying the explicit npx.cmd (or a full path to it) is a reasonable next test.
Related:Claude Desktop MCP not showing on Windows(config-side causes),VS Code MCP server not showing(schema-side causes), thetop 5 MCP configuration errors, and theclient compatibility matrix.