
This fix is part of MCP troubleshooting, within The MCP Guide. Still stuck? Request a free MCP readiness review.
spawn npx ENOENT means the MCP client tried to start your server with the npx command and the operating system could not find a program by that name. Nothing is wrong with the server itself yet. The fastest fix is to find the real location of npx (run which npx on macOS or Linux, where npx on Windows), put that full path in the command field, and restart the client.
Checked against: the Node.js child_process docs, the MCP local server guide, the MCP debugging guide and the source of the @modelcontextprotocol/sdk 1.32.2 npm package on 2 November 2026. eSEOspace did not reproduce the error on every OS.
Key Takeaways
- ENOENT is a Node.js error code meaning "no such file or directory," and Node also emits it "when the command does not exist."
- MCP clients start stdio servers without your shell profile, so tools added to
PATHby nvm, Homebrew or fnm may be invisible. - The fix is usually an absolute path in
command, or aPATHvalue in the server'senvblock. - On Windows,
npxis a.cmdfile, and Node says.cmdfiles "are not executable on their own without a terminal." - The same error with
uvx,nodeorpythonhas the same cause and the same fix.
What this error means
Most desktop MCP clients are built on Node.js. They launch a local server with a child process call. The Node.js docs say that if the working directory does not exist, the child "emits an ENOENT error and exits immediately," and that "ENOENT is also emitted when the command does not exist."
So spawn npx ENOENT reads as: "I tried to spawn npx and it was not there." The program is missing from the search path the client uses, or Node is not installed at all.
Why does it work in your terminal? The MCP debugging guide says stdio servers "inherit only a limited subset of environment variables automatically." The TypeScript SDK's stdio client, checked in version 1.32.2, passes only HOME, LOGNAME, PATH, SHELL, TERM and USER on macOS and Linux by default. If the client app itself was opened from the Dock or Start menu, its PATH never included the folders your shell profile adds.
A GitHub thread about nvm shows the same pattern. An MCP maintainer explained that nvm works through "a very complicated shell function" in your profile, which GUI apps do not load.
Quick fix
- Confirm Node is installed: run
node --versionandnpx --versionin a terminal. If either fails, install the Node.js LTS release from nodejs.org, as the local server guide recommends. - Find the full path:
which npx(macOS, Linux) orwhere npx(Windows). - Replace
"command": "npx"with that path. - Because
npxitself callsnode, add the same folder toPATHin theenvblock. - Fully quit and reopen the client.
Example for macOS with Node from nvm (your version folder will differ):
{
"mcpServers": {
"filesystem": {
"command": "/Users/you/.nvm/versions/node/v24.11.0/bin/npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/Users/you/Desktop"],
"env": {
"PATH": "/Users/you/.nvm/versions/node/v24.11.0/bin:/usr/bin:/bin"
}
}
}
}
The nvm thread's other workaround also works: install the server globally with npm, then call node by full path with the full path to the server's script.
Fix by client / OS
Claude Desktop
Edit claude_desktop_config.json through Settings > Developer > Edit Config, then quit with Cmd+Q (macOS) or from the tray icon (Windows). On Windows, if the log mentions ${APPDATA}, the local server guide says to add the expanded APPDATA value to env and to make sure npm is installed globally, which you can check by looking for %APPDATA%\npm. If you install the server as a desktop extension instead, Claude's help article says Claude Desktop has a built-in Node.js, so no system Node is needed for extensions.
Cursor
Edit ~/.cursor/mcp.json or the project's .cursor/mcp.json. Cursor's MCP docs say Cursor resolves ${userHome} and ${env:NAME} inside command, args and env, which helps keep a shared file portable. Open Output and pick MCP Logs to see the spawn error.
Claude Code
Claude Code runs from your terminal, so it usually inherits your shell's PATH. If you still see ENOENT, add the server with a full path after the -- separator, as the Claude Code MCP docs show: claude mcp add myserver -- /full/path/to/npx -y package-name.
Windows in any client
npx on Windows is npx.cmd. The Node.js docs say .bat and .cmd files can be run by "spawning cmd.exe and passing the .bat or .cmd file as an argument." The TypeScript SDK client uses the cross-spawn package, which handles this for you. If a client does not, wrap the call:
{
"mcpServers": {
"filesystem": {
"command": "cmd",
"args": ["/c", "npx", "-y", "@modelcontextprotocol/server-filesystem", "C:\\Users\\you\\Desktop"]
}
}
}
More Windows causes are in MCP server failed to start on Windows.
Where to find the logs
- Claude Desktop:
mcp.login~/Library/Logs/Claude(macOS),%APPDATA%\Claude\logs(Windows) or~/.config/Claude/logs(Linux), per the debugging guide. - Cursor: Output panel, MCP Logs.
- Claude Code:
claude mcp listshows✘ Failed to connectwith the error detail, andclaude mcp get <name>shows it on anIssue:line.
If it still fails
- ENOENT with a full path means the path is wrong or the folder in
cwddoes not exist. Copy the path again fromwhichorwhere. - The server starts, then exits. That is a new error. Read
mcp-server-SERVERNAME.log, and see could not attach to MCP server. - The package needs a newer Node. See MCP Node version errors.
- Python servers fail the same way with
spawn uvx ENOENT. See uvx not found.
Look up any JSON-RPC code that appears next in the MCP error code lookup. Teams that want one tested config for every laptop can get help through MCP development.
More in the MCP Guide
Free tools: MCP Error Code Lookup · MCP Config Generator
Latest research: State of MCP: October 2026
Frequently asked questions
What does ENOENT stand for?
It is a POSIX error name for "error, no entry," meaning no such file or directory. Node.js reuses it when the program you asked it to spawn cannot be found.
Why does npx work in my terminal but not in the MCP client?
Your terminal loads your shell profile, which adds Node's folder to PATH. A desktop app opened from the Dock or Start menu does not, and the MCP client passes only a few variables to the server.
Should I use cmd /c on Windows?
Only if your client fails to run npx directly. Node's docs list spawning cmd.exe with the .cmd file as a supported way to run it. Clients built on the TypeScript SDK resolve .cmd files already.
Is it safe to install MCP servers globally instead of using npx?
It can be more predictable, because the version stays fixed. You must update it yourself. Check any server against the MCP server risk checklist before you install it.











