/ 目录 / 演练场 / MCP Inspector
● 官方 modelcontextprotocol ⚡ 即开即用

MCP Inspector

作者 modelcontextprotocol · modelcontextprotocol/inspector

The official debugger for MCP servers — connect to any server, call its tools live, see the raw protocol traffic.

MCP Inspector is the canonical dev tool for MCP. Point it at a server (local or remote), enumerate tools and resources, fire calls with structured inputs, and watch frames go by. First thing to reach for when your server misbehaves.

为什么要用

核心特性

实时演示

实际使用效果

就绪

安装

选择你的客户端

~/Library/Application Support/Claude/claude_desktop_config.json  · Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "mcp-inspector": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/inspector"
      ]
    }
  }
}

打开 Claude Desktop → Settings → Developer → Edit Config。保存后重启应用。

~/.cursor/mcp.json · .cursor/mcp.json
{
  "mcpServers": {
    "mcp-inspector": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/inspector"
      ]
    }
  }
}

Cursor 使用与 Claude Desktop 相同的 mcpServers 格式。项目级配置优先于全局。

VS Code → Cline → MCP Servers → Edit
{
  "mcpServers": {
    "mcp-inspector": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/inspector"
      ]
    }
  }
}

点击 Cline 侧栏中的 MCP Servers 图标,然后选 "Edit Configuration"。

~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "mcp-inspector": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/inspector"
      ]
    }
  }
}

格式与 Claude Desktop 相同。重启 Windsurf 生效。

~/.continue/config.json
{
  "mcpServers": [
    {
      "name": "mcp-inspector",
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/inspector"
      ]
    }
  ]
}

Continue 使用服务器对象数组,而非映射。

~/.config/zed/settings.json
{
  "context_servers": {
    "mcp-inspector": {
      "command": {
        "path": "npx",
        "args": [
          "-y",
          "@modelcontextprotocol/inspector"
        ]
      }
    }
  }
}

加入 context_servers。Zed 保存后热重载。

claude mcp add mcp-inspector -- npx -y @modelcontextprotocol/inspector

一行命令搞定。用 claude mcp list 验证,claude mcp remove 卸载。

使用场景

实战用法: MCP Inspector

Debug your MCP server without involving an LLM

👤 Developers ⏱ ~15 min intermediate

何时使用: Claude says 'tool failed' and you need to see what really happened.

步骤
  1. Launch
    npx @modelcontextprotocol/inspector ./my-server.✓ 已复制
    → UI opens
  2. Invoke
    Pick the tool; fill inputs; send.✓ 已复制
    → Result + frames shown
  3. Diagnose
    Toggle raw frames to see protocol-level errors.✓ 已复制
    → Root cause clear

结果: Server bug isolated without LLM noise.

组合

与其他 MCP 搭配,撬动十倍杠杆

mcp-inspector + fastmcp-prefect

Build a FastMCP server; debug it with the Inspector before shipping

Combine mcp-inspector with fastmcp-prefect: Build a FastMCP server; debug it with the Inspector before shipping✓ 已复制

工具

此 MCP 暴露的能力

工具输入参数何时调用成本
tools.call (see docs) Invoke any tool the server advertises 1 call
resources.list (see docs) Browse resources 1 call

成本与限制

运行它的成本

API 配额
N/A
每次调用 Token 数
N/A
费用
Free OSS
提示
Save common invocations as bookmarks

安全

权限、密钥、影响范围

凭据存储: Local only
数据出站: Whatever the server reaches
切勿授予: Run untrusted MCP servers against your auth tokens

故障排查

常见错误与修复

Server won't connect

Check transport (stdio vs SSE); confirm the binary path

替代方案

MCP Inspector 对比其他方案

替代方案何时用它替代权衡
mcp2cliYou prefer command-lineNo GUI for protocol inspection

更多

资源

📖 阅读 GitHub 上的官方 README

🐙 查看未解决的 issue

🔍 浏览全部 400+ MCP 服务器和 Skills