docs: add the v1 → v2 migration guide - #1960
Conversation
Closes #1822 Adds docs/v1-to-v2-migration.md — the map for users arriving from v1: - CLI flag mapping (every v1 flag survives; lists what v2 adds) - `--config` vs `--catalog` semantics with before/after examples - Node engine bump (>=22.7.5 → >=22.19.0) - what no longer ships (the three sub-packages; v2 is one tarball) - the three behavior changes most likely to bite: exit code 5 on a failing tool call, target-must-come-first under --cli, and the reversed `--` separator - env-var mapping (MCP_PROXY_AUTH_TOKEN → MCP_INSPECTOR_API_TOKEN, MCP_PROXY_FULL_ADDRESS removed, SERVER_PORT repurposed), the v1 UI config settings, web query params, and Docker Linked from the root README (banner + docs list), the CLI README, and docs/mcp-server-configuration.md; AGENTS.md's docs/ tree entry updated. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SW1p8E2uiyyLx4RKwrwSrt
There was a problem hiding this comment.
Pull request overview
Adds a v1-to-v2 migration guide and links it from relevant documentation.
Changes:
- Documents CLI, configuration, environment, architecture, and Docker migration.
- Adds migration-guide links across entry-point docs.
- Updates project documentation listings.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
docs/v1-to-v2-migration.md |
Adds the migration guide. |
README.md |
Promotes and lists the guide. |
clients/cli/README.md |
Links v1 CLI users to it. |
docs/mcp-server-configuration.md |
Adds a related-guide link. |
AGENTS.md |
Adds the guide to the project tree. |
Suppressed comments (1)
docs/v1-to-v2-migration.md:297
- This one-port Docker recipe cannot support MCP Apps: the sandbox listener is dynamic inside the container and is not reachable through the sole
6274mapping. Pin and publishMCP_SANDBOX_PORTin the migration example, or explicitly label the recipe as excluding the Apps tab.
# v2 — one port; the image already sets the wildcard-bind opt-in
docker run --rm -p 6274:6274 ghcr.io/modelcontextprotocol/inspector:latest
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
- Sandbox port: the Apps tab needs a second, dynamic listener, so "no second port" was wrong for Docker/remote deployments. Qualify the architecture section, add a pinned-port Docker recipe, and add a troubleshooting entry. - Node floor: npm only warns EBADENGINE unless engine-strict is set, so npx does not refuse to run on an older Node. - v1 default list: the web UI persisted its list in localStorage; only the on-disk default catalog is new. - The v1→v2 --server example needs --cli (and a --method) to select an entry; note there is no one-entry web equivalent. - New behavior change #4: an ambiguous URL path (neither /mcp nor /sse) now errors instead of falling back to SSE. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SFXDQBEjvjCEBhmYkmw79a
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.
Suppressed comments (2)
docs/v1-to-v2-migration.md:237
- The CLI can pass leading-dash arguments to a stdio server: when
--is present,clients/cli/src/cli.ts:536-541treats every token before it astargetArgs, including flags. This statement incorrectly sends users to a catalog; show the reversed placement instead.
So the web example above, run under `--cli`, would have `--config /etc/myserver.conf` consumed as the Inspector's read-only-session flag (and then rejected as a catalog/ad-hoc conflict). There is currently no way to pass a leading-dash argument through to a stdio server on the `--cli` command line — put it in the server entry's `args` in a catalog or config file instead.
docs/v1-to-v2-migration.md:257
- The output is not byte-for-byte identical: v1 wrote
JSON.stringify(result, null, 2)without a terminator, while v2'semitResultappends"\n". Scripts comparing raw stdout should be told about the added trailing newline rather than calling it exact.
Stdout is otherwise compatible: the default `text` format still pretty-prints the result as `JSON.stringify(result, null, 2)`, exactly as v1 did.
- `--` under --cli: everything before the separator IS forwarded to the target, flags included (cli.ts:536-541), so "no way to pass a leading-dash argument" was wrong. Show the correct placement instead of sending users to a catalog file. - Stdout: v2's emitResult appends "\n" where v1's awaitableLog wrote the JSON with no terminator, so the output is not byte-identical. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SFXDQBEjvjCEBhmYkmw79a
|
Round 2: no new inline comments, but both suppressed comments were correct and are now fixed in
|
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.
Suppressed comments (2)
docs/v1-to-v2-migration.md:131
- This blanket rule has a documented web exception:
run-web.tsexcludes--transport stdiofrom its ad-hoc check, so web accepts and ignores it alongside--catalog/--config; only CLI/TUI reject every--transport. Qualify the rule so migrated web commands are not described as errors.
**Rules:** `--catalog` and `--config` are mutually exclusive, and neither combines with an ad-hoc target (a positional command, `--server-url`, or `--transport`). v1 silently preferred the config file; v2 tells you.
docs/v1-to-v2-migration.md:237
- This newly documented CLI behavior contradicts the page linked throughout this PR:
docs/mcp-server-configuration.md:102says there is currently no way to pass a leading-dash argument through and recommends putting it in the file. The parser does place every pre---token intargetArgs, so this guide is correct; update that existing section and example in the same PR so users do not receive opposite instructions.
So the web example above, run verbatim under `--cli`, would have `--config /etc/myserver.conf` consumed as the Inspector's read-only-session flag (and then rejected as a catalog/ad-hoc conflict). To pass a leading-dash argument through to a stdio server, put it **before** the `--` instead — everything on that side is forwarded to the target untouched, flags included:
- The "nothing combines with an ad-hoc target" rule has a web exception: run-web.ts:130 exempts `--transport stdio`, so web ignores it rather than rejecting. Only cli/tui reject every `--transport`. - mcp-server-configuration.md still said a leading-dash argument cannot reach a stdio server under --cli, the opposite of what the migration guide now says. The parser puts every pre-`--` token in targetArgs, so the guide is right; corrected the older section to match. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SFXDQBEjvjCEBhmYkmw79a
|
Round 3: no new inline comments; both suppressed comments were correct and are fixed in
|
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Suppressed comments (2)
docs/v1-to-v2-migration.md:336
- The MCP Apps example likewise publishes both the authenticated backend and sandbox port on all host interfaces. Keep both mappings loopback-only so following the migration guide does not expose the Inspector to the local network by default.
docker run --rm -p 6274:6274 -p 6280:6280 -e MCP_SANDBOX_PORT=6280 \
ghcr.io/modelcontextprotocol/inspector:latest
docs/v1-to-v2-migration.md:273
- The environment variable is not removed in v2:
web-server-config.tsstill falls back toMCP_PROXY_AUTH_TOKENwhenMCP_INSPECTOR_API_TOKENis unset, and this compatibility path has a dedicated test. Distinguish this deprecated fallback from the query parameter below, which really was replaced, so existing deployments know they continue to work while migrating.
| `MCP_PROXY_AUTH_TOKEN` | **`MCP_INSPECTOR_API_TOKEN`** | Renamed. Guards `/api/*` via `x-mcp-remote-auth: Bearer <token>`; the browser also receives it injected into `index.html`, so a bare reload keeps working |
…llback - The v1 recipe published on 127.0.0.1 and the v2 one silently dropped that. Docker's -p binds host interfaces independently of the container's HOST, and a no-Origin request skips the allow-list (core/mcp/remote/node/server.ts:241), so the token is the only guard on a process-spawning backend. Restore the loopback prefix on both recipes and say why. - MCP_PROXY_AUTH_TOKEN is not removed: web-server-config.ts:329 still falls back to it. Call it a deprecated fallback rather than a rename, and distinguish it from the query param, which has no fallback (App.tsx getAuthToken reads only the new name). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SFXDQBEjvjCEBhmYkmw79a
|
Round 4: one inline comment (answered on the thread) plus two suppressed ones — all three were correct, fixed in
One thing deliberately not changed here: the root |
Round 1 — response to the five inline comments (
|
Closes #1822
Adds
docs/v1-to-v2-migration.md— the guide the deprecation notice needed somewhere to point at. Docs only; no source changes.What it covers
--catalog,--cwd,--tool-args-json,--format,--app-info,--connect-timeout, and the OAuth/handoff flags v1 had no equivalent for.--configvs--catalog, with before/after examples. This is the section the issue called out: both versions have a--configflag, both take anmcpServersfile, and they don't mean the same thing. Also notes that a v1 file works unchanged (streamable-httpstill accepted, unknown fields like the exportednotecarried through) and that--servernow selects only under--cli.>=22.7.5→>=22.19.0, and where the floor comes from.-client/-server/-clisub-packages, frozen at 1.0.1 and deprecated; v2 is a single tarball.Plus the things that will otherwise read as "v2 broke my setup":
tools/callreturningisError: truenow exits5, where v1 exited0— CI&&chains that silently continued past failing calls will start failing--clithe target must come first, or it is silently dropped in favor of the catalog--separator is reversed under--clirelative to web/tuiMCP_PROXY_AUTH_TOKEN→MCP_INSPECTOR_API_TOKEN,MCP_PROXY_FULL_ADDRESSremoved, andSERVER_PORTrepurposed as the MCP Apps sandbox port fallbackrequestTimeout/connectionTimeout);MCP_REQUEST_MAX_TOTAL_TIMEOUThas no equivalentserverCommand/serverArgsare gone,autoConnectmust match the session tokenLinked from
docs/guide listclients/cli/README.md— a pointer for people arriving from the v1 CLIdocs/mcp-server-configuration.md— Related sectionAGENTS.md— thedocs/tree entryRemaining from the issue's checklist
The last task ("link it from the deprecation notice, the 2.0.0 release notes, and the docs site") is partly outside this branch and needs the file to exist on
mainfirst:v1/main— a separate,v1-labeled PR.Happy to open the
v1/mainfollow-up once this merges and the guide has a stable URL.Verification
Docs-only, so no code gate applies (markdown is not in the
format:checkglobs andverify-format-coverage's extension set is TS/JS only). Ranprettier --writeover the touched files, and verified every relative link and cross-doc anchor in the new guide resolves.🤖 Generated with Claude Code
https://claude.ai/code/session_01SW1p8E2uiyyLx4RKwrwSrt