Skip to content

Debug MCP servers with the official MCP Inspector

On this page

The MCP Inspector is the MCP project’s own tool for testing and debugging MCP servers. Run npx @modelcontextprotocol/inspector with a server command or URL and it connects as an MCP client, lists the server’s tools, resources and prompts, lets you call them with arguments you choose, and shows the JSON-RPC and HTTP traffic underneath. It runs as a web UI by default, with --cli and --tui modes for scripts and terminals.

Checked as of November 2026 against the Inspector repository at release 2.14.0, the Inspector docs on modelcontextprotocol.io and the project’s security advisories.

What the MCP Inspector is

The Inspector is a reference MCP client that shows its work. When an agent says a server has no tools, or a tool call fails with a vague error, the Inspector shows you what the server actually returned, without a model in between guessing at it. What is an MCP server covers the protocol messages it displays.

Version 2 is a rewrite and a single package, @modelcontextprotocol/inspector, with three clients on one shared core: web, CLI and TUI. It requires Node.js 22.23.4+, 24.22.1+ or 26.12.1+. The v1 line is deprecated and gets security fixes only; npx @modelcontextprotocol/inspector@v1-latest pins it if an old script depends on it.

Run the MCP Inspector with npx for a stdio server

Everything after the Inspector’s own options is the command that starts your server:

Shell
# A local build
npx @modelcontextprotocol/inspector node build/index.js

# A published npm server
npx -y @modelcontextprotocol/inspector npx @modelcontextprotocol/server-filesystem ~/Desktop

# A Python server via uvx
npx @modelcontextprotocol/inspector uvx mcp-server-git --repository ~/code/my-repo

Pass environment variables to the server with -e KEY=VALUE, and put -- before any server flag the Inspector also defines (such as --config) so the Inspector doesn’t consume it.

The launcher starts a web server on port 6274 and prints a URL that includes a per-launch token, then opens it. Use that URL rather than typing localhost:6274 from memory. Started with no target, the Inspector opens its server list instead, seeded on first launch with a filesystem server, the “everything” reference server and the MCP project’s hosted example server.

Connect to a remote Streamable HTTP server

Shell
npx @modelcontextprotocol/inspector --server-url https://mcp.example.com/mcp --transport http

--transport takes http (Streamable HTTP) or sse. For a server that wants a static token instead of OAuth, add a header:

Shell
npx @modelcontextprotocol/inspector --server-url https://mcp.example.com/mcp \
  --transport http --header "Authorization: Bearer $TOKEN"

The Inspector makes the outbound connection from its Node backend, so a remote server sees requests from your machine, not from a browser. Servers that require OAuth start the sign-in flow when you connect (see below).

The Inspector tabs

The tab bar adapts to what the server advertised in its initialize response, which is itself a diagnostic:

TabShown whenUse it for
ServersAlwaysAdd, edit, import and connect servers; per-server settings
ToolsServer advertises toolsSchemas as forms, calls, results with structured content
ResourcesServer advertises resourcesListing, reading and subscribing
PromptsServer advertises promptsFilling arguments and previewing generated messages
AppsThe server has MCP App toolsRendering a tool’s UI in a sandboxed frame
Skills, TasksThe server declares those extensionsBrowsing skills, tracking long-running calls
LogsServer advertises loggingServer log notifications and level control
ProtocolAlwaysThe JSON-RPC transcript
NetworkHTTP and SSE serversStatus codes, headers and bodies
Consolestdio serversThe server process’s stderr

Protocol, Network and Console (with Logs and Tasks) can be pinned as a sidebar, so you watch traffic while calling tools. Secrets in Network headers are masked behind a reveal control; Protocol and Console show traffic as sent.

The Tools tab also flags schema portability problems: constructs that are valid JSON Schema but that real clients refuse or mishandle. That is how you find out why a tool that works in the Inspector fails in Claude Code with a bare “Invalid input”.

MCP Inspector CLI mode

--cli connects, runs one method, prints the result and exits. It is what you want in CI or when a coding agent needs fast feedback on a server it’s building:

Shell
# List tools from a local server
npx @modelcontextprotocol/inspector --cli node build/index.js --method tools/list

# Call a tool against a remote server and pipe the result into jq
npx @modelcontextprotocol/inspector --cli https://mcp.example.com/mcp --transport http \
  --method tools/call --tool-name get_weather --tool-arg city=Boston --format json | jq .result

Other methods include resources/list, resources/read, prompts/list and prompts/get. Exit codes are specific: 3 means the server required authentication, 4 that it was unreachable, and 5 that a tool call returned isError or the tool wasn’t found. v1 exited 0 on a failed call, so v1-era CI scripts may start failing after an upgrade, correctly. With --strict, tools/list exits 6 when a schema has an error-level portability problem.

