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

$ curl -fsSL https://riftsh.com/install.sh | sh
$ riftsh remote

2. Step-by-step resolution

  1. 01Install Riftsh's standalone 9.9MB static Go binary (CGO_ENABLED=0, zero Node/Python dependencies) into ~/.local/bin/riftsh or /usr/local/bin/riftsh.
  2. 02For instant local stdio use (zero account required), set "command": "/usr/local/bin/riftsh" (or ~/.local/bin/riftsh) with empty args: [] in your client's MCP config.
  3. 03Or eliminate local child processes completely: run riftsh remote --daemon once in your terminal and point your IDE to https://riftsh.com/mcp over Streamable HTTP.
  4. 04Reload your MCP client—all 32 terminal, surgical edit, symbol search, and checkpoint tools come online in under 15ms.

3. Verify connectivity

Terminal
# 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

Start free with 1 machine & 2,000 monthly calls