Creativity · MCP — pattern

Testing MCP Servers with the Inspector Tool

`@modelcontextprotocol/inspector` is the official test harness for MCP servers. You point it at your server command (or URL) and it launches a browser UI where you can list tools, call them with JSON arguments, stream resources, and watch the JSON-RPC traffic live. Treat it as your curl+Postman equivalent for MCP. It's the fastest way to verify a new server works before you wire it into Claude Desktop.

MCP facts

Kind
pattern
Ecosystem
anthropic-mcp
Language
TypeScript / Node.js
Transports
stdio, http, sse

Capabilities

  • List tools, resources, prompts exposed by a server
  • Invoke tools with structured JSON arguments
  • Subscribe to resources and see update notifications
  • Inspect raw JSON-RPC request/response traffic

Install

npx -y @modelcontextprotocol/inspector

Configuration

# Inspect a local stdio server
npx -y @modelcontextprotocol/inspector npx -y @modelcontextprotocol/server-filesystem /tmp

# Inspect a remote HTTP server
npx -y @modelcontextprotocol/inspector --transport http --url https://mcp.example.com

Frequently asked questions

When should I use the Inspector?

Any time you build or modify an MCP server. It's faster than restarting Claude Desktop, and you can see the exact JSON-RPC payloads — great for debugging schema mismatches.

Does it support auth?

Yes. For HTTP/SSE servers you can provide a bearer token or trigger the OAuth flow directly in the UI. For stdio servers, pass env vars on the command line the usual way.

Can I script it for CI?

The UI is interactive, but the underlying MCP SDK libraries are easy to script for automated tests. A common pattern is: Inspector for dev, SDK-based integration tests in CI.

Sources

  1. MCP Inspector on GitHub — accessed 2026-04-20
  2. MCP docs — debugging — accessed 2026-04-20