tutorials

MCP Inspector: Debug and Test Your MCP Servers (2026 Guide)

Apigene Team
10 min read
MCP Inspector: Debug and Test Your MCP Servers (2026 Guide)

A developer spent 30 minutes trying to get basic visibility into their MCP server during local development. They wanted console logs, tool call traces, response timing, error details. They tried MCP Inspector. They tried MCPJam. They ended up tailing a log file in /tmp from a separate terminal window. Nothing gave them the full picture.

That experience shows up in thread after thread. The MCP inspector is the official debugging tool for the Model Context Protocol, and it's the first thing most developers reach for when something breaks. But it has real limitations that the docs don't advertise. The gap between what Inspector shows you during development and what you need to debug production MCP servers is wider than most developers expect.

This guide covers what the mcp inspector does well, where it falls short, the critical security vulnerabilities you should know about, what alternatives the community has built, and how to get production-level observability that Inspector was never designed to deliver.

Key Takeaways

For busy developers debugging MCP server issues, here's what 14 community discussions revealed:

  • MCP Inspector shows protocol frames, not your app logs. Because stdio servers use stdout for the protocol, console.log breaks the JSON-RPC stream. Inspector shows messages but not what's happening inside your server.
  • Inspector can't observe real client traffic. It acts as its own MCP client, not a proxy. It can't sit between Claude and your server to watch actual production interactions.
  • CVE-2025-49596 is a critical RCE vulnerability in MCP Inspector. If you're running an older version, update immediately or use an alternative mcp tester.
  • For production observability, you need a gateway layer. Apigene provides per-call logging, error tracking, and timing data across all servers because it sits between the client and server, something Inspector can't do by design.

What Is MCP Inspector?

The model context protocol inspector is the official debugging tool built by the MCP team. It connects to your MCP server as a test client and shows you the JSON-RPC messages flowing between them. Think of it as Chrome DevTools' Network tab, but for MCP protocol traffic.

You run it against your server like this:

npx @modelcontextprotocol/inspector your-server-command

Inspector opens a web UI where you can see the initialize handshake, tools/list responses, and individual tool call results. You can test tools manually by filling in parameters and hitting send.

What Inspector Does Well

Protocol validation. The mcp inspector confirms your server handles the MCP handshake correctly. If your server returns malformed JSON-RPC or missing required fields, Inspector catches it immediately. This is its core strength.

Individual tool testing. You can call any tool from Inspector's UI, pass in parameters, and see the raw response. This is valuable for verifying that tool schemas match actual behavior before connecting to a real client.

Quick smoke tests. Before you hook your server up to Claude or Cursor, Inspector tells you whether it works at all. A quick initialize + tools/list check saves you from debugging client-side issues that are actually server-side bugs.

Spec conformance. If you're building an MCP server in a language without a mature SDK (Swift, Go, Rust), Inspector is your conformance test suite. It exercises the protocol surface area and tells you where your implementation diverges.

Stop Building MCP Integrations From Scratch.

  • Any API, one line of code — connect to ChatGPT, Claude, and Cursor without writing custom MCP servers
  • Visual UI in the chat — render interactive components, not just text dumps. Charts, forms, dashboards.
  • 70% fewer tokens — dynamic tool loading and output compression so your agents stay fast and cheap

Where MCP Inspector Falls Short

This is where the community frustration lives. The mcp debugger works for what it was built to do, but developers consistently expect it to do more.

Stdout Is the Protocol

The #1 complaint: "MCP Inspector only shows the JSON-RPC protocol messages. Can't see console.log output because stdout is taken by the protocol."

Here's the problem. Stdio MCP servers use stdout as the transport channel. Every byte you write to stdout is part of the JSON-RPC protocol. If you add a console.log("debug info") in your server code, that string gets injected into the protocol stream and breaks the JSON-RPC parser. Your debug output becomes a protocol error.

Inspector shows what came over the wire. It can't show what happened inside your server to produce that output. No internal state. No timing breakdowns. No error stack traces unless you explicitly serialize them into tool responses.

It Can't Observe Real Client Traffic

MCP Inspector acts as its own client. When you test with Inspector, you see Inspector-to-server communication. You don't see Claude-to-server or Cursor-to-server traffic.

This matters because different clients exercise servers differently. One developer reported: "MCPJam connected my server, had Claude call it, but couldn't see any of the traffic between Claude and my server." The same limitation applies to Inspector. If your server works in Inspector but fails with Claude Desktop, Inspector can't help you find the difference.

Session-Level Bugs Stay Hidden

Many MCP bugs are session-level: servers that time out on first connection, tools that work on retry but not on first call, or auth tokens that expire mid-conversation. Inspector runs a clean test each time. It doesn't simulate the long-running, stateful sessions that real clients maintain.

One developer described this: "requests time out really often and right after starting a session. They work after I exit the terminal and restart Claude." Inspector wouldn't catch this because it creates fresh connections for every test.

No Multi-Server Debugging

If you're running multiple MCP servers (most developers are), Inspector can only connect to one at a time. There's no way to see how tool calls route across servers, which server is responding, or how tool-name collisions between servers cause silent failures.

