Skip to main content
RapidDev - Software Development Agency
mcp-tutorial

How to fix 'MCP server not found' error

The 'MCP server not found' error means your MCP host cannot locate or execute the server binary. The most common causes are: npx not being in the PATH for GUI apps, wrong file paths in the config, missing Node.js/Python installation, and Windows needing a cmd /c wrapper. Fix it by using absolute paths to binaries (run which node or which npx to find them) and verifying the server command works in your terminal first.

What you'll learn

  • What causes the MCP server not found error
  • How to fix PATH resolution issues for GUI applications
  • The Windows cmd wrapper solution
  • How to verify your server command before configuring the host
Book a free consultation
4.9Clutch rating
600+Happy partners
17+Countries served
190+Team members
Beginner6 min read5-10 minAll MCP hosts (Claude Desktop, Cursor, Windsurf)March 2026RapidDev Engineering Team
TL;DR

The 'MCP server not found' error means your MCP host cannot locate or execute the server binary. The most common causes are: npx not being in the PATH for GUI apps, wrong file paths in the config, missing Node.js/Python installation, and Windows needing a cmd /c wrapper. Fix it by using absolute paths to binaries (run which node or which npx to find them) and verifying the server command works in your terminal first.

Fixing the MCP Server Not Found Error

This is the single most common MCP error. It happens when the MCP host tries to spawn the server process but cannot find the command specified in your configuration. The root cause is almost always a PATH issue — GUI applications like Claude Desktop and Cursor do not have the same PATH as your terminal. This tutorial covers every variant of this error and the fix for each one.

Prerequisites

  • An MCP host showing the server not found error
  • Terminal access on your machine
  • The MCP server you are trying to configure

Step-by-step guide

1

Identify the exact error message

The server not found error appears in different forms depending on the host and operating system. Check your MCP host's error display and server logs for the exact message. Each variant points to the same root cause — the command cannot be found — but knowing the exact message helps confirm the diagnosis. Check Claude Desktop logs at ~/Library/Logs/Claude/mcp*.log on macOS.

typescript
1# Common error messages you might see:
2
3# Node.js / npx errors:
4# "spawn npx ENOENT"
5# "Error: spawn npx ENOENT"
6# "command not found: npx"
7
8# General MCP errors:
9# "Error: MCP server not found"
10# "Failed to start MCP server"
11# "Server process exited with code 1"
12
13# Python / uvx errors:
14# "spawn uvx ENOENT"
15# "command not found: uvx"

Expected result: You have identified the specific error message from your logs or host interface.

2

Find the absolute path to your command

GUI applications do not inherit your shell's PATH (set in .bashrc, .zshrc, or .config/fish/config.fish). This means npx, node, uvx, and python might not be findable. The fix is to use the absolute path. Open your terminal and run which or where to find it.

typescript
1# macOS / Linux find absolute paths
2which node # e.g., /opt/homebrew/bin/node
3which npx # e.g., /opt/homebrew/bin/npx
4which uvx # e.g., /Users/you/.local/bin/uvx
5which python3 # e.g., /opt/homebrew/bin/python3
6
7# Windows find absolute paths
8where node # e.g., C:\Program Files\nodejs\node.exe
9where npx # e.g., C:\Program Files\nodejs\npx.cmd

Expected result: You have the absolute file path to the command your MCP server needs.

3

Update your config to use absolute paths

Replace the command name in your MCP host config with the absolute path you found. This bypasses all PATH resolution and guarantees the host can find the binary. For npx-based servers, replace "npx" with the full path. For node-based servers, replace "node" with the full path.

typescript
1// BEFORE — relative command (fails in GUI apps)
2{
3 "mcpServers": {
4 "github": {
5 "command": "npx",
6 "args": ["-y", "@modelcontextprotocol/server-github"],
7 "env": { "GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_token" }
8 }
9 }
10}
11
12// AFTER — absolute path (works everywhere)
13{
14 "mcpServers": {
15 "github": {
16 "command": "/opt/homebrew/bin/npx",
17 "args": ["-y", "@modelcontextprotocol/server-github"],
18 "env": { "GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_token" }
19 }
20 }
21}

Expected result: The MCP host can now find and execute the server command using the absolute path.

4

Apply the Windows cmd wrapper if needed

On Windows, even absolute paths to npx can fail because npx.cmd is a batch script, not a direct executable. The solution is to use cmd.exe as the command and pass /c npx as arguments. This launches a command shell that properly resolves and executes npx.

typescript
1// Windows fix — wrap npx with cmd
2{
3 "mcpServers": {
4 "github": {
5 "command": "cmd",
6 "args": ["/c", "npx", "-y", "@modelcontextprotocol/server-github"],
7 "env": { "GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_token" }
8 }
9 }
10}
11
12// Alternative: use absolute path to node directly
13{
14 "mcpServers": {
15 "my-server": {
16 "command": "C:\\Program Files\\nodejs\\node.exe",
17 "args": ["C:\\Users\\you\\mcp-server\\dist\\index.js"]
18 }
19 }
20}

