Guide · Testing & Debugging
MCP Inspector
MCP Inspector is the official debugging tool shipped by the MCP SDK team. It opens a local web UI in your browser, connects to any MCP server (via stdio or HTTP/SSE), lists all available tools with their full JSON Schema definitions, and lets you call them interactively with custom arguments — showing the raw JSON-RPC request and response alongside the formatted result. It is the fastest way to answer "is my tool working?" during development, without writing a test or configuring an LLM client. This guide covers how to launch Inspector for both stdio and HTTP/SSE servers, what it shows, how to use it for schema verification and debugging, and where it fits relative to automated unit tests and AliveMCP's production monitoring.
TL;DR
Run npx @modelcontextprotocol/inspector <your-server-command> to connect to a stdio server. For an HTTP/SSE server already running at port 3000, run npx @modelcontextprotocol/inspector and paste the SSE URL into the Inspector UI. The browser tab shows your tools, lets you call them, and displays raw protocol traffic.
What MCP Inspector does
Inspector is a thin web application that acts as an MCP client — it speaks the MCP protocol, negotiates capabilities, and lists tools just as Claude or any other LLM client would. The difference is that it renders the protocol traffic visually and lets you construct tool call arguments through a form UI rather than through a natural-language prompt.
| Feature | What you see |
|---|---|
| Tools list | All tools your server advertises, with name, description, and full inputSchema JSON |
| Tool call form | Input fields generated from the tool's inputSchema — fill in args and click Run |
| Result display | Formatted content blocks (TextContent, ImageContent, etc.) plus raw JSON |
| Protocol log | Every JSON-RPC message exchanged: initialize, initialized, tools/list, tools/call |
| Resources & prompts | If your server implements the resources or prompts capability, those are listed too |
| Error display | Protocol errors and tool errors displayed with full JSON payload |
Connecting to a stdio server
For servers that launch via a command (the most common MCP server type for local tooling), pass the server command as arguments to Inspector. Inspector spawns the process and connects via its stdin/stdout.
# TypeScript server run with tsx
npx @modelcontextprotocol/inspector tsx src/index.ts
# Compiled server
npx @modelcontextprotocol/inspector node dist/index.js
# With environment variables
npx @modelcontextprotocol/inspector \
--env API_KEY=sk-test123 \
--env DB_PATH=/tmp/test.db \
node dist/index.js
# Python MCP server
npx @modelcontextprotocol/inspector uv run my_server.py
Inspector opens a browser window automatically (or prints the URL if the auto-open fails). The server process stays running until you close the Inspector tab or terminate the npx command. Environment variables passed via --env are available to the server process but not inherited from the parent shell — add any secrets or config paths the server needs to initialise successfully.
Connecting to an HTTP/SSE server
For servers that expose an HTTP endpoint (remote or locally running), launch Inspector without a server command and enter the connection details in the UI.
# Launch the Inspector UI without a target server
npx @modelcontextprotocol/inspector
# Inspector prints a URL like: http://localhost:6274
# Open it in a browser, then in the UI:
# - Select "SSE" transport
# - Enter the SSE endpoint URL, e.g.: http://localhost:3000/sse
# - Click Connect
For the newer Streamable HTTP transport (MCP spec 2025-03-26), select "Streamable HTTP" in the transport dropdown and enter the base URL (e.g., http://localhost:3000/mcp). Inspector handles the capability negotiation automatically.
If your server requires authentication headers, click "Add Header" to append Authorization: Bearer <token> before connecting. This is useful for testing your JWT validation or API key middleware during development.
Schema verification workflow
One of the most useful Inspector workflows is verifying your tool schemas before shipping. The MCP spec requires each tool's inputSchema to be a valid JSON Schema object. Common mistakes include missing type: 'object' at the top level, required fields listed that aren't in properties, and optional fields marked as required.
// A schema with a common mistake:
{
inputSchema: {
// Missing "type": "object" — Inspector will show the tool but the SDK
// may reject tool calls with argument validation errors
properties: {
query: { type: 'string', description: 'Search query' }
},
required: ['query']
}
}
// Correct:
{
inputSchema: {
type: 'object', // required at the root
properties: {
query: { type: 'string', description: 'Search query' }
},
required: ['query']
}
}
Inspector renders the schema in the tool list panel. If a tool does not appear, or appears with a broken input form, the schema is likely malformed. The protocol log shows the raw tools/list response — compare it against the MCP specification if a tool is missing.
Debugging tool call failures
When a tool call fails, the protocol log is the fastest way to diagnose the cause. Three distinct failure modes look different in Inspector:
| Failure mode | What Inspector shows | Root cause |
|---|---|---|
Tool returns isError: true | Formatted error content in the result panel; a yellow "Error" badge | Application error in the handler; the MCP protocol worked correctly |
| JSON-RPC error response | Red error in the protocol log; no result panel content | Handler threw an uncaught exception; wrong request schema; server-side validation rejected the request |
| Connection failure | Inspector disconnects; the protocol log shows no messages after connect | Server process crashed on startup; wrong SSE URL; missing auth header |
For the third case — where the server crashes on startup — check the terminal window where you launched Inspector. The server process output (stdout + stderr) is printed there, which typically shows the exact startup error. Common startup failures are missing environment variables, failed database migrations, and port conflicts.
Inspector vs. automated tests vs. AliveMCP
These three tools cover different phases of the development and operations lifecycle:
| Tool | When to use | What it verifies | Automation |
|---|---|---|---|
| MCP Inspector | During development, after a change | Schema correctness, manual happy path, protocol messages | Manual — requires a human |
| Unit tests (InMemoryTransport) | During development, in CI | Tool handler logic, error cases, argument validation | Fully automated |
| Integration tests | In CI before deploy | Full stack: DB, HTTP server, auth middleware, MCP protocol | Fully automated |
| AliveMCP | After deploy, continuously | Live server reachability, MCP protocol health, uptime, latency | Automated — probes every 60s |
A common pattern: use Inspector to verify a new tool during development, write unit tests to lock in the correct behavior, and rely on AliveMCP to alert when the deployed server's protocol health degrades — for example, when a bad deploy leaves the server returning a valid HTTP 200 but failing the initialize handshake.
Related questions
Can MCP Inspector test tools that require OAuth or SSO authentication?
Inspector supports manually-added request headers, so you can add a Authorization: Bearer <token> header with a token you obtained separately. For OAuth flows that require browser-based login, the workflow is: complete the OAuth flow in your browser to obtain an access token, copy the token, then paste it into Inspector's header configuration. Inspector does not itself initiate OAuth authorization code flows.
Does Inspector work with MCP servers that use the stdio transport for local clients?
Yes — this is the primary use case. Pass the server launch command as arguments: npx @modelcontextprotocol/inspector node dist/server.js. Inspector spawns the process and pipes stdin/stdout through the MCP protocol. The server must speak stdio transport — if your server only implements HTTP/SSE, use the SSE URL connection mode instead.
How do I test tools that return file content or binary data?
Inspector renders all MCP content block types. For ImageContent (type: 'image'), Inspector displays the image inline. For EmbeddedResource blocks, it shows the resource URI and MIME type. Binary data encoded as base64 in the data field is decoded and displayed visually. If a tool returns content that Inspector renders incorrectly, check that the mimeType field is set correctly on image and resource content blocks.
Inspector shows my tool but clicking Run does nothing. What's wrong?
Check whether the tool's inputSchema has type: 'object' at the root level. Without it, Inspector cannot render the argument input form and silently skips the Run action. Also verify that all required fields listed in the schema are present in the properties object — a schema where required: ['city'] but properties doesn't define city causes the form generator to fail. The raw schema is visible in the protocol log under the tools/list response.
Further reading
- MCP server unit testing — InMemoryTransport for automated tests, complementing Inspector's manual testing
- MCP server Vitest — test runner to automate what Inspector verifies manually
- MCP server debugging — debugging patterns beyond what Inspector shows
- MCP server error handling — understanding isError vs. protocol errors Inspector distinguishes
- MCP server SDK — the SDK that ships Inspector as part of the ecosystem
- MCP server JWT validation — adding auth headers in Inspector for testing secured servers
- MCP server health check — the endpoint AliveMCP probes that Inspector cannot replace
- AliveMCP — automated production monitoring that runs the checks Inspector does manually, every 60 seconds