Live on Product Hunt Intraface launched today. Less steering, more vacations. See the launch
Start for free

What is the MCP Inspector?

The MCP Inspector is the Model Context Protocol project's developer tool for testing MCP servers without an AI model in the loop. One npx command opens a local web UI that connects to your server over stdio or HTTP, lists its tools, resources and prompts, calls them with arguments you type, and shows the raw JSON-RPC messages.

Part of Glossary: the terms behind MCP, coding agents and shared pages, defined plainly.

How it works

The Inspector's page in your browser drives a local Node backend, which holds the real MCP connection to your server and shows you every message.everything onyour machinea stdio subprocess,or a URL over HTTPyouInspector UIbrowser, port 6274Inspector backendNode, holds the connectionyour MCP server1. pick a tool, run2. /api, with token3. tools/call4. result
  1. Run the Inspector with the command that starts your server after it, or pass --server-url and --transport http for a server at an address.

    npx @modelcontextprotocol/inspector node build/index.js
  2. A web page opens, served by a Node backend bound to 127.0.0.1 on port 6274. The page talks to that backend through routes guarded by a token minted per launch.

  3. Pick a tool, resource or prompt, fill in the arguments from its schema and run it. You see the request that went out and the reply that came back.

  4. For scripts and CI, add --cli and a --method. The result can come out as one JSON object, and the exit code says what went wrong.

    npx @modelcontextprotocol/inspector --cli node build/index.js --method tools/list
  5. A remote server that wants OAuth signs you in through the Inspector. It keeps the token in your OS keychain when one is available.

Source: MCP Inspector repository and docs

What the MCP Inspector is for

An MCP server is only ever used by a model, which makes it awkward to debug. When Claude Code calls your tool and gets nonsense back, you cannot tell whether the model sent odd arguments, the server mishandled them, or the transport dropped something. The Inspector takes the model out. You are the client: you choose the tool, type the arguments, and see the request and response exactly as JSON-RPC.

The current release is the v2 line of the @modelcontextprotocol/inspector package, and it ships four ways in. The default is the web UI, a React page backed by a small Node server. --cli runs one method and exits, for scripts. --tui gives an interactive terminal interface. An experimental mcpdo binary connects once and then runs many commands against that named connection through a local daemon.

Example: checking a new tool before an agent sees it

Say you have added a publish tool to a stdio server. Start the Inspector with your server command as the positional argument, and it spawns the process the same way an editor would. The new tool appears with its schema. Fill in the arguments and run it, then read the tools/call request and the reply side by side; if the reply is wrong, you know it is the server, because no model was involved. When it works, the one-line --cli version of the same call goes into your CI script, with --format json so a CI step can parse it, and --strict makes the run fail with exit code 6 if the tool's schema has an error-level problem.

Web UI versus CLI

The web UI is for exploring: clicking through tools, resources and prompts, signing in to a remote server that wants OAuth, and opening MCP Apps in a sandboxed frame served from a second local port. The CLI is for repetition. It takes the same targets (a command, or --server-url, or --config with --server <name>) and one --method such as tools/list, resources/list, prompts/list, or tools/call with --tool-name and --tool-arg key=value. Its exit codes are designed to be checked: 0 for success, 3 when the server wants authentication, 4 when it cannot be reached, 5 for a tool error or unknown tool, and on any failure it writes one JSON error line to stderr. For CI, --stored-auth-only uses a token you obtained earlier and never opens a browser.

Environment variables for a stdio server go in with -e KEY=VALUE, and --cwd sets its working directory. A config file uses the familiar mcpServers shape, each entry typed stdio, http or sse; --config is read-only, while --catalog is the Inspector's own writable list.

Common mistakes

  • Treating a green run as proof the tool is good. The Inspector only shows that the server answers. Vague descriptions, which decide whether a model calls the tool at all, pass silently.
  • Exposing it beyond your machine. It refuses to bind all interfaces unless you ask explicitly, and it protects its API with a per-launch token. Turning either safeguard off on a shared host hands your MCP connections to anyone on the network.
  • Forgetting the transport flag. --server-url says where the server is; --transport http or sse says how to talk to it. Pass both.
  • Storing secrets in plain text. Without an OS keychain, OAuth tokens and stdio env values land in a JSON file under your home directory, unencrypted unless you set a key.

FAQ

Is the MCP Inspector safe to leave running?
On your own machine, yes. It binds to 127.0.0.1, refuses to bind all interfaces unless you set DANGEROUSLY_BIND_ALL_INTERFACES, and protects its API with a token minted per launch. Do not set DANGEROUSLY_OMIT_AUTH if anything but your browser can reach it.
Can the MCP Inspector connect to a remote MCP server?
Yes. Pass --server-url with the address and --transport http (or sse for an older server); the docs' examples always give both flags together. Servers that need OAuth open a sign-in page, and you approve the consent screen like any other client.
Does the MCP Inspector tell me whether a model will use my tool well?
No. It calls exactly what you click, so it proves the server works. Whether a model picks the right tool depends on the descriptions and schemas, which you can read in the Tools tab but only an agent can test.

Stop sending HTMLover Slack.

Create an account in a minute, connect your coding agent, and make your first board.