Mirror of https://github.com/modelcontextprotocol/inspector — Visual testing tool for MCP servers
  • TypeScript 90.8%
  • JavaScript 8.8%
  • CSS 0.2%
  • HTML 0.2%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
cliffhall eff0368491 fix: address Copilot review round 2, and drop the asyncUtilTimeout raise
The inline finding was a real bug: main() never called the discovery check, so
the deny-by-default claim rested on test:scripts happening to run the same
comparison — a different command, which `npm run verify:test-timeouts` does not
invoke. `failures` is now seeded from it, and a probe config under clients/ was
observed to fail the guard.

Three suppressed findings, all correct. The afterEach in oauth-interactive
restated the shared hookTimeout and labelled it as a round trip, when it only
stops a server and unlinks a file; it now carries no budget. The file-lock
constants were named for the opposite of what they bound — 90s covers retries
running out against a holder that never yields, 60s covers the stale-lock
takeover that succeeds — so they are LOCK_RETRIES_EXHAUSTED_MS and
STALE_LOCK_TAKEOVER_MS. The browser-timeouts header said 15 budgets; it is 19.

Separately, and more importantly: the asyncUtilTimeout raise is reverted, on
measurement. Verifying round 2 turned up intermittent 15s timeouts across
unrelated unit files, so three arms of three full unit runs were taken in this
worktree at comparable load — unmodified v2/main 3/3 green, this change with
5000 producing 1, 4 and 0 timing-out files, and the same change with that one
line reverted 3/3 green. A wait that is MEANT to expire spends its whole budget
on the happy path, so a 5x raise is a 5x cost on exactly those tests and
saturates the worker pool, starving tests that were never slow.

