How to Fix 'spawn npx ENOENT' & 'MCP Error -32000' Permanently
GUI apps on macOS, Linux, and Windows do not inherit interactive shell PATH variables from nvm, fnm, volta, or mise—causing Node-based npx MCP servers to crash immediately on launch. Switching to a static Go binary eliminates Node runtime issues completely.
Typical error log in Cursor / Claude / Windsurf
[error] MCP Server disconnected: spawn npx ENOENT MCP error -32000: Connection closed Error: Cannot find module or incompatible Node.js version under GUI PATH (/usr/bin:/bin)
Root cause
Desktop applications are spawned by launchd (macOS) or Explorer (Windows) with a minimal system PATH (/usr/bin:/bin) before shell version managers initialize. Hardcoding /Users/you/.nvm/versions/node/v22.x.x/bin/npx breaks again the next time you upgrade Node or work on a clean remote server.
1. Install standalone static Go binary
2. Step-by-step resolution
- 01Install Riftsh's standalone 9.9MB static Go binary (
CGO_ENABLED=0, zero Node/Python dependencies) into~/.local/bin/riftshor/usr/local/bin/riftsh. - 02For instant local stdio use (zero account required), set
"command": "/usr/local/bin/riftsh"(or~/.local/bin/riftsh) with emptyargs: []in your client's MCP config. - 03Or eliminate local child processes completely: run
riftsh remote --daemononce in your terminal and point your IDE tohttps://riftsh.com/mcpover Streamable HTTP. - 04Reload your MCP client—all 32 terminal, surgical edit, symbol search, and checkpoint tools come online in under 15ms.
3. Verify connectivity
# Verify static binary & local stdio handshake (0 Node.js required) riftsh doctor # Optional: switch to encrypted Streamable HTTP mode across machines riftsh remote --daemon
FAQ
Does Riftsh replace both filesystem and terminal npx MCP packages at once?
Yes. One riftsh binary includes all 32 tools: interactive PTY sessions, surgical edit_block, apply_file_batch, AST symbol outlines, ripgrep-class streaming search, and directory guardrails.
Does Riftsh run on Alpine Linux containers without glibc?
Yes. Riftsh is built with CGO_ENABLED=0 as a 100% static executable, running natively on macOS (Apple Silicon & Intel), Linux (glibc & Alpine musl), and Windows.
Related client guides
Architecture comparisons