# MCP Inspector: test and debug any MCP server

The MCP Inspector is the official debugging tool for MCP servers — a browser UI that connects to any server, lists what it exposes, and lets you call tools by hand. When a server misbehaves inside Claude or Cursor, this is where you find out why.

## Run it

One command, no install (Node.js ≥ 22.19):

```sh
npx @modelcontextprotocol/inspector
```

That starts the web UI on `http://localhost:6274` and prints a launch URL containing a session token — open that exact link. The same package also ships a `--cli` mode for scripting and a `--tui` mode for the terminal.

## Inspect a local (stdio) server

Append the server's launch command and the Inspector starts it as a subprocess — the same thing your MCP client would do:

```sh
# a server you're building
npx @modelcontextprotocol/inspector node build/index.js

# any published server
npx @modelcontextprotocol/inspector npx -y @vendor/mcp-server

# pass env vars with -e; everything after -- goes to the server itself
npx @modelcontextprotocol/inspector -e API_KEY=sk-… -- npx -y @vendor/mcp-server --flag
```

Click **Connect**, then work through the tabs: **Tools** lists every tool with its input schema and lets you call one with arguments you type in; **Resources** and **Prompts** do the same for the other two MCP primitives. The notifications pane shows the server's log output — the messages your AI client normally swallows.

## Inspect a remote server

Switch the transport dropdown to **streamable HTTP** (or SSE for older servers) and paste the URL. For servers behind OAuth, the Inspector runs the sign-in flow in your browser and shows each step — which makes it the quickest way to debug a remote server's auth before blaming your client. For token-based servers, add the header instead:

```sh
npx @modelcontextprotocol/inspector --cli https://mcp.example.com/mcp \
  --transport http --header "Authorization: Bearer …" --method tools/list
```

Every remote endpoint on mcpyet.com's official-server list (<https://mcpyet.com/browse/official/>) can be checked this way before you commit it to a client config.

## CLI mode

`--cli` skips the browser entirely: one JSON-RPC method per invocation, results on stdout, exit codes for automation. Useful in CI to catch a server that stopped listing the tools your prompts depend on:

```sh
# list tools
npx @modelcontextprotocol/inspector --cli node build/index.js --method tools/list

# call one
npx @modelcontextprotocol/inspector --cli node build/index.js \
  --method tools/call --tool-name mytool --tool-arg key=value

# pipe into jq
npx @modelcontextprotocol/inspector --cli node build/index.js \
  --method tools/list --format json | jq '.tools[].name'
```

If you already keep servers in a config file, point the Inspector at it with `--config path/to/config.json --server myserver` instead of retyping commands.

## A note on the Inspector's own security

The Inspector's proxy can spawn processes on your machine, so it binds to localhost and requires the session token from its launch URL. Two environment variables loosen that — `DANGEROUSLY_OMIT_AUTH=true` and `DANGEROUSLY_BIND_ALL_INTERFACES=true` — and both mean what their names say. Leave them alone unless you're inside a disposable container, and never expose a running Inspector to a network you don't control.

## When it doesn't connect

| Symptom | Usual cause | Fix |
| --- | --- | --- |
| Browser shows 403 | Missing or stale session token | Open the exact launch URL the terminal printed — it carries the token |
| Connect fails instantly (stdio) | Server command crashes on start | Run the command alone in a terminal; the real error prints there |
| Connects, zero tools listed | Server exits before registering, usually a missing API key | Pass the key with `-e KEY=value` and watch the notifications pane |
| Remote URL won't connect | Wrong transport for the server | Try streamable HTTP first, SSE second — vendors are migrating from SSE |
| Port already in use | Another Inspector (or app) on 6274/6277 | Set `CLIENT_PORT` / `SERVER_PORT` to free ports |

## Alternatives

For quick checks you may not need it: Claude Code's `/mcp` command shows each connected server's status and tools, Cursor's MCP settings page lists tools per server, and a remote server's `tools/list` can be hit with plain `curl` if you enjoy hand-writing JSON-RPC. The Inspector earns its place the moment you need to see schemas, call tools with crafted arguments, or watch an OAuth flow fail in slow motion — no other tool shows the whole conversation.

## Questions

**Do I need to install the MCP Inspector?**
No. npx @modelcontextprotocol/inspector downloads and runs the current release in one step. The only requirement is Node.js 22.19 or newer.

**What ports does the Inspector use?**
The web UI serves on port 6274 and its proxy backend on 6277. Override them with the CLIENT_PORT and SERVER_PORT environment variables if either clashes with something you're running.

**Why does the Inspector ask for a session token?**
The proxy can spawn arbitrary processes on your machine, so it's protected by a token generated at startup and printed in the terminal — the launch URL includes it, so opening that link signs you in. Set MCP_PROXY_AUTH_TOKEN to use a known value; never disable auth outside a throwaway environment.

**Can the Inspector connect to remote MCP servers?**
Yes. Pick the streamable HTTP (or legacy SSE) transport, paste the server URL, and the Inspector runs the OAuth flow in your browser or sends the headers you give it — which makes it the fastest way to check a remote endpoint before wiring it into a real client.

**Is there a way to use it in CI?**
That's CLI mode: pass --cli plus a --method like tools/list, and results print to stdout with machine-readable exit codes. Add --format json to pipe the output into jq.

Related guides: [Build an MCP server](https://mcpyet.com/guides/build-mcp-server.md) · [Remote MCP servers](https://mcpyet.com/guides/remote-mcp-servers.md) · [Connect to Claude](https://mcpyet.com/connect/claude.md)

---

Source: https://mcpyet.com/guides/mcp-inspector/ — data refreshed 2026-08-11
