MCP

"MCP error -32000: Connection closed", "MCP error -32001: Request timed out" and "spawn uv ENOENT"

Last checked

The error

[devtest] [error] spawn uv ENOENT {"context":"connection","stack":"Error: spawn uv ENOENT ..."}
[devtest] [info] Server transport closed unexpectedly, this is likely due to the process exiting early.
MCP error -32000: Connection closed

Claude Desktop mcp.log lines from modelcontextprotocol/servers issue #1448; the last line is how the TypeScript SDK reports it to the caller. The timeout variant reads "MCP error -32001: Request timed out".

MCP error -32000 means the client lost the stdio pipe to your MCP server: the process exited or never started. The usual reason is spawn uv ENOENT or spawn npx ENOENT, meaning the app could not find uv or npx on its PATH. Put the full command path in your MCP config (wrap npx in cmd /c on Windows), run the command in a terminal to see the real error, then restart the app.

Why it happens

Both codes come from the official MCP TypeScript SDK: -32000 is ConnectionClosed and -32001 is RequestTimeout. It formats them as "MCP error <code>: <message>", so Claude Desktop, Cursor and Claude Code show the same text. Codex uses a different SDK and words its errors differently.

  1. The command was not found (spawn uv ENOENT, spawn npx ENOENT). Apps launched from the Dock or Start menu do not load your shell profile, and uv's installer puts the binary in ~/.local/bin (macOS, Linux) or %USERPROFILE%\.local\bin (Windows), which a GUI app may not search. Node.js not being installed gives the same error.
  2. Windows cannot spawn npx directly. npx is a batch shim (npx.cmd) that Node only resolves through a shell, so bare "command": "npx" can fail with ENOENT (anthropics/claude-code issue #58510).
  3. The server started, then crashed: missing API key in env, wrong path in args, a Python import error. The client only sees the pipe close.
  4. The server wrote non-JSON to stdout (a print, a banner, a UTF-8 BOM) or sent an oversized response. The caller just gets "Connection closed" (modelcontextprotocol/typescript-sdk issue #2775, open).
  5. For -32001: the server did not answer within the timeout, 60 seconds per request by default in the TypeScript SDK. First-run package downloads and long tool calls hit it.

The fix

  1. 1 Run the exact command and args from your config in a terminal. If it fails there, fix that first; if it only fails in the app, it is PATH.
  2. 2 Find the full path with which uv or which npx (macOS, Linux) or where npx (Windows) and put it in "command".
  3. 3 On Windows use "command": "cmd" with "args": ["/c", "npx", "-y", "<package>"]. If the log mentions ${APPDATA}, add APPDATA with its expanded value to the server's env block.
  4. 4 Read the server log. Claude Desktop writes mcp.log and mcp-server-NAME.log to ~/Library/Logs/Claude (macOS) or %APPDATA%\Claude\logs (Windows). In Cursor, open the Output panel and pick MCP Logs.
  5. 5 For -32001, raise the timeout: MCP_TIMEOUT and MCP_TOOL_TIMEOUT in Claude Code, startup_timeout_sec (default 10) and tool_timeout_sec (default 60) under [mcp_servers.NAME] in Codex config.toml.
  6. 6 Quit the app completely and reopen it; Claude Desktop reads claude_desktop_config.json only at launch.
tail -n 20 -f ~/Library/Logs/Claude/mcp*.log

What -32000 and -32001 actually mean

JSON-RPC 2.0 leaves -32000 to -32099 for implementation-defined server errors. The MCP TypeScript SDK uses -32000 when the transport closes while a request is pending, and -32001 when no response arrives in time. Neither says why: the reason is in the server's stderr, not the client error. The SDK also reuses -32000 for "Request was cancelled", so read the text after the code.

A Claude Desktop config with full paths

Replace the paths with what which uv or where npx prints on your machine. The second entry is the Windows form:

{
  "mcpServers": {
    "my-python-server": {
      "command": "/Users/you/.local/bin/uv",
      "args": ["--directory", "/Users/you/code/my-server", "run", "server.py"]
    },
    "filesystem": {
      "command": "cmd",
      "args": ["/c", "npx", "-y", "@modelcontextprotocol/server-filesystem", "C:\\Users\\you\\Desktop"]
    }
  }
}

Still failing?

  • Make sure the server logs to stderr only; any print to stdout corrupts the JSON-RPC stream.
  • Run the npx or uv command once in a terminal so the first launch is not spent downloading packages.
  • Validate the config as JSON; a trailing comma or unescaped Windows backslash stops every server in the file loading.

Related errors

Full guideHow to Debug MCP Tool Calls: The Troubleshooting Workflow That Finds the Problem in 5 MinutesEvery error, one pageWhat Is MCP? The Model Context Protocol Explained Without the Jargon

Hit a different error?

Paste any agent error and get the cause and fix in seconds.

Open the decoder

Frequently asked questions

Is -32000 a bug in Claude Desktop or Cursor?

Usually not. It only means the server process closed the connection: the command was not found, it crashed on startup, or it wrote non-JSON output to stdout.

It works in my terminal but not in the app. Why?

Your terminal loads your shell profile and PATH; an app launched from the Dock or Start menu does not. Use the full path to the command.

How long is the MCP request timeout?

60 seconds per request by default in the TypeScript SDK, which is where -32001 comes from. Codex and Claude Code let you change it with the settings above.

Stop firefighting agent errors

Decoding errors one at a time is the manual version of what BetterClaw automates. Run your agents on a no-code AI agent platform with managed models, retries and config validation built in.

Free plan available · Pro $49/mo · BYOK · 7-day money-back guarantee