Quick Answer
The error connecting to MCP Inspector proxy means the Inspector browser UI cannot reach the local proxy process — or the proxy cannot reach your target MCP server. Before diving into individual fixes, run this prioritized diagnostic:
- Is the Inspector process running? Look for its terminal output. If the terminal closed, nothing will work.
- What port is the proxy on? Confirm the UI is pointing at the address the proxy actually bound to.
- Did the proxy emit a startup error? Read the terminal for spawn errors, port-in-use messages, or immediate exits.
- What does the browser console say? ERR_CONNECTION_REFUSED = proxy unreachable. 4xx/5xx = proxy reached but target failed.
- Does the target server start independently? Run it manually to isolate server-only failures.
60-Second Fix Checklist
- Terminal running
npx @modelcontextprotocol/inspectoris open and still running - No startup error visible in the Inspector terminal (port conflict, spawn error, missing command)
- Proxy address and port in the browser URL match what the terminal reports
- Browser console shows no ERR_CONNECTION_REFUSED or CORS error against the proxy URL
- Target server command and args are exactly correct (test them manually first)
- All required environment variables are passed to Inspector
- No other process is occupying the proxy port (
lsof -i :<port>/netstat -ano | findstr :<port>) - If using Docker or WSL: proxy and server are reachable via the correct host address, not
localhost - No firewall or VPN rule is blocking the proxy port on loopback
- Inspector version is current (
npm list -g @modelcontextprotocol/inspectoror run with@latest)
How the MCP Inspector Proxy Connection Works
MCP Inspector is not a single process — it is a browser UI backed by a local proxy. Understanding the layers tells you exactly where to look when something breaks.
Browser UI (React frontend, served on a local HTTP port)
|
| HTTP / fetch to proxy API
v
Inspector Proxy (Node.js process, started by npx @modelcontextprotocol/inspector)
|
| stdio pipe → for stdio MCP servers
| HTTP → for Streamable HTTP MCP servers
v
Target MCP Server (your server binary, Node script, Python process, etc.)
There are two independent connection points, and the error message is the same for both.
| Connection | What it does | How it fails |
|---|---|---|
| Browser → Proxy | Browser fetches the proxy's local HTTP API | Proxy not running, wrong port, localhost unreachable, firewall |
| Proxy → Target Server | Proxy spawns or connects to your MCP server | Wrong command, missing executable, server exits, wrong URL |
The Inspector UI loads from a static server, so it renders even when the proxy is completely down. That is why you can see the UI but still hit the connection error.
Is the Proxy Down or Is the MCP Server Failing?
This table helps you identify the failing layer before touching any configuration.
| Symptom | Failing Layer | How to Verify | First Fix |
|---|---|---|---|
| Browser console: ERR_CONNECTION_REFUSED against proxy URL | Proxy not running | Check if Inspector process is alive in terminal | Restart Inspector |
| Inspector terminal: nothing / closed | Proxy not started | Re-open terminal, run npx @modelcontextprotocol/inspector | Re-run Inspector |
Inspector terminal: EADDRINUSE or address already in use | Port conflict | lsof -i :<port> | Kill conflicting process or change port |
Inspector terminal: spawn ENOENT or command not found | Target server executable missing | Run the exact command manually in the same shell | Fix command path or install missing package |
Inspector terminal: Process exited with code N | Target server crashed | Run server manually, read its stderr | Fix the server startup error |
| Browser console: HTTP 4xx or 5xx from proxy | Proxy running, server failing | Check proxy terminal for the HTTP error detail | Fix target server or endpoint URL |
| UI loads, connect button hangs or errors | Proxy up, server unreachable | Check proxy terminal for connection attempt errors | Verify server transport type and URL |
| Inspector works locally, fails in Docker/WSL | Network namespace mismatch | Try host IP instead of localhost | Use host.docker.internal or correct host IP |
Fix "Error Connecting to MCP Inspector Proxy"
1. Confirm the Inspector Process Is Running
Every fix starts here. If the Inspector terminal is closed, no browser action will help.
# Start Inspector with a stdio server
npx @modelcontextprotocol/inspector node path/to/server.js
# Start Inspector with a Streamable HTTP server
npx @modelcontextprotocol/inspector --cli http://localhost:3000/mcp
# Always keep this terminal visible
The terminal must stay open for the proxy to remain alive. If you ran it in a background job or a closed terminal, the proxy is gone.
2. Check the Exact Address the Proxy Bound To
When Inspector starts successfully, it prints the URL where the UI is available and where the proxy is listening. Verify your browser is using that exact address.
If the terminal says the proxy is on port 3000 but your browser is hitting localhost:5173 (or vice versa), you are connecting to the wrong endpoint.
3. Test Proxy Reachability Directly
Before touching any server configuration, confirm the proxy itself responds:
# Replace PORT with whatever Inspector printed
curl -v http://localhost:PORT/
If curl also gets Connection refused, the proxy is not bound on that port — restart Inspector. If curl succeeds but the browser fails, you have a browser-specific issue (see CORS/origin section below).
4. Kill Stale Inspector Processes
If you restarted Inspector repeatedly, a stale process may be holding the port:
# macOS / Linux
lsof -i :<port> | grep node
kill -9 <PID>
# Windows
netstat -ano | findstr :<port>
taskkill /PID <PID> /F
Then restart Inspector fresh.
Check the MCP Inspector Terminal Logs
The terminal where you ran npx @modelcontextprotocol/inspector is your primary diagnostic source. Here is what each message means:
| Terminal Message | Meaning | Action |
|---|---|---|
Proxy server listening on port XXXX | Proxy started correctly | Check browser is using correct port |
EADDRINUSE / address already in use | Port conflict | Kill the occupying process |
spawn ENOENT | Command not found when starting server | Fix the command path |
Error: Cannot find module '...' | Node.js module resolution failure | Run npm install in the project directory |
Process exited with code 1 (or other non-zero) | Target server crashed on startup | Run the server manually and read its output |
Process exited with code 0 immediately | Server quit cleanly but unexpectedly | Check server logic — it may be exiting on invalid args |
connect ECONNREFUSED against a URL | Proxy tried to reach HTTP server, got refused | Start your Streamable HTTP server before Inspector |
| No output at all after running npx | npx is downloading or the package name is wrong | Wait, or verify package name @modelcontextprotocol/inspector |
Distinguishing proxy startup failure from target server failure: Proxy failures appear before any server interaction log — they happen at process start. Target server failures appear after the proxy prints its ready message and then attempts to spawn or connect to your server.
Check the Browser Console
Open DevTools → Console and Network tabs before reproducing the error. What you find here identifies the browser-to-proxy layer.
ERR_CONNECTION_REFUSED The proxy is not listening on the expected address. The proxy process is down, on a different port, or the address is wrong. This is not a server-side issue.
CORS or Cross-Origin Request Blocked error
This appears when you access the Inspector UI from a non-localhost origin — for example, through a tunneling tool, a remote development proxy, or a browser extension. The Inspector proxy allows requests from its own UI origin. If you see this, ensure the UI and proxy are accessed from the same origin or configure your reverse proxy to pass the correct headers.
HTTP 4xx / 5xx from the proxy endpoint The proxy is reachable. The error comes from the proxy's attempt to interact with the target server. Check the proxy terminal for the specific error it encountered.
Network tab shows requests pending indefinitely The proxy is partially running or overloaded. Check for unhandled exceptions in the proxy terminal.
Fix MCP Inspector Proxy Port and Address Problems
Port Already in Use
# macOS/Linux: find what is using the port
lsof -i :5173
lsof -i :3000
# Kill the process
kill -9 <PID>
# Windows
netstat -ano | findstr :5173
taskkill /PID <PID> /F
If you cannot kill the conflicting process, check whether Inspector supports a port override via environment variables or CLI flags in the version you are using — consult the official MCP Inspector repository for the current CLI reference.
Localhost Resolution Problems
On some systems (particularly with certain IPv6 configurations), localhost resolves to ::1 (IPv6) while the proxy binds on 127.0.0.1 (IPv4), causing connection failures even when the proxy is running.
# Test IPv4 directly
curl http://127.0.0.1:<port>/
# Test IPv6 directly
curl http://[::1]:<port>/
If one works and the other does not, use the address family that works in your browser URL bar (127.0.0.1 instead of localhost).
MCP Inspector Proxy Errors with stdio Servers
stdio-based MCP servers are spawned as child processes by the Inspector proxy. Most errors in this mode come from the proxy failing to start the target process correctly.
Command Not Found (spawn ENOENT)
# Wrong — if 'my-mcp-server' is not on PATH
npx @modelcontextprotocol/inspector my-mcp-server
# Correct — use the full path or npx with the package
npx @modelcontextprotocol/inspector npx my-mcp-package
npx @modelcontextprotocol/inspector node /absolute/path/to/server.js
The Inspector process inherits the PATH from the shell that launched it. If you installed a package globally with a different user or in a different environment, npx inside Inspector may not find it.
Server Exits Immediately
# Run the server command manually in the same terminal
node path/to/server.js
# For packaged servers
npx my-mcp-server
If the server exits immediately when run manually, read its stderr output. Common causes: missing required environment variables, configuration file not found, or an uncaught startup exception.
Missing Environment Variables
stdio servers often need API keys or configuration. These must be passed explicitly to Inspector, not assumed from your shell:
# Pass environment variables inline
MY_API_KEY=abc123 DATABASE_URL=postgres://... npx @modelcontextprotocol/inspector node server.js
Or configure them in Inspector's environment settings if the UI provides that option for the current version.
Incorrect Args
If your server requires specific CLI arguments, ensure you pass them correctly:
npx @modelcontextprotocol/inspector node server.js --config ./config.json
Args after the server command are passed through to the server process.
MCP Inspector Proxy Errors with Streamable HTTP Servers
For Streamable HTTP transport, the Inspector proxy connects to an already-running HTTP server rather than spawning one. Different failure modes apply.
Server Not Running Before Inspector Connects
# Start your server first
node server.js &
# Verify it responds
curl http://localhost:3000/mcp
# Then start Inspector
npx @modelcontextprotocol/inspector http://localhost:3000/mcp
The proxy cannot spawn a Streamable HTTP server — you must start it independently.
Wrong Endpoint URL
The URL must point to the exact MCP endpoint, not just the server root. If your server mounts MCP at /mcp, the URL must include /mcp. A 404 from the proxy almost always means the endpoint path is wrong.
Authentication Failures (401 / 403)
If your server requires authentication headers, the current Inspector version may or may not support passing custom headers — verify against the official Inspector documentation. For servers requiring auth, consider temporarily disabling auth during Inspector testing, or run the server with a local no-auth mode.
Reverse Proxy Interference
If your Streamable HTTP server is behind nginx, Caddy, or a similar reverse proxy:
- Ensure the reverse proxy is not stripping required headers
- Ensure it is not adding authentication challenges the Inspector cannot answer
- Ensure request body size limits are not truncating MCP messages
- Test direct connectivity to the server port, bypassing the reverse proxy
For a deeper look at MCP server connection failures in general, the MCP server failed to connect: causes and fixes article covers transport-level failures in detail.
Inspector Works Locally but Fails in Docker, WSL, or Remote Development
This is a network namespace problem, not an Inspector bug.
The core issue: Inside a Docker container or WSL instance, localhost refers to that container's or instance's own loopback interface, not the host machine's. If the Inspector proxy is running on the host and your server is in a container (or vice versa), localhost will not bridge the gap.
Docker Desktop (macOS/Windows):
# Use host.docker.internal instead of localhost from inside a container
http://host.docker.internal:3000/mcp
WSL2:
# From WSL, find the host IP
cat /etc/resolv.conf | grep nameserver
# Use that IP instead of localhost
Remote development (VS Code Remote, SSH): The browser runs on your local machine. The Inspector proxy and target server run on the remote. Port forwarding must be configured for every port involved (proxy port and any server port the proxy connects to).
The general rule: draw a clear picture of where each process runs, then verify that the address used to connect actually routes to the right network namespace.
"Check Console Logs" MCP Inspector Proxy Error
When the Inspector UI shows a message telling you to check console logs, it means the error details are in one of two places — not in the UI itself.
What to collect:
-
Browser DevTools Console (F12 → Console tab): Copy the full error message and any stack trace. Note whether it is a network error (ERR_CONNECTION_REFUSED), a CORS error, or an HTTP error with a status code.
-
Inspector Terminal (the terminal where you ran
npx @modelcontextprotocol/inspector): Copy everything printed after the startup message. Look for error lines, exit codes, and any stderr output your server emitted. -
Target Server Logs (if your server has its own log file or outputs to a separate terminal): Check for startup exceptions, configuration errors, or runtime crashes.
With those three outputs, you can identify the exact failing layer and apply the appropriate fix from the sections above. You can also use MCPForge's MCP server testing tool to validate your server independently of the Inspector.
MCP Inspector Proxy Troubleshooting Table
| Symptom | Likely Cause | How to Verify | Fix |
|---|---|---|---|
| ERR_CONNECTION_REFUSED in browser console | Proxy not running or wrong port | Check Inspector terminal is open; curl the proxy port | Restart Inspector; fix port |
| Proxy terminal shows EADDRINUSE | Port conflict | lsof -i :<port> | Kill conflicting process |
| Proxy terminal: no output / exits instantly | Inspector package not installed or crash | Run with npx @modelcontextprotocol/inspector@latest | Reinstall or update Inspector |
| spawn ENOENT error in terminal | Server executable not found | Run the exact command manually | Fix PATH, use absolute path |
| Process exited with code N (non-zero) | Target server crashed on startup | Run server manually, read stderr | Fix server startup error |
| Process exited with code 0 immediately | Server quit unexpectedly | Test server manually with same args | Check server logic and args |
| Browser cannot reach proxy despite it running | localhost IPv4/IPv6 mismatch | curl http://127.0.0.1:<port> | Use 127.0.0.1 instead of localhost |
| CORS error in browser console | Non-localhost origin accessing Inspector | Check browser URL and headers | Access Inspector from localhost |
| HTTP 401 / 403 from proxy | Target server requires auth | curl -v <server-url> | Add auth headers or disable auth for testing |
| HTTP 404 from proxy | Wrong MCP endpoint path | curl <server-url>/mcp | Fix endpoint URL |
| HTTP 500 from proxy | Target server internal error | Check server logs | Fix server runtime error |
| Streamable HTTP endpoint unreachable | Server not started or wrong URL | curl <server-url> | Start server first; fix URL |
| Session error after connecting | Server state issue or timeout | Reconnect; check server session handling | Restart server and Inspector |
| Works locally, fails in Docker/WSL | Network namespace mismatch | ping host from container | Use host.docker.internal or host IP |
| Inspector UI loads, connect button fails | Proxy up, server failing to initialize | Check proxy terminal for initialization errors | Fix server startup; check args and env vars |
| npx takes long or fails silently | npm registry issue or outdated npm | npm cache clean --force; retry | Update npm; retry with fresh cache |
| Executable not found despite being installed | Wrong npm scope or PATH issue | which <command> in same shell | Use full path or npx prefix |
How to Confirm the Fix
Do not assume the fix worked because the error message disappeared. Verify each layer explicitly:
1. Proxy process is stable The Inspector terminal continues to output without errors and does not exit.
2. Browser reaches the proxy
curl http://localhost:<proxy-port>/
# Expect: HTTP 200 or a meaningful response (not connection refused)
3. Proxy reaches the target server The Inspector terminal shows a successful connection or initialization log, not a spawn error or connection refused.
4. MCP initialization completes The Inspector UI transitions past the connection state and shows the server capabilities (tools list, resources, prompts).
5. A test operation succeeds Navigate to the Tools tab and invoke any tool. A successful response with no proxy error confirms end-to-end functionality.
For a structured way to validate your MCP server before using Inspector, see the MCPForge MCP server test tool.
How to Prevent MCP Inspector Proxy Connection Errors
Keep the Inspector terminal visible. Run it in a dedicated terminal pane. Accidentally closing it kills the proxy.
Test your server independently first. Before connecting Inspector, run your server manually and confirm it starts and responds correctly. This separates server bugs from Inspector configuration bugs.
Pin the Inspector version during development. Using @latest always ensures you have the most current fixes, but if a regression appears, pin a specific version: npx @modelcontextprotocol/inspector@x.y.z.
Document the exact command. Store the full npx @modelcontextprotocol/inspector command with all args and env vars in a script or Makefile. Retyping complex commands introduces errors.
Use absolute paths for server executables. Relative paths depend on the working directory at launch time. Absolute paths work regardless of where you run Inspector.
On shared or CI machines, check ports before starting. Port conflicts are far more common in multi-user or automated environments. Add a port check to your startup script.
In containerized environments, plan the network topology before starting. Decide which process runs where, draw the connection path, and verify the addresses before you debug.
For broader context on using the Inspector effectively, the complete MCP Inspector guide covers setup, transport configuration, and testing workflows. If you are seeing specific MCP error codes, MCP error codes reference provides a structured breakdown of JSON-RPC error responses.
Want to analyze your API security?
Import your OpenAPI spec and generate a Security Report automatically.
Related Issues
If you have resolved the Inspector proxy error but are still seeing connection failures from an MCP client like Claude Desktop or Cursor, those failures operate differently — the Inspector proxy is not involved. The MCP server failed to connect: causes and fixes article covers client-to-server connection failures outside of the Inspector context.
For timeout-related failures that appear after a successful connection, how to fix MCP error 32001 request timed out addresses the specific scenario where the connection establishes but operations stall.