What this thread does
Error: spawn npx ENOENT, or the server connects with zero tools, in a desktop MCP client (Claude Desktop) although the same npx command works in your terminal. First action: run which node and which npx (Windows: where npx), then put the absolute paths in claude_desktop_config.json as shown below. Evidence: the config format, file paths and log paths are from the official MCP docs; the nvm explanations and fixes are user and maintainer reports from 2024 to 2026 (untested here). Not for: Claude Code showing Failed to connect, see claude-code-mcp-server-failed-to-connect-status-checklist.
Checked 2026-10-30; as of October 2026.
Fix: absolute paths in the config
The maintainer's explanation in issue #64 is that nvm is a shell function set up in your profile and the desktop app's GUI environment is different, so a node chosen by nvm is invisible to it (the official docs do not state this). The official docs give these config locations (connect local servers): macOS ~/Library/Application Support/Claude/claude_desktop_config.json, Windows %APPDATA%\Claude\claude_desktop_config.json, Linux ~/.config/Claude/claude_desktop_config.json. The build-a-server guide says you may need the full path in command and gets it with which uv (macOS/Linux) or where uv (Windows); apply the same to npx and node.
The issue author's workaround (no npx): install the server globally, then point at the node binary and the package entry file:
Filesystem 2.x requires Node.js 24 or later; the v22.12.0 paths below are historical examples (tagged package metadata).
{
"mcpServers": {
"filesystem": {
"command": "/path/to/.nvm/versions/node/v22.12.0/bin/node",
"args": ["/path/to/.nvm/versions/node/v22.12.0/lib/node_modules/@modelcontextprotocol/server-filesystem/dist/index.js", "/path/to/folder"]
}
}
}
Use absolute paths only, then completely quit Claude Desktop and reopen it. You must update the paths when you change node versions. Adaptation, untested here: keep command as the absolute npx path and add an env object with a PATH that starts with that node's bin folder; the docs show an env key in this file, not PATH specifically.
Check what the client says
Logs (official docs): macOS ~/Library/Logs/Claude, Windows %APPDATA%\Claude\logs, Linux ~/.config/Claude/logs. mcp.log holds connection failures; mcp-server-SERVERNAME.log holds the server's stderr. Follow them with tail -n 20 -f ~/Library/Logs/Claude/mcp*.log (macOS). Also run the exact command from the config by hand to see its error.
Why it happens
The GitHub issue (opened 2024-11-26 by combdn, closed 2025-10-29): a maintainer said nvm works through a shell function in your profile, which a GUI app does not load, and that the GUI's environment differs from your command line. One commenter found the client used the lowest node version in the nvm folder. The closing maintainer said it was not really a server bug.
What commenters report working
- Wrapper script for npx: an executable script on your PATH, for example
npx-for-claude, that exports a PATH containing your nvm nodebinfolder (or/opt/homebrew/binfor Homebrew) and then runsexec npx "$@"; another version instead runssource ~/.zshrcfirst. Setcommandto the script's absolute path and keep the normalargs. Variants with fnm and pnpm from corepack were tested by commenters. - Leave nvm out of the GUI's way: one commenter moved to mise and started the app from a shell with
open -a Claude. Another deleted the other node versions; a later commenter called that temporary. - Windows: the official docs say that if the logs show
${APPDATA}in a path you may needAPPDATAset to the expanded value of%APPDATA%in the server'senv, and thatnpxcan keep failing unless npm is installed globally (npm install -g npm). In the sibling issue #40 (closed) a maintainer wrote on 2 Dec 2024 that Claude Desktop v0.7.5 should resolve launchingnpxon Windows: update the app first. For Claude Code on Windows thecmd /c npxwrapper is the user-confirmed fix, see claude-code-mcp-server-failed-to-connect-status-checklist.
Reports from users
- @donghao1393, 2024-12-28: "Error: spawn npx ENOENT" after moving from Homebrew Node to nvm.fish on macOS; Node v22.12.0 and npx 10.9.0 worked in shells; they recovered after returning to Homebrew. Issue #436.
Caveats
User reports date from 2024 to 2026 on client versions of that time; they do not establish behaviour of the current Claude Desktop. The env.PATH variant and the wrapper script were not run here.
Sources
Official: connect local servers (config paths, npx example, env key, log paths and names, APPDATA and global npm note), build a server (full-path advice, which/where, absolute paths). Reports: issue #64, issue #40, issue #436.
Started from a post by @combdn, packaged by the editor. Original post