A developer spent an hour debugging because "multiple MCP servers with conflicting tool names" caused failures "with no useful message." Inspector can't detect this because it only tests one server in isolation.

Critical Security Vulnerabilities

Before you run MCP Inspector, you need to know about two significant CVEs.

CVE-2025-49596: Remote Code Execution in MCP Inspector

This critical vulnerability allows a malicious MCP server to execute arbitrary code on the machine running Inspector. If you connect Inspector to an untrusted server, that server can take control of your development machine. Update to the latest version immediately. If you're testing servers you didn't build, run Inspector inside a container or VM.

CVE-2026-23744: MCPJam Inspector Variant

A related vulnerability was found in the MCPJam Inspector, a community fork. The attack surface is similar: a crafted server response triggers code execution on the client side. This affects anyone using MCPJam as an mcp tester.

These CVEs highlight a broader pattern. Development tools that connect to arbitrary servers need sandboxing and input validation. If you're testing community MCP servers, don't run Inspector on your primary development machine without protection.

Community Workarounds

The developer community has built their own debugging solutions to fill Inspector's gaps. Here's what actually works.

Log to stderr or Files

Since stdout is reserved for the protocol, the most reliable workaround is logging to stderr or files:

// Breaks the protocol - don't do this
console.log("debug: processing tool call");
 
// Goes to stderr, not the protocol stream - safe
console.error("debug: processing tool call");
 
// Or log to a file for persistent debugging
import { appendFileSync } from 'fs';
appendFileSync('/tmp/mcp-debug.log', `${Date.now()}: processing tool call\n`);

Then tail the log in a separate terminal: tail -f /tmp/mcp-debug.log. One developer described their setup: "I write mine in Swift and ended up just logging everything to a file in /tmp and tailing it in a separate terminal. Not elegant but it works."

Custom JSON-RPC Test Harnesses

For faster iteration than relaunching Inspector, developers build lightweight test scripts that spawn the server and send messages directly:

import subprocess, json
 
proc = subprocess.Popen(
    ["node", "your-server.js"],
    stdin=subprocess.PIPE,
    stdout=subprocess.PIPE,
    stderr=subprocess.PIPE
)
 
# Send initialize
request = json.dumps({"jsonrpc": "2.0", "id": 1, "method": "initialize", "params": {}})
proc.stdin.write(f"{request}\n".encode())
proc.stdin.flush()
 
# Read response
response = proc.stdout.readline()
print(f"Response: {response.decode()}")
print(f"Server logs: {proc.stderr.read().decode()}")

This gives you both protocol messages and server logs in one place, something Inspector doesn't offer.

Explore 251+ MCP Integrations

Discover official and remote-only MCP servers from leading vendors. Connect AI agents to powerful tools and services.

251 Official ServersUpdated RegularlyVendor Verified

Proxy-Based Observability

For debugging issues between a real client (Claude, Cursor) and your server, developers build proxies:

  • mcps-logger records all JSON-RPC traffic between client and server
  • emceepee captures and displays MCP traffic as a transparent proxy
  • mcp-proxy by Sovereign Labs records hash-chained receipts for every tool call with tamper-evident audit trails
  • Jannal acts as a local proxy showing per-request data and how much context window tool definitions consume

One developer built a proxy because they "kept wanting to see exactly what happened during a session: which tools were called, what failed, and what got retried." They also found it caught retry storms where the agent "kept burning through tokens" on repeated failed calls.

MCP Inspector Alternatives

MCPJam

MCPJam provides a testing UI similar to Inspector with some extra API testing features. Its maintainer acknowledged the core limitation: "If you're building an stdio server and connecting it to a client like Claude or Cursor, the only way to observe messages would be to console log within the server." Note the CVE-2026-23744 vulnerability before using it.

VS Code MCP Tools Extension

VS Code has built-in MCP support with its own testing interface. It's convenient if you're already in VS Code, but it shares Inspector's fundamental limitation: it acts as a client, not a proxy.

Gateway-Based Observability

This is where the debugging story changes fundamentally. A gateway sits between all your MCP clients and all your MCP servers. Because it's in the data path, it can observe everything Inspector can't.

CapabilityMCP InspectorProxy (mcps-logger)Gateway (Apigene)
Protocol validationYesNoYes
Individual tool testingYesNoYes
Real client trafficNoYes (one server)Yes (all servers)
Multi-server visibilityNoNoYes
Per-call loggingNoYesYes
Token usage trackingNoNoYes
Error aggregationNoNoYes
Auth and RBACNoNoYes
Session-level debuggingNoPartialYes

How to Get the Most Out of MCP Inspector

Despite its limitations, the mcp inspector is still the right starting point for MCP server development. Here's the workflow that experienced developers recommend.

Step 1: Validate Protocol Compliance

Before connecting to any real client, run Inspector:

npx @modelcontextprotocol/inspector node your-server.js

Verify that initialize succeeds, tools/list returns your expected tools, and each tool handles sample parameters correctly.

Step 2: Open Chrome DevTools Inside Inspector