Both web setup files therefore state asyncUtilTimeout at the library's own
value rather than raising it, which is what #2323's rule actually asks for: a
budget nobody chose is the defect, not a budget that is small. The tests that
assert absence by letting a wait expire are the real problem and are #2335.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PsmUAZ6aLUAFqenjJKSSRp
Signed-off-by: cliffhall <cliff@futurescale.com>
2026-09-12 11:49:30 -04:00
.claude fix: state every test-gate timeout instead of inheriting a library default 2026-09-12 08:32:34 -04:00
.github fix: address Copilot review round 1 on #2323 2026-09-12 10:46:28 -04:00
clients fix: address Copilot review round 2, and drop the asyncUtilTimeout raise 2026-09-12 11:49:30 -04:00
core Merge pull request #2326 from modelcontextprotocol/v2/fix/2305-cimd-loopback-http 2026-09-11 10:22:31 -04:00
docs fix: address Copilot review round 2, and drop the asyncUtilTimeout raise 2026-09-12 11:49:30 -04:00
scripts fix: address Copilot review round 2, and drop the asyncUtilTimeout raise 2026-09-12 11:49:30 -04:00
specification docs: make the local CIMD smoke deterministic, and fix two HTTPS-only claims 2026-09-11 03:32:02 -04:00
test-servers fix: address Copilot review round 1 on #2306 2026-09-10 22:49:36 -04:00
.dockerignore review: harden the Docker image + align GHCR action versions 2026-07-11 09:43:04 -04:00
.gitattributes fix: add eol=lf policy to .gitattributes so Windows checkouts stay clean 2026-08-12 08:56:24 -07:00
.gitignore chore: extract AGENTS.md recipes into agent skills 2026-08-29 00:36:37 -04:00
.mcp.json ci: restore the Claude Code workflow and .mcp.json, lost in the v2 tree swap (#1869) 2026-07-31 23:03:14 -04:00
.npmignore feat: port CLI, TUI, and launcher from v1.5 into v2 (#1452) 2026-06-14 20:27:49 -04:00
AGENTS.md fix: address Copilot review round 2, and drop the asyncUtilTimeout raise 2026-09-12 11:49:30 -04:00
CLAUDE.md chore: extract AGENTS.md recipes into agent skills 2026-08-29 00:36:37 -04:00
CODE_OF_CONDUCT.md chore: restore repo files dropped by the v2 tree swap (#1871) 2026-07-31 23:03:24 -04:00
CONTRIBUTING.md docs: replace the markdown bug template with GitHub issue forms (#1894) 2026-08-01 19:50:49 -04:00
Dockerfile fix(web): move the app origin off 6276, bound the publish route 2026-08-24 08:45:40 -04:00
eslint.config.js chore: address Copilot review round 1 (#2192) 2026-08-29 23:50:18 -04:00
package-lock.json chore: bump the vitest trio to 4.1.11 past GHSA-82fw-gwwq-j7x9 2026-09-10 22:39:42 -04:00
package.json fix: state every test-gate timeout instead of inheriting a library default 2026-09-12 08:32:34 -04:00
README.md docs: add a reusable CLI smoke-testing guide for v2 (#1886) 2026-09-06 13:01:09 -04:00
SECURITY.md docs: replace the markdown bug template with GitHub issue forms (#1894) 2026-08-01 19:50:49 -04:00
tsconfig.base.json Auth hardening CI gaps + SDK consolidation: EMA leg 2 / scopes (#1527) (#1725) 2026-07-19 22:36:21 -04:00
tsconfig.lint.json fix: address round-2 review — stale disconnect, lint-project gap, coverage 2026-08-16 21:52:43 -04:00
vitest.shared.mts fix: state every test-gate timeout instead of inheriting a library default 2026-09-12 08:32:34 -04:00

MCP Inspector

A developer tool for inspecting Model Context Protocol (MCP) servers. It ships as a single package, @modelcontextprotocol/inspector, that provides three 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.

All three run through one global mcp-inspector binary:

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

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)

v2 is not an npm workspace — each client under clients/* keeps its own package.json and node_modules, and shared code lives in core/, consumed via a @inspector/core build-time alias. Every runtime dependency core/ imports is declared once, in the repo-root package.json, and each client declares only what that client alone consumes — its UI stack, its bundler-inlined packages, its dev tooling — which leaves clients/cli and clients/launcher with no runtime dependencies of their own. What that means for adding a dependency (root vs. client, dependencies vs. devDependencies, and the bundler external lists) is in the local-dev skill.

Project layout

inspector/
├── clients/
│   ├── web/          Web client (Vite + React + Mantine). src/ = browser app; server/ = Node backend
│   ├── cli/          CLI client (tsup bundle, @inspector/core alias)
│   ├── tui/          TUI client (Ink + React, tsup bundle)
│   └── launcher/     Shared launcher — provides the `mcp-inspector` bin, dispatches to web/cli/tui
├── core/             Shared code consumed via the `@inspector/core` alias (no package.json)
├── test-servers/     Composable MCP test servers + fixtures used by integration and smoke tests
├── scripts/          Root build/verify tooling (install cascade, smokes, the verify:* guards)
│                     and repo automation run from CI (the dependency, Dependabot-alert and SDK sweeps)
├── docs/             Task-oriented guides — see below
├── specification/    Design/build specifications
├── .claude/skills/   Agent skills: the repo's procedures, invokable by name
├── AGENTS.md         Contribution rules for agents AND humans
└── README.md         You are here

Each client has its own README with client-specific detail: web · cli · tui · launcher.

Documentation

Guide Covers
Architecture The @inspector/core shared package, and the web client's "dumb components" + Storybook approach
Testing and the quality gate What each validate / coverage / smoke / verify:* script covers, the GitHub-CI-vs-local-gate split, and the supported browsers
Writing a skill How to write a skill description that actually fires, and eval cases that measure it — the case shapes that work, and the tuning loop
Test servers The composable test servers and the showcase config for every feature — what to run, what to click, and what the broken build did
Publishing What ships in the tarball, the packaging invariants, and pack:verify
Docker Running the container image — ports, volumes, and where secrets go
Migrating from v1 to v2 CLI flag mapping, --config vs. --catalog, the Node engine bump, env-var renames
MCP server configuration Which server(s) the Inspector connects to, and the config file format
Reviewing an MCP App The CLI-first → one-shot-web recipe for automated App-tool review
Smoke-testing an MCP server The connect → list → call → assert workflow for a shell or CI job: --format json + jq, the exit-code map, and keeping OAuth non-interactive
Launcher and config consolidation Why the launcher runs a client in-process rather than spawning it

Testing and the quality gate

Each client self-validates from its own folder; the root scripts chain them. There is no aggregate root test script.

npm run validate     # fast inner loop: format:check + lint + typecheck + build + unit tests
npm run coverage     # the per-file ≥90% gate (lines/statements/functions/branches)
npm run local:gate   # MANDATORY before pushing — a strict superset of GitHub CI

npm run local:gate chains every check below, plus the smokes and the Storybook tests. Testing and the quality gate owns the stage list and says what each one covers and why two are local-only; AGENTS.md holds the testing rules themselves.

Contributing — AGENTS.md, CLAUDE.md, and the skills

AGENTS.md is the contract for changing this codebase, and it applies to humans and AI agents alike. It is not agent-only boilerplate — it holds the project's real rules: the version/label conventions, the TypeScript and Mantine/React standards, the testing and coverage requirements, and the mandatory pre-push gate. Read it before making changes, and keep it up to date when you change structure, tooling, or rules.

The repo's procedures — multi-step recipes with commands and live IDs — live in .claude/skills/ instead, one directory per procedure, so they are loaded only when the task calls for them. They are ordinary committed Markdown: an agent that doesn't understand skills can read them, and AGENTS.md carries an index of what exists. Claude Code users invoke one by name (/release, /issue-triage, …).

CLAUDE.md is the entry point Claude Code loads automatically; it includes AGENTS.md, so agents and humans work from the same source of truth. If you use a different agent that reads AGENTS.md, you get the same rules.

A key rule worth surfacing here: all work is issue-driven. Before starting, find or create a tracking issue on the v2 project board; open PRs against v2/main with Closes #<issue>. External contributions are accepted as issues, not pull requests — see CONTRIBUTING.md.

License

MIT.