CLI/mcpdo: a timeout above 2147483647 ms fires after 1 ms, and the error says to raise it further
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 72/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- nodejs, typescript
- 领域
- cli
调研方向
从 clients/cli/src/cli.ts 中约 1581-1589 行的 --connect-timeout 解析器开始,它目前只检查值是否为有限数且非负。同时检查目录中的 connectionTimeout 以及 --wait-for-auth 的值如何传入 setTimeout。完成标准是:超过 2147483647 ms 的值被钳制或以用法错误拒绝,并且轮询期间不会出现 TimeoutOverflowWarning。
由索引模型根据 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
mcp-inspector --cli node probe-echo.mjs --method tools/list --connect-timeout 2147483648
Also:
"connectionTimeout": 2147483648in a--config/ catalog entrymcpdo connect @h --connect-timeout 2147483648 -- node server.mjs--wait-for-auth 3000000(seconds, > 2^31 ms)
Expected behavior
Clamp to 2^31-1 ms (≈24.8 days, effectively unbounded) or reject values above it as a usage error. A huge value means "very long"; 0 already means "no timeout".
Actual behavior
Exits 4 after ~0.4 s against a healthy server:
(node) TimeoutOverflowWarning: 2147483648 does not fit into a 32-bit signed integer.
Timeout duration was set to 1.
{"error":{"code":"unreachable","message":"Connection timed out after 2147483648 ms. To accommodate a slower server, pass a larger --connect-timeout <ms>, or set connectionTimeout on the server's catalog or config entry."}}
The remedy makes it worse. 2147483647 works. The config connectionTimeout and mcpdo connect fail the same way (mcpdo after ~2 s). --wait-for-auth 3000000 does not fail but prints a TimeoutOverflowWarning on every poll (40 in 20 s), flooding the stderr that carries the one-line envelope.
Logs, errors, or screenshots
Cause: the --connect-timeout parser (clients/cli/src/cli.ts:1581–1589) only checks Number.isFinite(n) && n >= 0; the catalog connectionTimeout is not range-checked either. Node's setTimeout treats anything above 2^31-1 as 1.
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 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 82/100
modelcontextprotocol/inspector#3072 ·
维护者通常 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 天内回复