Inside On Lab.
AI STACK · COST & BENCHMARK LABSearch Guides

Fixing Claude Desktop MCP "spawn npx ENOENT" & Server Disconnected Errors on Windows and macOS

Why local Model Context Protocol (MCP) servers fail to launch with spawn npx ENOENT or Server disconnected in Claude Desktop, and how to fix claude_desktop_config.json on Windows (cmd /c wrapper), macOS, and Claude Code.

The error spawn npx ENOENT means the host could not launch the executable it requested. Server disconnected is broader: a process may launch and then exit, reject a path or emit invalid stdio output. Start by checking which stage failed, using the official MCP local-server guide and the host logs. Installing Node.js alone does not establish that a GUI app sees the same PATH as your terminal.

Claude Desktop uses %APPDATA%\Claude\claude_desktop_config.json on Windows and ~/Library/Application Support/Claude/claude_desktop_config.json on macOS. Open the local-server configuration from the app settings rather than creating a similarly named file in an unrelated folder. This guide does not assume an official Linux Desktop layout or a third-party wrapper.

Windows: launch the .cmd wrapper through a shell

Editable Windows MCP launch reference using cmd /c, real runtime lookup and clearly labelled path placeholders.
Illustrative configuration comparison. The Windows example launches npx through cmd /c; replace placeholder directories and verify the installed runtime. Primary Source: Inside On Lab · Model Context Protocol & Node.js Docs · Zoom Diagram

Node.js documents that Windows .bat and .cmd scripts are not standalone executables. Its child-process documentation lists a shell or an explicitly spawned cmd.exe as execution routes. Merely replacing npx with the absolute path to npx.cmd does not universally solve a shell-free host launch. The template below uses cmd /c; if lookup still fails, check the actual Node installation and GUI-process environment.

Windows configuration template — replace YOUR_USERNAME and allowed folders

{
  "mcpServers": {
    "filesystem": {
      "command": "cmd",
      "args": [
        "/c",
        "npx",
        "-y",
        "@modelcontextprotocol/server-filesystem",
        "C:\\Users\\YOUR_USERNAME\\Desktop",
        "C:\\Users\\YOUR_USERNAME\\Downloads"
      ]
    }
  }
}

Replace both directory placeholders before use and keep only folders you intend the filesystem server to access. From a normal terminal, where.exe npx or Get-Command npx.cmd helps locate the installed wrapper. If you use an absolute path, it still needs a compatible launch method, such as cmd /c with correct quoting, or node.exe plus the actual JavaScript entry point. Restart the app after changing its environment or configuration.

macOS and Python: use paths from your own installation

Reference troubleshooting stages for executable lookup, process launch, stdio protocol and tool response validation.
MCP stdio troubleshooting stages: executable lookup, process launch, protocol output and allowed paths. This is a reference diagram, not a captured successful user session. Inside On Lab · Claude Code MCP & Astral uv Docs

A macOS GUI app may not inherit shell initialization such as an NVM path. Run which npx in your terminal and use the path for your installation. /opt/homebrew/bin/npx is an Apple Silicon Homebrew example, not the path for every NVM, Intel Mac or custom installation. For a terminal-hosted integration, the Claude Code MCP documentation describes registration and scope separately.

Distinguish launch errors from protocol failures
ObservationCheckNext step
spawn npx ENOENTExecutable lookup and the GUI PATHUse cmd /c on Windows; verify real runtime paths
spawn uvx ENOENTWhere uv/uvx is installedUse the real uvx executable path for your OS
Process starts then exitsPackage arguments and allowed/repository directoriesReplace placeholders; read the process stderr log
Malformed stdio / unexpected textWhether server logs are written to stdoutKeep protocol messages on stdout and diagnostic logs on stderr

The uv tools documentation explains how uvx runs a Python CLI package in an isolated environment. It does not remove the need for a valid executable path, repository path or supported package arguments. The generator provides an editable macOS uvx example; a Windows installation needs its own uvx.exe path.

The npx -y option suppresses its package-install confirmation prompt; it does not sanitize arbitrary banners printed by the server. Configure the server to keep diagnostics on stderr and protocol output on stdout. Validate JSON syntax, launch the process using the same host configuration, and inspect an actual tool response before describing an integration as working.

Verification & Billing Methodology Notice

Rate tables are a November 9, 2026 documentation snapshot with announced schedule changes shown where available. Calculators use stated assumptions and are estimates, not invoices or measured hardware benchmarks. Check actual usage categories, account terms, cache behaviour, runtime allocations and cloud endpoint rates for a production decision.

Primary Sources & Official Vendor Documentation

Report a pricing update or technical correction