CLI: warn when a misspelled Inspector flag after a stdio target is forwarded to the server (--tool-agr → "did you mean --tool-arg?")

Offen
#3,074 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
55/100
Issue-Typ
Feature
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
cli, node.js, typescript
Bereich
cli

Rechercherichtung

The payload names no source file, so start with the CLI argument parsing that forwards unknown -- tokens to the server argv, and with docs/cli-smoke-testing.md for the CI context. Add a check that compares each forwarded token against the Inspector's own option names by edit distance 1-2, and print one stderr warning. Done when the example command still exits 0 and prints the "did you mean --tool-arg?" line, and a test covers both a near-miss and an unrelated forwarded flag.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

enhancement v2
Which client?

CLI

The problem

A one-letter typo in an Inspector flag after a stdio target is silently forwarded to the server's argv, and the run still passes:

mcp-inspector --cli node server.mjs --method tools/call --tool-name echo --tool-agr a=1

Exit 0; the tool is called with {} and --tool-agr a=1 is appended to the server's arguments. Forwarding unknown flags is documented and intentional, but in CI (docs/cli-smoke-testing.md) this gives a green job that tested nothing. A tool with only optional arguments never reveals the mistake. Verified on 2.17.0 (main @ 2069a1a), Linux, Node v22.23.5.

Solution you have in mind (optional)

Keep forwarding as is, but when a forwarded token starts with -- and is within edit distance 1–2 of an Inspector option, print one stderr line:

warning: --tool-agr was passed to the server; did you mean --tool-arg?

Optionally add --strict-flags (or an env var) to make it a usage error for CI. The same check would help mcpdo's positional forwarding.

Alternatives or workarounds you have tried

Placing -- between the target and the Inspector options makes ordering explicit, but it doesn't catch typos: a misspelled option after -- is still unknown to the Inspector.

Already built it locally?

No response

Before you submit
  • I searched existing issues and this is not a duplicate.
  • This is a request for the Inspector itself, not for the MCP specification or an SDK.
Vorherrschende Sprache
TypeScript
Sterne
11.3k
Forks
1.6k
Ø Merge
2 Std. 28 Min.
Gemergte PRs (30 T.)
111

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus modelcontextprotocol/inspector

Alle Issues in modelcontextprotocol/inspector

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.