Zenaique

How would you use mcp-inspector to debug a tools/call that returns unexpected output?

Short answer·Medium·4.0 · 0·~3 min·Asked atLtimindtreeN8nPerplexity·Relevant atAnthropicCursor
Attempt it

Describe what mcp-inspector is and walk through how you would use it to debug a `tools/call` that returns unexpected output.

Free · 2 AI evals / day
TL;DR

mcp-inspector is the official browser tool that connects straight to an MCP server so you can list and call tools, read the raw JSON-RPC, and isolate bugs before wiring into a host.

Memory aid
Sign in to see the mnemonic that makes this stick.
Easy to grasp

Imagine you build a vending machine and want to test it before bolting it to the wall in a busy lobby. You'd press each button yourself, watch what drops out, and check the little display for errors. mcp-inspector is that test bench for an MCP server. You point it at your server, see the full menu of tools, press a button by sending the exact arguments yourself, and watch the raw message that comes back. If a tool misbehaves, you find out right there, with no chatbot guessing in the middle. You read the actual request you sent and the actual reply, so you can tell a broken tool from a broken connection in seconds.

Concept explanation~2 min read

Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.

mcp-inspector is the official, interactive debugging client for the Model Context Protocol. The fastest mental model is Postman for MCP: it connects directly to a server, lets you list and call its tools, read its resources, and pull its prompts, and it shows you every JSON-RPC message on the wire as it happens. Crucially, there is no LLM and no host application in the loop.

That last point is the entire value proposition. When an MCP tool returns something wrong inside a real host, the failure could come from three different places: the model chose bad arguments, the host mangled the transport, or the server's own tool logic is broken. You cannot tell which from inside the host, because the host renders a polished result and discards the raw protocol traffic. The inspector collapses that ambiguity by removing everything except you and the server, so every observed behavior is attributable to the server alone.

This matters because MCP development has a wide gap between writing a server and seeing it work inside an agent. The inspector fills that gap. It is where you confirm the server even starts, where you sanity-check the schema before a model ever sees it, and where you reproduce a production complaint deterministically. This deep dive covers what the inspector is, how it connects, the standard inner dev loop, how to read a failed tools/call response, and how to promote the same checks into automated CI so regressions never reach production.

What mcp-inspector actually is

The inspector is a developer tool that speaks the MCP wire protocol directly to a server. You launch it, give it a command to start your server or a URL to connect to, and a browser UI opens. From there it performs the initialize handshake, negotiates capabilities, and then lets you browse everything the server exposes. The handshake step alone is informative: if capability negotiation fails, the server and the inspector disagree about the protocol version, which is a class of bug you would otherwise only discover deep inside a host.

The UI surfaces the three MCP primitives separately. You see a tools panel listing every callable function with its inputSchema, a resources panel listing readable data references by URI, and a prompts panel listing the parameterized templates. Each one is interactive: you can call a tool, read a resource, or render a prompt by hand. Keeping the primitives separate matters, because a common confusion is expecting read-only data to come back from a tool call when it should be exposed as a resource instead.

Underneath the friendly panels sits a raw message log. Every request you trigger and every response the server sends is shown as the literal JSON-RPC payload, including the method name, the request id, and the full params and result objects. That raw view is what makes the inspector a debugger rather than just a demo client. You are never guessing about what crossed the wire, because you can read it byte for byte, copy it into a bug report, or diff it against an earlier run.

Connecting: stdio versus Streamable HTTP
The inner debug loop: connect, list, call, read
Reading the response: isError versus JSON-RPC error
From interactive to automated: the CLI and CI
Sign in to unlock the full deep dive.

Situations where this technique stops working.

Sign in to see when this approach fails.

2–4 min · Everything important, quickly.

Sign in to see the quick scan of the deep dive.
Signal in the responseWhat it meansWhere to fix
isError true in resultTool handler ran and reported failureInside your tool logic
JSON-RPC error codeRequest never reached the handlerRouting, transport, or method name
Unexpected content array shapeHandler returned the wrong result formatResult serialization in the tool
Wrong inputSchema in tools/listArguments coerced or rejected before callTool registration and schema

Real products, models, and research that use this idea.

  • A team building a Postgres MCP server runs mcp-inspector locally, calls tools/list, and catches a mistyped inputSchema before Claude Code ever connects.
  • Cursor and Zed plugin authors use the inspector to verify a server over Streamable HTTP, then ship it knowing any MCP host can drive it.
Sign in to see more production examples.

What an interviewer would ask next. Try answering before peeking at the approach.

QHow do you debug a Streamable HTTP MCP server that needs OAuth before tools/list works?
A

Configure the bearer token in the inspector's connection settings, confirm the auth handshake succeeds, then list tools. A 401 at connect time is an auth-layer bug, not a tool bug.

2 more follow-ups an interviewer would ask next. Sign in to reveal them.

Red flags & common mistakes

The phrases that signal junior thinking. Click to expand.

Most common mistake

Debugging through the host LLM instead of the inspector. The model hides the raw JSON-RPC, so you cannot tell a tool logic error from a protocol error.

Sign in to see all red flags and common mistakes.

60 second bullets to scan on the way to the call.

  • What mcp-inspector is and why it isolates the server

  • The connect, list, call, read inner loop

Sign in to unlock the revision sheet.

Primary sources. Browse if you want the original framing.

Similar questions

Same topic, related formats. Practice these next.

4 curated
Next question
What is the Model Context Protocol (MCP) and what problem does it solve?
MCQ·Easy