`-e KEY=` (empty value) is rejected on all four clients, though `--config` passes an empty env value through
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 68/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- node.js, typescript
- Ambito
- cli
Direzione di ricerca
Il rifiuto si trova in parseKeyValuePair in core/mcp/node/config.ts (intorno alla riga 55), che lancia un errore quando il valore è vuoto; il percorso condiviso è usato da tutti e quattro i client. Leggilo insieme a core/cli/utils/prompt-args.ts, dove q= era già consentito. Il test in clients/web/src/test/core/mcp/node/config.test.ts (intorno alla riga 47) attualmente si aspetta che key= lanci un errore, quindi verifica se questo è intenzionale prima di modificarlo. Il lavoro è completo quando -e EMPTY_VAR= produce un valore stringa vuoto e il test viene aggiornato di conseguenza.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Which version line?
v2 — current (@modelcontextprotocol/inspector@latest)
Which client?
All / shared core
Inspector version
2.17.0
Node version
v26.13.1
Operating system (and browser, for the web client)
macOS 27.3 (arm64); headless Chrome for the web control runs
Transport
stdio
MCP server under inspection
A dependency-free stdio server (below) whose one tool, check_env, reports EMPTY_VAR as the server process sees it. Protocol era: legacy (default). OAuth: no.
Steps to reproduce
- In an empty folder, create
env-server.mjs:import { createInterface } from "node:readline"; const reply = (id, result) => process.stdout.write(JSON.stringify({ jsonrpc: "2.0", id, result }) + "\n"); createInterface({ input: process.stdin }).on("line", (line) => { const { id, method, params } = JSON.parse(line); if (id === undefined) return; if (method === "initialize") reply(id, { protocolVersion: params.protocolVersion, capabilities: { tools: {} }, serverInfo: { name: "env-server", version: "0" } }); else if (method === "tools/list") reply(id, { tools: [{ name: "check_env", inputSchema: { type: "object" } }] }); else if (method === "tools/call") reply(id, { content: [{ type: "text", text: JSON.stringify({ set: "EMPTY_VAR" in process.env, value: process.env.EMPTY_VAR ?? null }) }] }); else reply(id, {}); }); - Run:
insp() { npx -y @modelcontextprotocol/[email protected] "$@"; } insp --cli -e EMPTY_VAR=x node env-server.mjs --method tools/call --tool-name check_env # {"set":true,"value":"x"} insp --cli -e EMPTY_VAR= node env-server.mjs --method tools/call --tool-name check_env # exit 1, error below insp --cli -e 'EMPTY_VAR=""' node env-server.mjs --method tools/call --tool-name check_env # {"set":true,"value":"\"\""} echo '{"mcpServers":{"s":{"command":"node","args":["env-server.mjs"],"env":{"EMPTY_VAR":""}}}}' > cfg.json insp --cli --config cfg.json --server s --method tools/call --tool-name check_env # {"set":true,"value":""} MCP_AUTO_OPEN_ENABLED=false insp --web -e EMPTY_VAR= node env-server.mjs # exit 1 insp --tui -e EMPTY_VAR= -- node env-server.mjs # exit 1 npx -y --package=@modelcontextprotocol/[email protected] mcpdo connect -e EMPTY_VAR= -- node env-server.mjs # exit 1
Expected behavior
-e EMPTY_VAR= launches the server with EMPTY_VAR set to "", as the same entry in a --config file already does.
Actual behavior
All four clients exit 1 at startup. The quoted form isn't a workaround: the server receives two literal quote characters (CLI and mcpdo). With the CLI, setting EMPTY_VAR= in the parent shell doesn't reach the server either (it reports the variable as unset).
Logs, errors, or screenshots
CLI, mcpdo: {"error":{"code":"error","message":"Invalid parameter format: EMPTY_VAR=. Use key=value format."}}
Web, TUI: Error running MCP Inspector: Invalid parameter format: EMPTY_VAR=. Use key=value format.
Controls, each confirmed by the server's own report: with EMPTY_VAR=x on -e, and with the --config file, the web client (connected in headless Chrome), the TUI and mcpdo all started and the server saw the expected value.
From reading the code on v2/main (218253575), not run: every client's -e uses parseKeyValuePair in core/mcp/node/config.ts:55, which rejects val === "". clients/web/src/test/core/mcp/node/config.test.ts:47 expects key= to throw, so the rejection may be deliberate (it came over with the v1.5 port). By contrast, #2890 made --prompt-args accept q= (core/cli/utils/prompt-args.ts:16-17).
Impact is small: a server that treats set-but-empty differently from unset can't be started in that state with -e; --config works. This is the v2 follow-up to v1 #629, where you asked to hear if it still happens in v2.
Not tested: Windows or Linux, other Node versions, or the web UI's server-settings env editor.
Already prototyped a fix?
No.
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).
AI disclosure: an AI coding agent ran these reproductions and wrote and filed this issue autonomously for this GitHub account (found by one Claude agent, independently re-run from scratch by a second, claude-opus-5-5, and reviewed by Claude Fable 5.2 in Claude Code before posting). No human testing is claimed.
- Lingua principale
- TypeScript
- Stelle
- 11.3k
- Fork
- 1.6k
- Merge medio
- 2h 28m
- PR unite (30g)
- 111
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di modelcontextprotocol/inspector
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
modelcontextprotocol/inspector#3073 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
modelcontextprotocol/inspector#3072 ·
I maintainer di solito rispondono entro 1 giorno
-
CLI/mcpdo: a timeout above 2147483647 ms fires after 1 ms, and the error says to raise it furtherApertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
modelcontextprotocol/inspector#3071 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
modelcontextprotocol/inspector#3069 ·
I maintainer di solito rispondono entro 1 giorno
-
CLI --tool-args-json silently sends 1e400 as null (round-trip guard missing; mcpdo rejects it)Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
modelcontextprotocol/inspector#3067 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di modelcontextprotocol/inspector
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
MetaMask/eth-phishing-detect#317371 ·
I maintainer di solito rispondono entro 1 giorno
-
android:player ios:player
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
free_port can hand one port to two callers, so the fixed-port http tests fail in parallel runsAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 92/100
erkamyaman/rust-anything#963 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
ZdruzenieSTROM/webstrom-frontend#934 ·
I maintainer di solito rispondono entro 1 giorno
-
bug(worker): detector run is marked failed and never retried when span download failsForse già presa @jagrutgarg l’ha presa oggi. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
traceroot-ai/traceroot#3434 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno