
This fix is part of MCP troubleshooting, within The MCP Guide. Still stuck? Request a free MCP readiness review.
If your MCP server works in the MCP Inspector but fails in Claude, the server code is probably fine and the difference is in how it is launched or reached. Locally, the Inspector inherits your terminal's environment, while Claude Desktop starts the server with a smaller environment and possibly a different working directory or Node runtime. Remotely, claude.ai connects from Anthropic's servers, not your machine. The fastest fix is to make the Claude config use absolute paths and explicit env values, or, for remote servers, to check DNS, redirects and discovery from a public network.
Checked against: the MCP debugging guide, the MCP Inspector docs, Claude's connector troubleshooting page and the source of the @modelcontextprotocol/sdk 1.32.2 npm package on 2 November 2026. eSEOspace did not reproduce these cases.
Key Takeaways
- The Inspector runs from your terminal, so it sees your shell's
PATH, current folder and environment variables. - The MCP debugging guide says stdio servers "inherit only a limited subset of environment variables" and the working directory "may be undefined (like
/on macOS)." - Claude's docs say a URL that redirects to another host "explains the common report 'works in MCP Inspector or Claude Code CLI but not claude.ai.'"
- claude.ai rejects hostnames that resolve to private, loopback or carrier-grade NAT addresses, and connectors are IPv4-only.
- Desktop extensions may run on Claude Desktop's built-in Node runtime, not the Node you tested with.
What this error means
The Inspector is the reference testing tool. When you run npx @modelcontextprotocol/inspector node path/to/server/index.js, the Inspector starts your server from your current terminal session.
Claude starts it differently. For local servers, Claude Desktop is a GUI app. An MCP maintainer put it plainly in a GitHub thread: "the environment for GUI apps is completely different from what you see on the command line." For remote servers, claude.ai does not connect from your laptop at all.
So "works in the Inspector" proves the protocol logic. It does not prove the launch settings or the network path Claude uses.
Quick fix
Local server (Claude Desktop):
- Use absolute paths for
commandand every file argument. Get them withwhichorwhere. - Set every needed variable in
env. The TypeScript SDK 1.32.2 passes onlyHOME,LOGNAME,PATH,SHELL,TERMandUSERby default on macOS and Linux. API keys from your shell profile do not come along. - Do not rely on the current folder. Load
.envfiles and data by absolute path. - Check the runtime. If it is a desktop extension, test with a JSON config that points at your own Node.
- Quit and reopen Claude Desktop, then read
mcp-server-SERVERNAME.log.
Remote server (claude.ai):
- Check public DNS. Run
dig +short your-server.example.comfrom outside your network. - Check redirects. Run
curl -sI https://your-server.example.com/mcp. A3xxto another host is the problem. - Check discovery. Fetch
/.well-known/oauth-protected-resourcefrom a public network. - Check your firewall for blocked requests from Anthropic's range.
Fix by client / OS
Claude Desktop
Mirror the Inspector's launch. If this works:
npx @modelcontextprotocol/inspector node /Users/you/server/dist/index.js
then build the config from the same pieces, with full paths and explicit variables:
{
"mcpServers": {
"my-server": {
"command": "/opt/homebrew/bin/node",
"args": ["/Users/you/server/dist/index.js"],
"env": {
"MY_API_KEY": "your-key",
"DATA_DIR": "/Users/you/server/data"
}
}
}
}
Use your own which node output. On Windows, users report that MSIX installs may read a different copy of the config; see config JSON not loading.
claude.ai and remote connectors
Claude's troubleshooting page lists these causes for "Couldn't reach the MCP server" when other tools work:
- Split-horizon DNS: "the CLI and
curlconnect from your machine, while claude.ai connects from Anthropic's servers." - Private addresses: Claude rejects hostnames that resolve to
10.0.0.0/8,172.16.0.0/12,192.168.0.0/16,100.64.0.0/10, loopback or link-local, or to a mix of public and private. It also needs anArecord, because connectors are IPv4-only. - Redirects: "Local clients fail fast on a redirect," while claude.ai follows it, drops the credential, and fails later with "Authorization with the MCP server failed."
- WAF blocks: look for
403or429your app did not generate. Anthropic's outbound range is160.79.104.0/21, per Claude's authentication docs.
To test a local server with claude.ai, the troubleshooting page points to a public tunnel setup.
Claude Code
Claude Code also runs from your terminal, so it often behaves like the Inspector. If it fails where the Inspector works, compare transports and headers. The Claude Code MCP docs say a rejected headers.Authorization is reported as a failure without falling back to OAuth.
Where to find the logs
| Surface | Where |
|---|---|
| Inspector | Monitoring sidebar with the JSON-RPC exchange |
| Claude Desktop | mcp.log and mcp-server-SERVERNAME.log in the Claude logs folder |
| claude.ai | Your server's access logs, plus the ofid_ ID in the error URL |
| Claude Code | claude mcp get <name> |
If your server's access logs show nothing during a claude.ai connect attempt, the request never left Anthropic or was blocked at your edge. That points to DNS or a WAF, not your code.
If it still fails
- Protocol era differences. The Inspector docs say it negotiates both legacy and modern 2026-07-28 protocol eras. If your server supports only one, see protocol version mismatch.
- Environment variables. See env variables not passed.
- Stray stdout output can pass in one client and fail in another. See stdout logging.
- Auth failures. See MCP 401 Unauthorized.
Look up any code with the MCP error code lookup. The course lesson on testing with the MCP Inspector covers good test habits, and our MCP development team can review a server before launch.
More in the MCP Guide
Free tools: MCP Error Code Lookup · MCP Config Generator
Latest research: State of MCP: October 2026
Frequently asked questions
Why does the Inspector have my API key but Claude Desktop does not?
The Inspector runs from your terminal, which loaded your profile. Claude Desktop does not read your shell profile, and stdio servers get only a few variables. Put the key in the server's env block.
Can claude.ai reach a server on localhost?
No. claude.ai connects from Anthropic's servers and rejects loopback and private addresses. Use a public host or a tunnel to test.
My server works in Claude Code but not claude.ai. Why?
Claude Code connects from your machine; claude.ai connects from Anthropic's network. DNS, firewalls and redirects that do not affect your machine can block claude.ai.
Is the Inspector a good final test?
It is the right first test. Before release, also test in each client your users have, with the same config they will use.











