Skip to content

feat: 支持 mcps call 自定义超时时间 - #35

Merged
maplezzk merged 4 commits into
mainfrom
feat/call-timeout
May 8, 2026
Merged

maplezzk merged 4 commits into
mainfrom
feat/call-timeout

Conversation

@maplezzk

@maplezzk maplezzk commented May 8, 2026 •

Copy link
Copy Markdown
Owner

变更内容

为 mcps call 命令新增 --timeout 选项,允许用户覆盖 MCP SDK 的默认 60 秒请求超时。

使用方式

# 给工具调用设 3 分钟超时
mcps call easyship-import download_label order_id="xxx" --timeout 180

# 不传则沿用 SDK 默认 60 秒
mcps call easyship-import download_label order_id="xxx"

--timeout 单位为秒,SDK 内部会转换为毫秒。

变更文件

文件 改动
src/commands/call.ts 添加 -t, --timeout CLI 选项,秒到毫秒转换
src/commands/daemon.ts /call handler 从 body 解出 timeout 并透传
src/core/client.ts callTool() 接收 timeout 参数传给 SDK
src/core/daemon-client.ts executeTool() 透传 timeout 到 daemon

验证

  • npm run build ✅ TypeScript 编译通过
  • npm test ✅ 全部 62 测试通过
  • 版本号已更新至 v1.7.0

Claude Bot and others added 4 commits May 8, 2026 20:05
新增 --timeout 选项,以秒为单位覆盖 SDK 默认 60s 超时。

变更文件:
- src/commands/call.ts: 添加 --timeout CLI 选项
- src/commands/daemon.ts: /call handler 透传 timeout
- src/core/client.ts: callTool() 接收 timeout 参数
- src/core/daemon-client.ts: executeTool() 透传 timeout

用法:mcps call <server> <tool> args... --timeout 180

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- --timeout 不传时默认 300s 而非 SDK 的 60s
- 更新 README 文档

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@maplezzk
maplezzk merged commit f091c87 into main May 8, 2026
1 check passed
@maplezzk
maplezzk deleted the feat/call-timeout branch May 8, 2026 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant