Fix "spawn npx ENOENT" when starting an MCP server
Claude DesktopCursorWindsurf
The error
Error: spawn npx ENOENT
Why it happens
The app launched the server without your shell's PATH, so it cannot find npx. This is common with nvm, fnm, Volta, or Homebrew installs, because GUI apps do not load ~/.zshrc / ~/.bashrc.
How to fix it
- Confirm Node is installed
Runnode -vandwhich npx(macOS/Linux) orwhere npx(Windows).which npx # e.g. /Users/you/.nvm/versions/node/v22.11.0/bin/npx - Use the absolute path to npx
Replace"npx"with the full path from the previous step.{ "mcpServers": { "memory": { "command": "/Users/you/.nvm/versions/node/v22.11.0/bin/npx", "args": ["-y", "@modelcontextprotocol/server-memory"] } } } - Or pass PATH explicitly
Add anenv.PATHthat includes the Node bin folder, so npx can also findnode."env": { "PATH": "/Users/you/.nvm/versions/node/v22.11.0/bin:/usr/local/bin:/usr/bin:/bin" } - Restart the client
Fully quit and reopen the app so it re-spawns the server.
Related servers
Memory & Reasoning● Maintained
Memory (Knowledge Graph)
A basic implementation of persistent memory using a local knowledge graph. This lets Claude remember information about the user across chats.
★ 91.3k · updated 2026-10-10
Files & OS● Maintained
Filesystem
Node.js server implementing Model Context Protocol (MCP) for filesystem operations.
★ 91.3k · updated 2026-10-10
Memory & Reasoning● Maintained
Sequential Thinking
An MCP server implementation that provides a tool for dynamic and reflective problem-solving through a structured thinking process.
★ 91.3k · updated 2026-10-10