feat: port CLI, TUI, and launcher from v1.5 into v2#1452
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
|
@claude review |
|
Claude finished @cliffhall's task in 3m 47s —— View job Review — PR #1452: port CLI, TUI, launcher from v1.5 into v2I read the diff against Correctness1. Default-config fallback is baked into shared 2. Dead try/catch in TUI entry ( try {
callbackUrlConfig = parseCallbackUrl(options.callbackUrl);
} catch (err) {
if (err instanceof Error) throw err;
throw err; // both branches rethrow — the catch does nothing
}The Minor / nits3. Launcher strips all occurrences of the mode flag ( 4. CI launcher smoke depends on an implicit build ( 5. 6. Acknowledged gaps (no action needed)The PR body already tracks these — TUI has only 2 smoke tests (#1183), CLI config-file settings aren't lifted into None of the above are blocking on their own; #1 and #2 are the two I'd recommend addressing in this PR. |
Keep resolveServerConfigs as an explicit-options resolver; CLI uses the launch wrapper so catalog defaults apply only at entry points, not for all callers. Web still resolves explicit server args only today; a follow-up can wire it through the same launch helper when catalog/session argv is unified.
Read --web/--cli/--tui only from a contiguous prefix after the script name; forward all following tokens unchanged so homonyms can appear in app/server args. Reject multiple mode flags in the prefix; do not strip or warn on later matches.
…t Vite deps Build CLI before launcher smoke so the step does not rely on test pretest ordering. Align tsup targets with engines.node (>=22.7.5). Document why Vite stays in published runtime dependencies for mcp-inspector --web --dev.
|
Addressed all PR review comments from Claude. The "vite + @vitejs/plugin-react as production dependencies" was as intended, docs updated to reflect that. |
|
@claude review |
|
Claude finished @cliffhall's task in 1m 12s —— View job Re-review — PR #1452I re-read the diff against Previously-flagged items — all addressed ✅1. Default-config fallback coupling — Resolved correctly. 2. Dead try/catch in TUI entry — Removed. 3. Launcher strips all occurrences of the mode flag — Reworked into a much safer prefix-zone parser ( 4. CI launcher smoke depends on implicit build — Fixed. The workflow now has an explicit The One minor non-blocking nitRedundant Acknowledged gaps (no action needed)Same as before and still reasonable for a "get it building and invokable" port — TUI smoke-only tests (#1183), CLI config-file settings not lifted into LGTM. 🚀 |
Default catalog is already applied via withDefaultConfigPath above; the ad-hoc branch only needs the resolver, not resolveLaunchServerConfigs's redundant pass.
|
Addressed remaining issue: |
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-inspectorentrypoint — 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 testsclients/tui/— Ink TUI (runTui), minimal smoke testsclients/launcher/— mode router (--web/--cli/--tui; default web), argv forwardingPackaging & build
@modelcontextprotocol/inspectorbecomes a fat npm package: merged runtime deps,prepack→ full build,mcp-inspectorbintsupbundles@inspector/coreinto CLI/TUI/web-runnerbuild/index.js(core is source-only in v2, not a separate published package)clients/{web,cli,tui}/build/index.js— nofile:workspace depsWeb changes (required for launcher)
runWeb(argv)— programmatic web entry formcp-inspector --web/--web --devtsup.runner.config.ts+clients/web/build/index.js— Node runner separate from Vite SPA buildweb-server-config.ts— shared config builder for dev plugin, prod Hono, and launcherConfig / catalog (minimal)
withDefaultConfigPath()incore/mcp/node/config.ts— CLI and TUI fall back to~/.mcp-inspector/mcp.jsonwhen no--configand no ad-hoc targetmcpConfigToServerEntries()(correct v2 settings path); CLI still uses bareMCPServerConfigfrom file (known gap)Infra & docs
vitest.shared.mts— shared@inspector/core/ test-server aliases for CLI/TUI Vitest--helpsmoke, Storybook (existing web pipeline unchanged in spirit)specification/v2_cli_tui_launcher.md— architecture spec for this portspecification/v2_catalog_launch_config.md— catalog/launch design (mostly future work; cross-linked)What we intentionally did not solve
--catalog/servers/importrunWeb --configsets legacyinitialMcpConfigonly; nomcpConfigPathon backendheaders/timeouts/OAuth not lifted intoserverSettings(TUI does lift them)runWeb --headervalidateclients/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)--help,--cli --help,--tui --helpnpm run build(web + cli + tui + launcher)mcp-inspector --cli node … --method tools/listmcp-inspector --tuiwith default~/.mcp-inspector/mcp.jsonmcp-inspector --web --devDocs
specification/v2_cli_tui_launcher.mdspecification/v2_catalog_launch_config.mdAGENTS.md(project structure, test commands)