A tip most developers miss: Inspector runs in a browser. Open Chrome DevTools on the Inspector page itself and check the console pane. One of Inspector's maintainers advised: "you just need to open the Chrome DevTools console and log panes. It will give you everything the server produces that is available to any client."

Step 3: Run File Logging in Parallel

Run Inspector in one terminal and tail -f /tmp/your-mcp-debug.log in another. This gives you the protocol view (Inspector) and server internals (log file) side by side.

Step 4: Build a Startup Probe

For native MCP servers (Swift, Go, Rust), build an automated probe that tests the full lifecycle:

  1. Spawn your server binary
  2. Send initialize over stdio
  3. Send tools/list and verify the response
  4. Call each tool with sample parameters
  5. Check exit codes and timing

One developer called this "the unsexy 80%" of MCP development and emphasized that "Server binary works != MCP client can use it." Manual tests with Inspector aren't enough because "real MCP clients exercise stdio differently."

Step 5: Move to Gateway Observability for Production

When you're past development and deploying for real users or teams, switch from Inspector-based testing to gateway-based monitoring. Apigene provides the production observability layer: per-call logs, error tracking, token usage, and latency metrics across all your servers through one endpoint.

Expert Tip -- Yaniv Shani, Founder of Apigene

"MCP Inspector answers 'does my server speak the protocol?' A gateway answers 'what's actually happening in production?' They're different questions. Use Inspector during development. Use a gateway for everything after. The biggest debugging time-saver isn't a better mcp debugger. It's per-call logs that show you exactly which tool was called, what it returned, and how long it took, across every server, for every client session."

The Debugging Stack: What to Use When

StageToolWhy
Initial developmentMCP InspectorValidate protocol compliance and test individual tools
Server-side debuggingstderr/file logging + tail -fSee internal server state that Inspector can't show
Integration testingCustom JSON-RPC harnessTest without launching a full client
Client-specific issuesProxy (mcps-logger, emceepee)Observe real Claude/Cursor traffic
Security validationUpdated Inspector + sandboxed envAvoid CVE exposure when testing untrusted servers
Production monitoringApigene gatewayPer-call logs, token tracking, error alerting

The mcp inspector is the right tool for phase one. The mistake developers make is expecting it to also cover phases two through six. Each stage of MCP server development needs different visibility, and no single mcp tester handles all of them. Build your debugging stack in layers, starting with Inspector and ending with gateway-level observability.

Stop Building MCP Integrations From Scratch.

  • Any API, one line of code — connect to ChatGPT, Claude, and Cursor without writing custom MCP servers
  • Visual UI in the chat — render interactive components, not just text dumps. Charts, forms, dashboards.
  • 70% fewer tokens — dynamic tool loading and output compression so your agents stay fast and cheap

Frequently Asked Questions

What is MCP Inspector?

MCP Inspector is the official debugging tool for the Model Context Protocol. It connects to your MCP server as a test client and shows you JSON-RPC messages flowing between them. You can validate protocol compliance, test individual tools, and verify server responses. It runs as a browser-based UI installed via npx @modelcontextprotocol/inspector. It's designed for development-time validation, not production monitoring.

Why can't I see console.log output in MCP Inspector?

Stdio MCP servers use stdout as the protocol transport. Any console.log output gets injected into the JSON-RPC stream and breaks the parser. Use console.error instead (writes to stderr) or log to a file like /tmp/mcp-debug.log and tail it in a separate terminal. Inspector only shows protocol-level messages, not your application's internal debug output.

Is MCP Inspector safe to use?

CVE-2025-49596 is a critical remote code execution vulnerability in older versions of MCP Inspector. A malicious MCP server can execute arbitrary code on the machine running Inspector. Always update to the latest version. If testing untrusted servers, run Inspector inside a container or VM. A related vulnerability (CVE-2026-23744) affects the MCPJam Inspector variant.

Can MCP Inspector see traffic between Claude and my server?

No. MCP Inspector acts as its own client, not a proxy. It shows Inspector-to-server traffic, not Claude-to-server or Cursor-to-server traffic. To observe real client traffic, you need a proxy layer between the client and server. Tools like mcps-logger, emceepee, or an MCP gateway like Apigene capture this traffic because they sit in the actual data path.

What are the best alternatives to MCP Inspector?

For development testing, MCPJam offers a similar UI with extra API testing features (check for CVE updates first). For traffic observation, mcps-logger and emceepee act as transparent proxies recording all MCP traffic. For context optimization, Jannal shows how much context window your tool definitions consume. For production monitoring, an MCP gateway like Apigene provides per-call logging, error tracking, and token usage metrics across all servers behind one endpoint.

How do I debug an MCP server that works in Inspector but fails in Claude Desktop?

The most common cause is a transport mismatch. Claude Desktop expects stdio servers, so confirm your server isn't configured for HTTP. Check claude_desktop_config.json for correct command and args. If the config looks right, investigate session-level issues: first-call timeouts (common behind NGINX proxies), auth token expiry, or tool-name collisions with other servers. Place a proxy between Claude and your server to see exactly where communication breaks down.

#mcp#inspector#debugger#testing#mcp-server