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

Ouverte
#3,074 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
3/5
Temps estimé
1-2 jours
Accessibilité débutants
55/100
Type d'issue
Fonctionnalité
Clarté
Clairement spécifiée
Activité
Active
Stack technique
cli, node.js, typescript
Domaine
cli

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

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.
Langage dominant
TypeScript
Étoiles
11.3k
Forks
1.6k
Merge moyen
2 h 28 min
PR mergées (30 j)
111

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de modelcontextprotocol/inspector

Toutes les issues de modelcontextprotocol/inspector

Issues similaires

Plus d'issues TypeScript

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.