Skip to content

MCP Inspector - Debug Model Context Protocol Servers Cheatsheet

MCP Inspector - Debug Model Context Protocol Servers Cheatsheet

MCP Inspector is the official visual testing and debugging tool for Model Context Protocol servers. When you are building an MCP server, you need to see what it actually exposes and how it responds — Inspector connects to your server, lists its tools, resources, and prompts, lets you invoke each one with arbitrary arguments, and shows the raw JSON-RPC messages flowing in both directions. It is the fastest way to verify a server works before wiring it into Claude, Cursor, or another client.

Running It

MethodCommand
npx (no install)npx @modelcontextprotocol/inspector
With your servernpx @modelcontextprotocol/inspector node build/index.js
Python servernpx @modelcontextprotocol/inspector uv run server.py
Remote/SSE serverlaunch, then enter the URL in the UI
UIopens in the browser (default http://localhost:6274)

Connection Types

TransportUse
STDIOLocal server run as a subprocess (most common)
SSERemote server over Server-Sent Events
Streamable HTTPModern remote transport
# Inspect a local stdio server, passing args and env
npx @modelcontextprotocol/inspector \
  -e API_KEY=abc123 \
  node build/index.js --verbose

The Interface

TabShows
ToolsEvery tool, its JSON schema, and a form to call it
ResourcesExposed resources and their contents
PromptsPrompt templates and their arguments
NotificationsServer-initiated messages/logs
HistoryEvery request/response pair

Testing Tools

StepAction
1Open the Tools tab; confirm your tool is listed
2Check the input schema renders correctly (types, required fields)
3Fill the generated form and click to invoke
4Inspect the returned content and any isError flag
5Read the raw JSON-RPC in History to debug shape issues

This loop catches the most common MCP bugs: a malformed schema, a tool that returns the wrong content shape, or an unhandled error.

What to Verify Before Shipping

CheckWhy
Tool names are unique/descriptiveClients surface them to the model
Descriptions explain when to use the toolDrives correct model selection
Input schema is precisePrevents malformed calls
Errors return isError with a messageModel can recover
Large outputs are paginated/truncatedAvoids blowing the context window
Resources have stable URIsClients cache/reference them

Debugging Tips

SymptomLook at
Server won’t connectCommand/args; stderr in the launching terminal
Tool missingRegistration code; restart the server
Schema renders oddlyJSON Schema types in the tool definition
Client behaves differentlyCompare raw JSON-RPC in History
Env-dependent bugRe-launch Inspector with -e KEY=value

Common Workflows

# Develop-and-test loop for a TypeScript MCP server
npm run build && npx @modelcontextprotocol/inspector node build/index.js

# Test a Python server with uv
npx @modelcontextprotocol/inspector uv run my_server.py

# Verify a remote SSE server before adding it to a client
npx @modelcontextprotocol/inspector   # choose SSE, paste the URL

MCP Inspector vs Alternatives

ApproachTrade-off
MCP InspectorPurpose-built, visual, shows raw protocol
Wiring into a real clientRealistic but slow feedback loop
Hand-written JSON-RPCFull control, tedious
Unit testsFast and repeatable; pair with Inspector for exploration

Use Inspector while building, then add automated tests; see MCP servers for server implementation patterns.

Resources