The MCP Inspector server enables LLMs to inspect, test, and debug other MCP servers through both ephemeral and persistent connections with human-in-the-loop steering.
Core Capabilities:
Inspect MCP Servers: List and explore tools, resources (including templates), and prompts from any target MCP server
Test MCP Servers: Call tools and read resources with full parameter support
Multi-Transport Support: Connect via stdio (local commands), SSE, or HTTP transports with auto-detection
Persistent Session Management: Create, monitor, and close persistent connections with automatic garbage collection (30-minute TTL)
Event Monitoring: Capture and read buffered traffic, notifications, and errors for debugging
Human-in-the-Loop Workflows: Inject steering messages via CLI (
mcp-steer), HTTP API (port 9847), or MCP tools to guide LLM testingStateful Testing: Maintain server state across operations using session IDs for debugging stateful behavior
Use Cases:
Debug and develop MCP servers iteratively within an LLM conversation
Test MCP server functionality without external tools
Discover capabilities of unknown MCP servers
Validate tool inputs/outputs and resource structures
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP Inspector as MCP Serverlist tools from my local weather server"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP Inspector as MCP Server
A lean MCP server that enables LLMs to inspect and test other MCP servers. This is a self-contained implementation that uses the MCP SDK directly, without shelling out to external CLIs.
Features
Direct SDK integration: Uses
@modelcontextprotocol/sdkdirectly for both server and client operationsAll transport types: Supports stdio, SSE, and HTTP (streamable) transports
Minimal footprint: Single dependency (
@modelcontextprotocol/sdk)Full MCP inspection: List tools, call tools, list resources, read resources, list prompts, get prompts
Session management: Persistent connections with automatic garbage collection
Event buffering: Capture notifications, traffic, and errors for debugging
Installation
Usage
As an MCP Server
Add to your MCP config. While there are slight variances between different harnesses, the general format is the same:
Available Tools
Session Management (NEW in v2.0)
Tool | Description |
| Establish a persistent connection to an MCP server. Returns a |
| Close a persistent session and release resources. |
| List all active sessions with their status and idle time. |
| Read buffered events (notifications, traffic, errors) from a session. |
| Inject a human steering message into a session's queue. |
Inspection Tools
Tool | Description |
| List all tools exposed by an MCP server |
| Call a tool on an MCP server |
| List all resources exposed by an MCP server |
| Read a specific resource |
| List resource templates |
| List all prompts |
| Get a specific prompt |
Connection Parameters
All tools accept the following connection parameters:
For stdio transport (local commands):
command: Command to run (e.g.,"node","python")args: Array of arguments (e.g.,["path/to/server.js"])
For SSE/HTTP transport (remote servers):
url: Server URL (e.g.,"http://localhost:3000/sse")headers: Optional HTTP headers object
Common:
transport: Force transport type ("stdio","sse", or"http"). Auto-detected if not specified.session_id: (Optional) Use an existing persistent session instead of creating an ephemeral connection.
Session Workflow
For debugging stateful server behavior, use persistent sessions:
Sessions auto-close after 30 minutes of inactivity.
Human Steering & Observability
The inspector enables human-in-the-loop workflows where you can observe and guide LLM-driven MCP testing in real-time.
How It Works
Viewing Activity
Via LLM: The agent can call insp_read_events to see what's happening:
Via HTTP: Query the steering API directly:
Steering the Agent
Inject guidance messages that appear in the LLM's next tool response.
Using the CLI:
Using HTTP:
Using the MCP tool:
Event Types
Type | Description |
| Messages sent TO the target server |
| Messages received FROM the target server |
| MCP notifications from the target server |
| Errors encountered during communication |
| Human steering messages injected into the session |
Typical Workflow
LLM creates session:
insp_connect→ getssess_abc123LLM starts testing:
insp_tools_callwithsession_idHuman observes:
curl http://127.0.0.1:9847/api/sessionsHuman steers:
./bin/mcp-steer.mjs "Also test the batch endpoint"LLM receives steering: Next tool response includes
⚡ STEERING from human: ...LLM adapts: Takes the human guidance into account
Examples
List tools from a local MCP server (ephemeral):
Create a persistent session:
Call a tool using a session:
Architecture
Why This Exists
The original MCP Inspector is a web-based UI + CLI combo spread across multiple projects. This consolidates the core functionality into a single, lean MCP server that an LLM can use to:
Develop and debug MCP servers iteratively
Test MCP server functionality without leaving the conversation
Explore what tools/resources/prompts an MCP server exposes
Debug stateful behavior with persistent sessions
Changelog
v2.1.0
Added human steering (
insp_inject_steering) for human-in-the-loop workflowsAdded HTTP API on port 9847 for external steering/observability
Added
mcp-steer.mjsCLI tool for easy human interactionFixed critical bug in
TracingTransportWrapperwhere handler capture timing caused message loss
v2.0.0
Added session management (
insp_connect,insp_disconnect,insp_list_sessions)Added event buffering (
insp_read_events)All inspection tools now support optional
session_idfor persistent connectionsAdded automatic garbage collection (30-minute TTL for idle sessions)
Backward compatible: omit
session_idfor original ephemeral behavior
v1.0.0
Initial release with ephemeral connections
License
MIT