docs: qualify the ad-hoc rule and fix the contradicting -- guidance
- 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
This commit is contained in:
parent
908284d046
commit
8c9cf40211
2 changed files with 8 additions and 2 deletions
|
|
@ -99,7 +99,13 @@ They differ on **when you need it**, though. Web sets `allowUnknownOption()` + `
|
|||
mcp-inspector --cli node build/index.js -- --method tools/list
|
||||
```
|
||||
|
||||
So under `--cli` the separator does **not** protect an argument from the Inspector — it does the opposite, and the web example above would have `--config /etc/myserver.conf` consumed as a read-only-session flag (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.
|
||||
So under `--cli` the separator does **not** protect an argument from the Inspector — it does the opposite, and the web example above, run verbatim, would have `--config /etc/myserver.conf` consumed as a read-only-session flag (then rejected as a catalog/ad-hoc conflict). Leading-dash arguments for the server still get through; they just go on the other side of the separator, where the whole pre-`--` run is taken as the target verbatim:
|
||||
|
||||
```bash
|
||||
mcp-inspector --cli node build/index.js --config /etc/myserver.conf --verbose -- --method tools/list
|
||||
```
|
||||
|
||||
Without a `--` on the line the target is only the leading run of **non-dash** tokens, so the separator is required whenever the server itself takes flags.
|
||||
|
||||
## The shared flags
|
||||
|
||||
|
|
|
|||
|
|
@ -128,7 +128,7 @@ npx @modelcontextprotocol/inspector --catalog ./mcp.json
|
|||
npx @modelcontextprotocol/inspector
|
||||
```
|
||||
|
||||
**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.
|
||||
**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. One exception: the **web** client exempts `--transport stdio` from that check, so it survives alongside `--catalog`/`--config` (ignored rather than rejected) — the CLI and TUI reject every `--transport`.
|
||||
|
||||
If you export `MCP_CATALOG_PATH` in your shell, note that **web and TUI read it unconditionally** — so an ad-hoc invocation such as `mcp-inspector --tui node build/index.js` is rejected as a catalog/ad-hoc conflict. Unset it for that invocation. The CLI ignores the variable whenever an ad-hoc target is present.
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue