CLI/mcpdo: --connect-timeout "" (e.g. an unset shell variable) silently disables the timeout and the run never ends
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 82/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- typescript
- 领域
- cli
调研方向
错误的值在 clients/cli/src/cli.ts 约第 1584 行被解析,那里的 Number(v) 在没有空值检查的情况下执行。请与 core/cli/handlers/load-parsers.ts 和 load-thresholds.ts 中的 --load-* 解析器进行比较,它们已经将空值或仅含空白的值视为无效。使用 --connect-timeout "" 运行复现步骤,并确认它现在会以用法错误退出,而不是挂起。同样的防护也应覆盖 mcpdo 的 --connect-timeout。
由索引模型根据 Issue 内容生成。
描述
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
echo 'setInterval(()=>{},1000)' > hang.mjs # stdio "server" that never answers
mcp-inspector --cli node hang.mjs --method tools/list --connect-timeout "$CONNECT_TIMEOUT" # variable unset
mcpdo connect @h --connect-timeout "" -- node hang.mjs
Expected behavior
A blank value is a usage error. Number("") is 0, and 0 is documented as "no timeout", so the most common CI mistake turns off the safeguard docs/cli-smoke-testing.md says to always set ("Always bound the connect").
Actual behavior
Never exits (killed by timeout after 25 s, exit 124). Without the flag the same command exits 4 after the 15 s default. mcpdo hangs the same way (killed after 30 s).
Logs, errors, or screenshots
Cause: clients/cli/src/cli.ts:1584 does const n = Number(v) with no blank check. The --load-* parsers already guard this exact case: core/cli/handlers/load-parsers.ts:29 and load-thresholds.ts:57 use value.trim() === "" ? NaN : Number(value). The same one-liner fixes both clients.
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).
- 主要语言
- TypeScript
- 星标
- 11.3k
- 派生
- 1.6k
- 平均合并
- 2 小时 28 分钟
- 30 天内合并 PR
- 111
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
modelcontextprotocol/inspector 的其他 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 62/100
modelcontextprotocol/inspector#3073 ·
维护者通常 1 天内回复
-
CLI/mcpdo: a timeout above 2147483647 ms fires after 1 ms, and the error says to raise it further未关闭bug
难度 2/5 1-3 小时 新手友好度 72/100
modelcontextprotocol/inspector#3071 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 78/100
modelcontextprotocol/inspector#3069 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 78/100
modelcontextprotocol/inspector#3067 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
modelcontextprotocol/inspector#3066 ·
维护者通常 1 天内回复
查看 modelcontextprotocol/inspector 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
MetaMask/eth-phishing-detect#317371 ·
维护者通常 1 天内回复
-
android:player ios:player
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 92/100
erkamyaman/rust-anything#963 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 72/100
ZdruzenieSTROM/webstrom-frontend#934 ·
维护者通常 1 天内回复
-
bug(worker): detector run is marked failed and never retried when span download fails可能已有人在做 @jagrutgarg 今天认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 72/100
traceroot-ai/traceroot#3434 · 1 条评论 ·
维护者通常 1 天内回复