--tui gives the same features in an interactive terminal UI, useful over SSH where there’s no browser.

Debug OAuth and authentication

For remote servers, most “it won’t connect” problems are authentication. The Inspector runs the full MCP authorization flow and shows each step:

  1. The server answers 401 with a WWW-Authenticate header pointing at its protected-resource metadata.
  2. The Inspector fetches that metadata and the authorization server’s metadata.
  3. It registers or identifies itself: dynamic client registration, a static client (--client-id and --client-secret), or a Client ID Metadata Document (--client-metadata-url).
  4. Your browser opens for sign-in and consent, then redirects back with a code.
  5. The Inspector exchanges the code for tokens and retries the connection.

When this fails, the Network tab shows which request broke: a missing WWW-Authenticate header, a metadata URL returning 404, a registration endpoint that rejects the request. After a successful flow, the Connection Info panel shows the authorization status, registration type, client ID, granted scopes and access token, with Clear OAuth state and disconnect to start over.

Redirect URIs trip people up. The web client’s callback follows the origin you opened, so localhost and 127.0.0.1 produce different URIs; copy the exact value from Redirect URI in Server Settings. The CLI and TUI use http://127.0.0.1:6276/oauth/callback, which you register once on providers that require pre-registered clients.

Mid-session, a 403 insufficient_scope triggers step-up: the Inspector asks to re-authorize for the extra scopes. That is the fastest way to confirm a server’s scope requirements match its documentation. MCP authentication explains the discovery and token rules being exercised here.

Tokens are stored in the OS keychain when one is available. Without one (headless Linux, SSH sessions, some containers) they go to ~/.mcp-inspector/secrets.json, unencrypted unless you supply a key.

The session token and the old proxy vulnerability

The Inspector can start processes on your machine: that is how it launches stdio servers. Anything that can talk to its backend can ask it to run a command.

That is what CVE-2025-49596 was about. In versions below 0.14.1, the browser client talked to a separate proxy process on port 6277 with no authentication, so unauthenticated requests could launch MCP commands over stdio. The advisory rates it critical and describes it as remote code execution. The fix added a session token and an origin check.

v2 removed the separate proxy. One server on port 6274 serves the UI and guards every /api/* route with a per-launch MCP_INSPECTOR_API_TOKEN. By default it binds 127.0.0.1, accepts only loopback origins, and refuses to bind all interfaces unless you set DANGEROUSLY_BIND_ALL_INTERFACES=true. DANGEROUSLY_OMIT_AUTH=true turns the token off; the names are deliberate.

The protections kept evolving. An advisory published in October 2026 showed the original origin check could be bypassed with DNS rebinding to read the token and stored OAuth tokens; it was fixed in 2.12.0, and the docs now describe a Host header allow-list that runs before every route. The same month brought fixes for critical RCE advisories in the v1 line (1.0.3). Practical rules:

  • Run a current release. npx with no version picks up the latest.
  • Don’t expose port 6274 on a shared network, and don’t set either DANGEROUSLY_ variable outside a disposable container.
  • Treat a server you’re inspecting as untrusted. Several advisories involved malicious servers or MCP Apps attacking the Inspector itself.

Checklist: the server connects but shows no tools

Work through these in order. Each points at a different layer.

  1. No Tools tab at all: the server didn’t advertise the tools capability. Open Protocol and read the initialize response.
  2. Tools tab with an empty list: tools/list returned []. Check whether the server filters tools by user, scope or client: an OAuth token with a narrow scope, a read-only endpoint, or a gateway that only lists tools this agent has been granted all look like this. Connection Info shows the scopes you actually got.
  3. Some tools missing: look for nextCursor in the tools/list response. If the server paginates, turn on Fetch Lists One Page at a Time in Server Settings to see each page. Also check Advertised Extensions: a server may register tools based on what the client declares.
  4. stdio server connects, then drops or lists nothing: read Console. The stdio transport spec says a server must not write anything to stdout that isn’t a valid MCP message, so a stray console.log corrupts the stream. Logs belong on stderr.
  5. Remote server returns errors before initialize: read Network. A 404 or 405 usually means the URL is missing its /mcp path; a 401 with no WWW-Authenticate header means the server can’t start OAuth discovery.
  6. The Inspector shows tools but your agent doesn’t: the problem is in the client. Check its permission rules (a whole-tool deny in Claude Code permissions hides the tool), whether it needs a restart to refetch the list, and whether the tool’s schema has portability warnings. Claude Code also leaves out tools whose full mcp__server__tool name exceeds 128 characters.

If the server sits behind a gateway, compare a direct Inspector connection with one through the gateway. A gateway like Toolstile filters tools/list per agent, so an empty list there usually means the agent hasn’t been granted tools yet; what an MCP gateway is describes that filtering.