Expected result: The MCP server starts correctly on Windows using the cmd wrapper or absolute node path.

5

Verify the fix by restarting your host

After updating the config, restart your MCP host completely. Claude Desktop requires quit and reopen. Cursor needs a window reload or full restart. Check that the server's tools now appear in the host interface. If they do not, check the logs again — the error may have changed to a different issue (like missing environment variables), which means the PATH problem is fixed and you are making progress. If you continue having trouble after trying all these fixes, the RapidDev team has debugged hundreds of MCP configurations and can help identify unusual issues.

Expected result: Your MCP host connects to the server successfully and the server's tools appear in the interface.

Complete working example

claude_desktop_config.json
1{
2 "mcpServers": {
3 "github": {
4 "command": "/opt/homebrew/bin/npx",
5 "args": ["-y", "@modelcontextprotocol/server-github"],
6 "env": {
7 "GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_your_token_here"
8 }
9 },
10 "filesystem": {
11 "command": "/opt/homebrew/bin/npx",
12 "args": [
13 "-y",
14 "@modelcontextprotocol/server-filesystem",
15 "/Users/yourname/projects"
16 ]
17 },
18 "git": {
19 "command": "/Users/yourname/.local/bin/uvx",
20 "args": [
21 "mcp-server-git",
22 "--repository",
23 "/Users/yourname/projects/my-repo"
24 ]
25 },
26 "custom": {
27 "command": "/opt/homebrew/bin/node",
28 "args": ["/Users/yourname/mcp-servers/custom/dist/index.js"],
29 "env": {
30 "API_KEY": "your-key-here"
31 }
32 }
33 }
34}

Common mistakes when fixing 'MCP server not found' error

Why it's a problem: Assuming npx is in PATH for GUI applications

How to avoid: GUI apps like Claude Desktop do not read .bashrc or .zshrc. Always use absolute paths: /opt/homebrew/bin/npx instead of just npx.

Why it's a problem: Using forward slashes for Windows paths in JSON

How to avoid: JSON requires escaped backslashes for Windows paths: C:\\Users\\name, not C:/Users/name (though some tools accept forward slashes).

Why it's a problem: Having a typo in the server file path

How to avoid: Double-check that the file path in args actually exists. Run ls on the path in your terminal to verify.

Why it's a problem: Not installing the required runtime (Node.js, Python)

How to avoid: If which node or which python3 returns nothing, install the runtime first. npx requires Node.js, uvx requires uv.

Best practices

  • Always use absolute paths in MCP host configurations for maximum reliability
  • Test the exact server command in your terminal before adding it to the config
  • On Windows, use the cmd /c wrapper for npx-based servers
  • Keep the output of which node and which npx noted somewhere for reference
  • If using nvm or pyenv, use the absolute path to the version-specific binary
  • Check MCP server logs immediately after restarting to catch new errors quickly

Still stuck?

Copy one of these prompts to get a personalized, step-by-step explanation.

ChatGPT Prompt

I am getting a 'spawn npx ENOENT' error when trying to use an MCP server in [Claude Desktop / Cursor] on [macOS / Windows]. My config is [paste config]. Help me fix the server not found error.

MCP Prompt

My MCP server config shows 'command not found: npx' in the logs. I am on [macOS with Homebrew / Windows / Linux]. Show me how to find the absolute path and update my configuration.

Frequently asked questions

Why does my server work in the terminal but not in Claude Desktop?

Your terminal has PATH set by .bashrc, .zshrc, or similar profile files. Claude Desktop is a GUI app that does not source these files, so it has a minimal PATH that may not include /opt/homebrew/bin, ~/.nvm/versions/, or other custom directories. Use absolute paths in the config.

I use nvm to manage Node.js versions. How do I find the right path?

Run which node and which npx in your terminal after activating the desired nvm version. The paths will look like ~/.nvm/versions/node/v20.11.0/bin/node. Use these absolute paths in your MCP config.

Do I need to update the path every time I update Node.js?

Only if the installation path changes. Homebrew (/opt/homebrew/bin/node) keeps the same path across updates. nvm creates version-specific paths, so you would need to update after switching Node versions.

Can I set PATH in the env block of the MCP config?

Some hosts support setting PATH in the env block, but it is not reliable across all hosts. Using absolute paths for the command is more reliable and portable.

The error says ENOENT but my file exists. What else could it be?

ENOENT (Error NO ENTry) can also mean a dependency of the server is missing. If the main binary exists, check that all required npm packages are installed or that the npx package name is spelled correctly.

RapidDev

Talk to an Expert

Our team has built 600+ apps. Get personalized help with your project.

Book a free consultation

Need help with your project?

Our experts have built 600+ apps and can accelerate your development. Book a free consultation — no strings attached.

Book a free consultation

We put the rapid in RapidDev

Need a dedicated strategic tech and growth partner? Discover what RapidDev can do for your business! Book a call with our team to schedule a free, no-obligation consultation. We'll discuss your project and provide a custom quote at no cost.