Repository navigation
Description
Found while working #1910.
Problem
A per-server metadata entry in mcp.json is the "default _meta merged into every outgoing request" for that server. The web client and the TUI both honor it — each reads savedSettings.metadata and passes it as InspectorClientOptions.defaultMetadata (clients/web/src/App.tsx, clients/tui/src/App.tsx).
The CLI does not. buildInspectorClientOptions in clients/cli/src/cli.ts (~line 149) passes serverSettings, roots, and versionNegotiation, but never defaultMetadata. InspectorClient only reads the option — it does not fall back to serverSettings.metadata — so the field is silently inert for --cli runs.
Reproduce
- Add a server to
mcp.jsonwith ametadataentry:"my-server": { "type": "http", "url": "https://example.test/mcp", "metadata": { "tenant": "acme" } }
mcp-inspector --cli --catalog <that file> --server my-server --method tools/list- Inspect the outgoing request: no
_meta.tenant.
Connect to the same server in --web or --tui and the key is present.
Expected
All three clients apply the same persisted per-server setting. The CLI should pass defaultMetadata the way it already passes roots — and for the same stated reason, that the setting belongs to the server rather than to the client that happens to read it.
Note --metadata is not a workaround: it is per-invocation, so every command has to restate what the catalog already records.
Notes
- This is orthogonal to Make complex _meta possible #1910 (which widens
_metavalues from strings to any JSON). Make complex _meta possible #1910 leaves this untouched deliberately: fixing it makes the CLI start sending metadata it never sent before, which is a behavior change worth its own review rather than a rider on a typing change. - Likely one line beside the existing
roots:inbuildInspectorClientOptions, plus a test asserting the key reaches the wire on a catalog-driven--clirun.
Activity
docs: note that the CLI does not yet apply catalog metadata
fix(cli): apply a server's persisted mcp.json metadata