MI

modelcontextprotocol/inspector

开发工具官方

本页由 AI 翻译,技术细节请以原文为准。 查看原文

1.1万 stars 1555 forks 质量 69 趋势 61NOASSERTION

MCP服务器的可视化测试工具

概览

MCP 检查器是一款用于测试和调试 MCP 服务器的开发工具。 MCP检查器由两个主要组件组成,协同工作: - : 基于 React 的 Web UI,提供交互式界面用于测试和调试 MCP 服务器- : 一个Node.js服务器,作为协议桥接,通过多种传输方式(stdio、SSE、Streamable-http)将网页界面与 MCP 服务器连接 请注意,代理不是用于拦截流量的网络代理。相反,它既作为MCP客户端(连接您的MCP服务器)又作为HTTP服务器(服务网页UI),使使用不同传输协议的MCP服务器能够基于浏览器进行交互。 要立即启动用户界面,只需执行以下操作: 服务器将启动,界面将在[[T0]处访问。 你也可以用以下命令在 Docker 容器中启动它: 要检查MCP服务器实现,无需克隆这个仓库。

概述(AI 翻译)

一个用于检查模型上下文协议(MCP)服务器的开发工具。它以一个包形式发布,名为@modelcontextprotocol/inspector,提供四种检测服务器的方法:

  • Web — 一个带有Node后端的Vite + React + Mantine单页应用。
  • CLI — 可脚本化的命令行客户端,用于自动化、配置配置和快速代理反馈循环。
  • TUI — 一个用Ink构建的交互式终端界面。
  • mcpdo (experimental) — 连接CLI:连接一次,然后通过隐式本地守护进程对命名连接执行多项命令。参见clients/mcpdo。

前三个通过一个全局 mcp-inspector 二进制;mcpdo 是同一封装中的第二个二进制:

[!警告] 检查器管理秘密——OAuth 令牌、OAuth 客户端秘密和 stdio env: 值——并默认将它们存储在操作系统密钥链中。 在没有密钥链的机器上——Linux 无 libsecret 或 Secret Service、无头和 SSH 会话、Termux 以及带有挂载卷的容器——它们会保存到 ~/.mcp-inspector/secrets.json,除非你提供密钥,否则未加密。

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

MCP Inspector

A developer tool for inspecting Model Context Protocol (MCP) servers. It ships as a single package, @modelcontextprotocol/inspector, that provides four ways to inspect a server:

  • Web — a Vite + React + Mantine single-page app with a Node backend.
  • CLI — a scriptable command-line client for automation, CI, and fast agent feedback loops.
  • TUI — an interactive terminal UI built with Ink.
  • mcpdo (experimental) — a connection CLI: connect once, then run many commands against the named connection through an implicit local daemon. See clients/mcpdo.

The first three run through one global mcp-inspector binary; mcpdo is a second binary in the same package:

npx @modelcontextprotocol/inspector                   # web UI (default)
npx @modelcontextprotocol/inspector --cli             # CLI
npx @modelcontextprotocol/inspector --tui             # TUI
npx -p @modelcontextprotocol/inspector mcpdo --help   # mcpdo

[!WARNING] The Inspector manages secrets — OAuth tokens, OAuth client secrets, and stdio env: values — and stores them in the OS keychain, if available, by default. On a machine with no keychain — Linux without libsecret or a Secret Service, headless and SSH sessions, Termux, and containers with a mounted volume — they are saved to ~/.mcp-inspector/secrets.json instead, unencrypted unless you supply a key. See Where secrets are stored for how to get a keychain back, encrypt the file, or keep secrets in memory only.

Upgrading from v1? Read the v1 → v2 migration guide — CLI flags, the new --config vs. --catalog split, the Node engine bump, and what no longer ships.

Repo status. This is the v2 line of the Inspector. Active development happens on v2/main (the develop branch — all v2 PRs target it), which is merged into main at milestone releases; main is the default branch and holds the latest released v2, published to the npm latest tag. The legacy v1 line lives on v1/main — security fixes only, published straight from that branch to the npm v1-latest tag (npx @modelcontextprotocol/inspector@v1-latest). See AGENTS.md for branch/board conventions.

Quick start (development)

Requires Node >=22.19.0.

npm install          # at the repo root; postinstall cascades into every client
npm run build        # web → cli → tui → launcher

For day-to-day web iteration, run Vite directly — fast HMR, no launcher build needed:

cd clients/web && npm run dev

The launcher-driven scripts run the built launcher, so build first:

npm run web        # prod web launcher against clients/web/dist
npm run web:dev    # web launcher in --dev mode (Vite)
在 GitHub 查看完整 README

安装

npx @modelcontextprotocol/inspector # web UI (default)
新手?先看 mcpskill.org 教程 →