MCP Inspector
MCPDefinition
An official Anthropic debugging tool for MCP server development. Provides a UI to connect to any MCP server, list its tools/resources/prompts, execute calls, and inspect responses. Essential for testing MCP server implementations during development.
Example Usage
Run 'npx @modelcontextprotocol/inspector' to connect to your MCP server and test each tool interactively before deploying.
In Depth
The MCP Inspector is an official, interactive debugging tool for MCP server development. It provides a browser-based UI that connects to any MCP server — via either stdio or StreamableHTTP transport — and lets you explore and exercise the server's capabilities without writing a single line of client code.
What Inspector Provides
Once connected to a server, Inspector displays four key panels:
- Tools list: all tools the server exposes, with their full JSON Schema definitions. You can select a tool, fill in arguments through a generated form, execute it, and inspect the raw response.
- Resources list: all resources the server declares, with the ability to fetch and view their contents.
- Prompts list: all prompt templates, with argument forms for parameterized invocations.
- Notifications/Logs: streaming server log messages and JSON-RPC message traces for low-level debugging.
Running Inspector
The most common invocation is:
npx @modelcontextprotocol/inspectorThis starts a local web server (default port 5173) and opens the UI. You then paste in your server's command (for stdio) or URL (for HTTP) and connect. For stdio servers, Inspector handles the subprocess lifecycle — you do not need to start the server separately.
Inspector vs Alternative Debugging Methods
| Approach | Interactivity | Setup | Best for |
|---|---|---|---|
| MCP Inspector | High (GUI forms) | npx one-liner | Iterative dev, first-time exploration |
| Claude Code with .mcp.json | Medium (chat-driven) | Repo config required | Integration testing in real context |
| Direct JSON-RPC via curl | Low (manual JSON) | None | Scripted CI assertions |
| Unit tests (SDK mock) | Low (code) | Test harness setup | Regression prevention |
Inspector sits at the top of the debugging pyramid: it is the fastest way to verify that a server's tool definitions are correct, that inputs are validated as expected, and that outputs match what the model will receive. It does not simulate the model's tool-selection reasoning — for that, you need to test with an actual Claude client.
See Tool Distribution & Least Privilege for guidelines on which tools a server should expose and how Inspector helps audit that surface area.
How It Compares
| Method | Tests primitive listing | Tests tool execution | Tests model tool selection | Needs running Claude |
|---|---|---|---|---|
| MCP Inspector | Yes | Yes | No | No |
| Claude Code integration | Yes | Yes | Yes | Yes |
| Unit test with mock client | Yes | Yes | No | No |
| Manual JSON-RPC | Yes | Yes | No | No |
How It's Tested & Common Confusions
Exam angles for MCP Inspector:
- Purpose questions: "Which tool would you use to interactively test an MCP server's tools before deploying it?" → MCP Inspector.
- What Inspector cannot do: it does not simulate the model's reasoning about which tool to call — it only lets you call tools directly. Exam distractors often imply Inspector validates model behavior.
- Transport support: Inspector supports both stdio and StreamableHTTP. Questions might ask whether Inspector can test a remote server — yes, via HTTP transport.
- Primitives coverage: Inspector surfaces all three primitives (Tools, Resources, Prompts), not just Tools. A question that asks which primitive Inspector cannot inspect is a trap — it inspects all three.
Frequently Asked Questions
Does MCP Inspector require the MCP server to be running before connecting?
For HTTP transport, yes — the server must be running and reachable at the URL you provide. For stdio transport, Inspector launches the server process itself using the command you supply, so you only need the server binary or script to be present — Inspector manages the subprocess.
Can MCP Inspector be used in CI pipelines?
Inspector is primarily an interactive GUI tool and is not designed for automated CI pipelines. For CI validation of MCP servers, use the MCP SDK's testing utilities or write JSON-RPC assertions with curl/httpie against a test instance of your server.