# How to fix 'MCP server not found' error

- Tool: MCP
- Difficulty: Beginner
- Time required: 5-10 min
- Compatibility: All MCP hosts (Claude Desktop, Cursor, Windsurf)
- Last updated: March 2026

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

## Before you start

- 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.

```
# Common error messages you might see:

# Node.js / npx errors:
# "spawn npx ENOENT"
# "Error: spawn npx ENOENT"
# "command not found: npx"

# General MCP errors:
# "Error: MCP server not found"
# "Failed to start MCP server"
# "Server process exited with code 1"

# Python / uvx errors:
# "spawn uvx ENOENT"
# "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.

```
# macOS / Linux — find absolute paths
which node        # e.g., /opt/homebrew/bin/node
which npx         # e.g., /opt/homebrew/bin/npx
which uvx         # e.g., /Users/you/.local/bin/uvx
which python3     # e.g., /opt/homebrew/bin/python3

# Windows — find absolute paths
where node        # e.g., C:\Program Files\nodejs\node.exe
where 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.

```
// BEFORE — relative command (fails in GUI apps)
{
  "mcpServers": {
    "github": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-github"],
      "env": { "GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_token" }
    }
  }
}

// AFTER — absolute path (works everywhere)
{
  "mcpServers": {
    "github": {
      "command": "/opt/homebrew/bin/npx",
      "args": ["-y", "@modelcontextprotocol/server-github"],
      "env": { "GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_token" }
    }
  }
}
```

**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.

```
// Windows fix — wrap npx with cmd
{
  "mcpServers": {
    "github": {
      "command": "cmd",
      "args": ["/c", "npx", "-y", "@modelcontextprotocol/server-github"],
      "env": { "GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_token" }
    }
  }
}

// Alternative: use absolute path to node directly
{
  "mcpServers": {
    "my-server": {
      "command": "C:\\Program Files\\nodejs\\node.exe",
      "args": ["C:\\Users\\you\\mcp-server\\dist\\index.js"]
    }
  }
}
```

**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 code example

File: `claude_desktop_config.json`

```json
{
  "mcpServers": {
    "github": {
      "command": "/opt/homebrew/bin/npx",
      "args": ["-y", "@modelcontextprotocol/server-github"],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_your_token_here"
      }
    },
    "filesystem": {
      "command": "/opt/homebrew/bin/npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-filesystem",
        "/Users/yourname/projects"
      ]
    },
    "git": {
      "command": "/Users/yourname/.local/bin/uvx",
      "args": [
        "mcp-server-git",
        "--repository",
        "/Users/yourname/projects/my-repo"
      ]
    },
    "custom": {
      "command": "/opt/homebrew/bin/node",
      "args": ["/Users/yourname/mcp-servers/custom/dist/index.js"],
      "env": {
        "API_KEY": "your-key-here"
      }
    }
  }
}
```

## Common mistakes

- **Assuming npx is in PATH for GUI applications** — undefined Fix: GUI apps like Claude Desktop do not read .bashrc or .zshrc. Always use absolute paths: /opt/homebrew/bin/npx instead of just npx.
- **Using forward slashes for Windows paths in JSON** — undefined Fix: JSON requires escaped backslashes for Windows paths: C:\\Users\\name, not C:/Users/name (though some tools accept forward slashes).
- **Having a typo in the server file path** — undefined Fix: Double-check that the file path in args actually exists. Run ls on the path in your terminal to verify.
- **Not installing the required runtime (Node.js, Python)** — undefined Fix: 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

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

---

Source: https://www.rapidevelopers.com/mcp-tutorial/how-to-fix-mcp-server-not-found-error
© RapidDev — https://www.rapidevelopers.com/mcp-tutorial/how-to-fix-mcp-server-not-found-error
