CLI --tool-args-json silently sends 1e400 as null (round-trip guard missing; mcpdo rejects it)
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 78/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- cli, nodejs, typescript
- Área
- cli
Línea de trabajo
El error está en clients/cli/src/cli.ts, alrededor de las líneas 2256–2272, donde --tool-args-json se analiza con JSON.parse y solo se comprueba que sea un objeto. Compáralo con assertJsonRoundTrips en core/cli/handlers/run-method.ts (línea 43) y reutiliza esa comprobación sobre el objeto analizado. Está terminado cuando --tool-args-json '{"v":1e400}' sale con un código distinto de cero y un error antes de enviar cualquier frame, y hay una prueba de regresión junto al caso existente --tool-arg v=1e400.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Which version line?
v2 — current (@modelcontextprotocol/inspector@latest)
Which client?
CLI
Inspector version
2.17.0 (main @ 2069a1a, built from source)
Node version
v22.23.5
Operating system (and browser, for the web client)
Linux
Transport
stdio
MCP server under inspection
Minimal echo server (probe-echo.mjs), SDK 2.4.0:
import * as z from "zod/v4";
import { McpServer } from "@modelcontextprotocol/server";
import { StdioServerTransport } from "@modelcontextprotocol/server/stdio";
const server = new McpServer({ name: "probe-echo", version: "1.0.0" });
server.registerTool("echo_raw", { description: "Echo raw arguments", inputSchema: z.object({}).passthrough() },
async (args) => ({ content: [{ type: "text", text: JSON.stringify(args) }] }));
server.registerPrompt("echo_prompt", { description: "Echo", argsSchema: { a: z.string().optional(), b: z.string().optional() } },
async (args) => ({ messages: [{ role: "user", content: { type: "text", text: JSON.stringify(args) } }] }));
await server.connect(new StdioServerTransport());
Steps to reproduce
mcp-inspector --cli node probe-echo.mjs --method tools/call --tool-name echo_raw \
--tool-args-json '{"v":1e400}'
Expected behavior
Rejected before sending, as --tool-arg v=1e400 is (#1910) and as mcpdo's --tool-args-json is on the same commit:
$ mcpdo tools/call echo_raw --tool-args-json '{"v":1e400}'
{"error":{"code":"error","message":"Invalid --tool-args-json: Infinity has no JSON representation (it would silently reach the tool as null)."}}
Actual behavior
Exit 0; the tool receives null. The tools/call frame on the wire (stdin of the server):
{"method":"tools/call","params":{"name":"echo_raw","arguments":{"v":null}},"jsonrpc":"2.0","id":2}
Logs, errors, or screenshots
Cause: clients/cli/src/cli.ts (~2256–2272) JSON.parses --tool-args-json and only checks it is an object. The same guard already exists in core/cli/handlers/run-method.ts:43 (assertJsonRoundTrips, used for --input-responses), in clients/mcpdo/src/connection/parse-tool-args.ts:9, and via isSerializableJson for --tool-arg.
This was mentioned under "Related" in #2859; that fix (#2890) covered --prompt-args only.
Suggested fix: run the existing round-trip check on the parsed object, plus a regression test next to the --tool-arg v=1e400 case.
Already prototyped a fix?
No response
Before you submit
- I searched existing issues and this is not a duplicate.
- This is not a security vulnerability report (those go through the private advisory process).
- Lenguaje dominante
- TypeScript
- Estrellas
- 11.3k
- Forks
- 1.6k
- Merge medio
- 2 h 28 min
- PR fusionados (30 d)
- 111
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de modelcontextprotocol/inspector
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
modelcontextprotocol/inspector#3073 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
modelcontextprotocol/inspector#3072 ·
Los mantenedores suelen responder en 1 día
-
CLI/mcpdo: a timeout above 2147483647 ms fires after 1 ms, and the error says to raise it furtherAbiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
modelcontextprotocol/inspector#3071 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
modelcontextprotocol/inspector#3069 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
modelcontextprotocol/inspector#3066 ·
Los mantenedores suelen responder en 1 día
Todos los issues de modelcontextprotocol/inspector
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
MetaMask/eth-phishing-detect#317371 ·
Los mantenedores suelen responder en 1 día
-
android:player ios:player
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
free_port can hand one port to two callers, so the fixed-port http tests fail in parallel runsAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 92/100
erkamyaman/rust-anything#963 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
ZdruzenieSTROM/webstrom-frontend#934 ·
Los mantenedores suelen responder en 1 día
-
bug(worker): detector run is marked failed and never retried when span download failsPosiblemente ocupada @jagrutgarg la tomó hoy. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
traceroot-ai/traceroot#3434 · 1 comentario ·
Los mantenedores suelen responder en 1 día