Why use the MCP Inspector?
When building MCP servers, you’ll commonly ask:- “Is my server even running?” — Inspector shows connection status
- “Are my tools registered correctly?” — Inspector lists all available tools
- “What’s the response format?” — Inspector displays full JSON responses
- “Why isn’t this tool working?” — Inspector shows detailed error messages
Prerequisites
- Node.js 18+ and npm installed
- A working MCP server (see Building Your First Server)
Installation
- npx (recommended)
- Global install
- Project devDependency
No installation needed — run on demand:
npx downloads the Inspector temporarily, runs it, and cleans up afterwards.Connecting to your server
stdio servers (local process)
Pass the server startup command directly to the Inspector:SSE/HTTP servers (remote)
Start your server first, then connect the Inspector to it:Inspector interface
The web interface (typically athttp://localhost:5173) shows three tabs:
Testing tools
Open the Tools tab
Inspector automatically calls
tools/list. You’ll see each registered tool with its name, description, and input schema.Select a tool and fill in parameters
Click a tool, fill in the form fields that correspond to its input schema.
Debugging tool errors
When a tool fails, Inspector shows structured error output:JSON-RPC error codes
| Code | Meaning |
|---|---|
-32700 | Parse error — invalid JSON received |
-32600 | Invalid request structure |
-32601 | Method not found |
-32602 | Invalid params |
-32603 | Internal server error |
Testing resources and prompts
Testing resources
Testing resources
- Click the Resources tab.
- Inspector calls
resources/list— you’ll see all resource URIs, names, and MIME types. - Select a resource and click Read Resource to see its content.
greeting://{name}, enter the URI with the parameter filled in.Testing prompts
Testing prompts
- Click the Prompts tab.
- Inspector calls
prompts/list— you’ll see all registered prompt templates. - Select a prompt, fill in arguments, and click Get Prompt to see the rendered message template.
CLI mode
For automation and CI/CD use, add--cli to run without a browser:
Key takeaways
- Launch the Inspector by passing your server startup command:
npx @modelcontextprotocol/inspector node build/index.js - For stdio servers, the Inspector manages the server process. For HTTP servers, start the server first then connect with
--sse. - Use the Tools, Resources, and Prompts tabs to interactively test each capability.
- Add
--clifor CI-friendly non-interactive testing. - Error codes follow the JSON-RPC 2.0 standard (
-32600to-32603).