`-e KEY=` (empty value) is rejected on all four clients, though `--config` passes an empty env value through
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 68/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- node.js, typescript
- Lĩnh vực
- cli
Hướng nghiên cứu
Việc từ chối nằm trong parseKeyValuePair tại core/mcp/node/config.ts (khoảng dòng 55), hàm này ném lỗi khi giá trị rỗng; đường dẫn dùng chung được cả bốn client sử dụng. Hãy đọc cùng với core/cli/utils/prompt-args.ts, nơi q= đã được cho phép từ trước. Bài kiểm thử trong clients/web/src/test/core/mcp/node/config.test.ts (khoảng dòng 47) hiện đang kỳ vọng key= ném lỗi, vì vậy hãy xác nhận đây có phải là hành vi có chủ đích hay không trước khi thay đổi. Hoàn thành khi -e EMPTY_VAR= cho ra giá trị chuỗi rỗng và bài kiểm thử được cập nhật cho khớp.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- TypeScript
- Star
- 11.3k
- Fork
- 1.6k
- Merge trung bình
- 2 giờ 28 phút
- Pull request đã merge (30 ngày)
- 111
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của modelcontextprotocol/inspector
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
modelcontextprotocol/inspector#3073 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
modelcontextprotocol/inspector#3072 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
CLI/mcpdo: a timeout above 2147483647 ms fires after 1 ms, and the error says to raise it furtherĐang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
modelcontextprotocol/inspector#3071 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
modelcontextprotocol/inspector#3069 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
CLI --tool-args-json silently sends 1e400 as null (round-trip guard missing; mcpdo rejects it)Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
modelcontextprotocol/inspector#3067 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của modelcontextprotocol/inspector
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
MetaMask/eth-phishing-detect#317371 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
android:player ios:player
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
free_port can hand one port to two callers, so the fixed-port http tests fail in parallel runsĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 92/100
erkamyaman/rust-anything#963 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
ZdruzenieSTROM/webstrom-frontend#934 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug(worker): detector run is marked failed and never retried when span download failsCó thể đã có người làm @jagrutgarg đã nhận hôm nay. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
traceroot-ai/traceroot#3434 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày