MCP Inspector as MCP Server
MCP Inspector as MCP Server lets an LLM inspect and test other MCP servers over stdio, SSE, or HTTP.
List a target server’s tools, resources, resource templates, and prompts.
Call tools, read resources, and get prompts with supplied arguments.
Connect to local servers via
command/argsor remote servers viaurl/headers, with transport auto-detection or forcedstdio/sse/http.Per the README, also manage persistent sessions, read buffered events, inject human steering messages, and report negotiated protocol era/revision.
Click on "Deploy 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 Server list 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 built on the MCP SDK v2 packages directly, without shelling out to external CLIs.
Features
Direct SDK integration: Built on the MCP SDK v2 packages,
@modelcontextprotocol/serverfor serving the inspector tools and@modelcontextprotocol/clientfor connecting to target serversAll transport types: Supports stdio, SSE, and HTTP (streamable) transports
Small footprint: Two runtime dependencies, the
@modelcontextprotocolv2 client and server packagesProtocol-era aware client: When connecting to a target server, can negotiate the legacy 2025-era handshake or the modern stateless protocol and report which era the server actually answered as (see Protocol negotiation)
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
Related MCP server: mcp-cli-catalog
Installation
npm install
npm run buildUsage
As an MCP Server
Add to your MCP config. While there are slight variances between different harnesses, the general format is the same:
{
"mcpServers": {
"mcp-inspector": {
"command": "node",
"args": ["/path/to/mcp-inspector-as-mcp-server/dist/server.js"]
}
}
}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.negotiation: Protocol era to negotiate as a client ("legacy","auto", or a pinned revision). See Protocol negotiation.session_id: (Optional) Use an existing persistent session instead of creating an ephemeral connection.
Protocol negotiation
When the inspector connects to a target server as a client, it speaks the MCP protocol. The protocol has two eras: the legacy 2025-era initialize handshake, and the newer modern (stateless) revision (2026-07-28 and later). The negotiation parameter controls which era the inspector asks for:
"legacy"(default): the SDK default. Perform the traditionalinitializehandshake. Maximum compatibility; works with every server."auto": probe the server to find out whether it speaks the modern stateless protocol, falling back to legacy. Use this to verify that a server actually serves modern clients.a pinned revision string (e.g.
"2026-07-28"): request a specific protocol revision.
Why this matters: a server that supports both eras will always answer as legacy when the client does not ask for anything else. Without negotiation: "auto" (or a pinned modern revision) you cannot tell, from a successful connection, whether a target server really supports the modern protocol. It simply negotiated down to legacy. This is the single most useful signal the inspector can return about a server during the SDK migration.
insp_connect and insp_list_sessions report the outcome per session. In the insp_connect response look for protocol_version (the negotiated MCP revision, e.g. 2025-11-25 or 2026-07-28) and era (legacy or modern); insp_list_sessions carries the same two values on each session in its listing.
Note on the inspector itself. The inspector is a tier-1 server: ported to the v2 SDK packages, it serves clients of both protocol eras, but it is not discoverable as a modern server. It does not implement
server/discover(the call returns-32601 method not found) orsubscriptions/listen. Thenegotiationparameter only governs how the inspector behaves as a client toward other servers.
Session Workflow
For debugging stateful server behavior, use persistent sessions:
1. insp_connect → returns session_id
2. insp_tools_list (with session_id) → uses persistent connection
3. insp_tools_call (with session_id) → state is preserved
4. insp_read_events (with session_id) → see notifications
5. insp_disconnect (with session_id) → cleanupSessions 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
┌─────────────┐ MCP calls ┌─────────────────┐ forwards ┌─────────────┐
│ LLM Agent │ ◄────────────────► │ MCP Inspector │ ◄──────────────► │ Target MCP │
│ (Antigravity) │ (v2.0) │ │ Server │
└─────────────┘ └────────┬────────┘ └─────────────┘
│
Events logged to
session EventBuffer
│
┌───────────────────────┼───────────────────────┐
│ │ │
▼ ▼ ▼
insp_read_events HTTP :9847/api mcp-steer CLI
(LLM reads events) (external access) (human injection)Viewing Activity
Via LLM: The agent can call insp_read_events to see what's happening:
{
"session_id": "sess_abc123",
"types": ["traffic_in", "traffic_out"],
"limit": 20
}Via HTTP: Query the steering API directly:
curl http://127.0.0.1:9847/api/sessionsSteering the Agent
Inject guidance messages that appear in the LLM's next tool response.
Using the CLI:
./bin/mcp-steer.mjs "Focus on testing the error handling paths"
./bin/mcp-steer.mjs --session sess_abc123 "Try calling with invalid params"Using HTTP:
curl -X POST http://127.0.0.1:9847/api/steer \
-H "Content-Type: application/json" \
-d '{"message": "Check the authentication flow next"}'Using the MCP tool:
{
"tool": "insp_inject_steering",
"arguments": {
"session_id": "sess_abc123",
"message": "Great progress! Now test edge cases."
}
}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):
{
"command": "node",
"args": ["/path/to/some-mcp-server/dist/server.js"]
}Create a persistent session:
{
"command": "node",
"args": ["/path/to/some-mcp-server/dist/server.js"]
}
// Returns: { "session_id": "sess_abc123", "server_info": {...} }Call a tool using a session:
{
"session_id": "sess_abc123",
"tool_name": "search",
"tool_args": { "query": "hello" }
}Architecture
├── src/
│ ├── server.ts # MCP server exposing inspector tools
│ ├── client.ts # Client wrapper (hybrid stateless/session mode)
│ ├── transport.ts # Transport factory (stdio, SSE, HTTP) + TracingWrapper
│ ├── session.ts # SessionRegistry with GC (30-min TTL)
│ └── events.ts # EventBuffer (ring buffer for notifications)
├── bin/
│ └── mcp-steer.mjs # CLI tool for human steering
└── vitest.config.ts # Unit test + coverage configWhy 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
Development
npm install # install dependencies
npm run build # compile TypeScript
npm run dev # watch mode
npm test # run unit tests
npm run test:cov # run tests with coverage
npm run lint # lint source files
npm run format # auto-format with Prettier
npm run typecheck # type-check without emittingChangelog
v3.0.0
mcp-cli moved to its own repository
Removed the
result_querytoolRemoved the
mcp-clibin
v2.2.0
Added the
negotiationconnection parameter for client-side protocol-era negotiation (legacy/auto/ pinned revision)insp_connectandinsp_list_sessionsnow report the negotiated protocol revision and era of each session
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
Available Tools
7 toolsinsp_prompts_getC
Get a specific prompt from an MCP server.
Inputs: prompt_name (required), command, args, url, +3 more.
insp_prompts_listC
List all prompts exposed by an MCP server.
Inputs: command, args, url, transport, +1 more.
insp_resources_listC
List all resources exposed by an MCP server.
Inputs: command, args, url, transport, +1 more.
insp_resources_readC
Read a specific resource from an MCP server.
Inputs: uri (required), command, args, url, +2 more.
insp_resources_templatesB
List resource templates exposed by an MCP server.
Inputs: command, args, url, transport, +1 more.
insp_tools_callC
Call a tool on an MCP server. Connects, calls the tool, and disconnects.
Inputs: tool_name (required), command, args, url, +3 more.
insp_tools_listC
List all tools exposed by an MCP server. Connects, lists tools, and disconnects.
Inputs: command, args, url, transport, +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
Every tool has a clearly distinct purpose targeting different MCP server components: prompts (get/list), resources (list/read/templates), and tools (list/call). There is no overlap or ambiguity in functionality, making it easy for an agent to select the correct tool.
All tools follow a consistent 'insp_[component]_[action]' pattern with snake_case, using clear verbs like get, list, read, call, and templates. This predictability enhances usability and reduces confusion.
With 7 tools, the server is well-scoped for inspecting MCP servers, covering prompts, resources, and tools comprehensively. Each tool earns its place without being excessive or insufficient for the domain.
The tool set provides complete coverage for inspecting MCP servers, including listing and accessing prompts, resources (with templates), and tools (with calling capability). There are no obvious gaps, ensuring agents can perform all necessary inspection tasks.
Related MCP Connectors
Inspect any remote MCP server: transport, protocol, tools, and side-effect hints. No tool calls.
Search and inspect source-pinned agent skills, plugins and tools through a free public MCP.
MCP server for your apps' tools and custom tools, plus hosted AI agents and approval-gated workflows
The Remote MCP server acts as a standardized bridge between LLM applications (like Claude, ChatGPT, and Cursor) and external services, enabling AI agents to access external tools and resources. Its primary capability is providing a centralized search tool to discover other MCP servers and their respective tools. Unlike local implementations, it runs remotely with OAuth authentication and permission controls for security.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceA dual-transport MCP server that exposes your API as tools to LLM clients, supporting both stdio transport for local clients like Claude Desktop and HTTP/SSE transport for remote clients like OpenAI's Responses API.-
- AlicenseNot gradedqualityDmaintenanceAn MCP server that publishes CLI tools on your machine for discoverability by LLMs7 npm1MIT
- AlicenseAqualityDmaintenanceEnables LLM agents to programmatically inspect, debug, and test other MCP servers by wrapping the MCP Inspector CLI. Supports listing and calling tools, reading resources, and testing prompts on both local and remote MCP servers.65 npmMIT
- AlicenseNot gradedqualityCmaintenanceThis MCP server is a zero-config CLI tool that lets developers tap into any stdio-based MCP server from their terminal, enabling them to list tools/resources/prompts, call tools with JSON arguments, and health-check servers without requiring a full AI client or browser setup.1MIT