Skip to content

feat: port CLI, TUI, and launcher from v1.5 into v2#1451

Closed
BobDickinson wants to merge 2 commits into
modelcontextprotocol:v2/mainfrom
BobDickinson:v2-cli-tui
Closed

feat: port CLI, TUI, and launcher from v1.5 into v2#1451
BobDickinson wants to merge 2 commits into
modelcontextprotocol:v2/mainfrom
BobDickinson:v2-cli-tui

Conversation

@BobDickinson

Copy link
Copy Markdown
Contributor

Summary

Ports the CLI, TUI, and launcher from v1.5 into v2 with the smallest practical blast radius. The goal is to get all three clients building, testable, and invocable from a single mcp-inspector entrypoint — not to fully “v2-ify” them yet.

This is the “drag the rest of the clients kicking and screaming into v2” PR. Follow-ups will tackle deeper v2 integration (catalog UX, CI hardening, TUI parity, session-oriented CLI, etc.).

Closes #1246.

What changed

New clients (ported from v1.5)

  • clients/cli/ — one-shot CLI (runCli), 86 ported integration tests
  • clients/tui/ — Ink TUI (runTui), minimal smoke tests
  • clients/launcher/ — mode router (--web / --cli / --tui; default web), argv forwarding

Packaging & build

  • Root @modelcontextprotocol/inspector becomes a fat npm package: merged runtime deps, prepack → full build, mcp-inspector bin
  • tsup bundles @inspector/core into CLI/TUI/web-runner build/index.js (core is source-only in v2, not a separate published package)
  • Launcher dynamically imports sibling clients/{web,cli,tui}/build/index.js — no file: workspace deps

Web changes (required for launcher)

  • runWeb(argv) — programmatic web entry for mcp-inspector --web / --web --dev
  • tsup.runner.config.ts + clients/web/build/index.js — Node runner separate from Vite SPA build
  • web-server-config.ts — shared config builder for dev plugin, prod Hono, and launcher

Config / catalog (minimal)

  • withDefaultConfigPath() in core/mcp/node/config.ts — CLI and TUI fall back to ~/.mcp-inspector/mcp.json when no --config and no ad-hoc target
  • TUI uses mcpConfigToServerEntries() (correct v2 settings path); CLI still uses bare MCPServerConfig from file (known gap)

Infra & docs

  • vitest.shared.mts — shared @inspector/core / test-server aliases for CLI/TUI Vitest
  • CI — CLI + TUI tests, launcher --help smoke, Storybook (existing web pipeline unchanged in spirit)
  • specification/v2_cli_tui_launcher.md — architecture spec for this port
  • specification/v2_catalog_launch_config.md — catalog/launch design (mostly future work; cross-linked)

What we intentionally did not solve

Area Status
--catalog / servers/import Not implemented — web still uses default catalog only (#1348)
Web catalog switching via launcher runWeb --config sets legacy initialMcpConfig only; no mcpConfigPath on backend
CLI config-file settings Disk headers/timeouts/OAuth not lifted into serverSettings (TUI does lift them)
runWeb --header Accepted but warns only
Session-oriented CLI v2 Still one-shot per invocation (#1432)
TUI feature/test parity 2 smoke tests; no Ink/OAuth/catalog-CRUD coverage (#1183)
CLI/TUI coverage gates Core coverage stays on web suite; CLI runs out-of-process
Root validate Still web-only; does not chain CLI/TUI build+test
Prod web via launcher Requires pre-built clients/web/dist/ (CI builds web; launcher smoke does not start prod web end-to-end)

Test plan

  • npm run test:coverage (web unit + integration)
  • npm run test:cli (CLI tests)
  • npm run test:tui (TUI tests)
  • npm run test:storybook (Storybook play tests)
  • Launcher smoke: --help, --cli --help, --tui --help
  • npm run build (web + cli + tui + launcher)
  • Manual: mcp-inspector --cli node … --method tools/list
  • Manual: mcp-inspector --tui with default ~/.mcp-inspector/mcp.json
  • Manual: mcp-inspector --web --dev

Docs

  • Primary spec: specification/v2_cli_tui_launcher.md
  • Catalog/launch (deferred): specification/v2_catalog_launch_config.md
  • Updated: AGENTS.md (project structure, test commands)

@BobDickinson BobDickinson added the v2 Issues and PRs for v2 label Jun 10, 2026
@BobDickinson

Copy link
Copy Markdown
Contributor Author

Replaced with same repo PR #1452

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v2 Issues and PRs for v2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant