CLI (v2.13.0): server command placed after `--tool-arg` flags fails with "Invalid parameter format: node" — make positional parsing order-tolerant or fix the error message

Abierto
#2,860 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
65/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
node.js, typescript
Área
cli

Línea de trabajo

Start by running the two inspector --cli reproductions in the issue to confirm the difference in argument order, then trace the CLI argument parsing entry point. Done means either the command-last form works or, if ordering is intentionally strict, the error clearly explains the required position of the server command.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Environment
  • @modelcontextprotocol/inspector 2.13.0, CLI mode (--cli)
  • Linux (WSL2), Node v26.12.1; reproduced 2026-10-30 against a local stdio MCP server
Problem

With --tool-arg present, the server command must precede the flags. Placing it after the options — a common CLI convention — fails with Invalid parameter format: node: the first token of the server command is apparently consumed as a parameter value.

Minimal repro (works — command first, per our docs)
inspector --cli node dist/server.mjs --format json --method tools/call \
  --tool-name code-search --tool-arg action=dirs --tool-arg project=web-fms \
  --tool-arg path=src --tool-arg depth=1
# ✓ exit 0, JSON result
Minimal repro (fails — command last)
inspector --cli --format json --method tools/call \
  --tool-name code-search --tool-arg action=dirs node dist/server.mjs
# ✗ Invalid parameter format: node
Expected
  1. Order tolerance: treat the first non-flag token(s) as the server command regardless of position; or
  2. If strict ordering is intended, the error should say so, e.g. "Server command must be the first positional argument, before options such as --tool-arg" — Invalid parameter format: node reads like a data-format error in the tool arguments and misdirects debugging.
Notes
  • Searched issues for "Invalid parameter format" and "--tool-arg"; no existing match found for command-position parsing (#2859 covers value rewriting, not placement).
  • Any generated script that appends the server command last hits this.
Lenguaje dominante
TypeScript
Estrellas
11.2k
Forks
1.6k
Merge medio
4 h 49 min
PR fusionados (30 d)
139

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de modelcontextprotocol/inspector

Todos los issues de modelcontextprotocol/inspector

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.