dumbwaiter-mcp
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseDumbwaiter MCP: Wait-for-Change
Dumbwaiter MCP:等待变更
Goal: give Claude a single, stable way to “wait until X happens” on a code host (GitHub now; GitLab next). This skill teaches Claude when and how to use the Dumbwaiter MCP server’s tools.
Prerequisites
- Server: this repo builds a stdio MCP server ().
cargo build && target/debug/dumbwaiter-mcp - Auth: (repo read permissions are sufficient for commit statuses).
export GITHUB_TOKEN=… - Persistence (optional): to override
DUMBWAITER_DB../state/dumbwaiter.sqlite - Await settings (optional): (default 900),
DUMBWAITER_AWAIT_TTL_SECSto enable the background engine (legacy aliasDUMBWAITER_ENGINE=1still works).DUMBWAITER_WATCHER=1
When to use this skill
- You need to pause orchestration until PR checks turn green, a PR is merged, or checks fail.
- You want durable waits with a , cancellable and recoverable after restarts.
wait_id - You want progress updates visible to the host via MCP .
notify_progress
Tools overview
- → returns
wait.startfor a condition on a selector{ wait_id } - → returns current state:
wait.statuspending|satisfied|failed|timeout|cancelled|unknown - → cancels a pending wait
wait.cancel - → polls provider with exponential backoff; emits progress notifications; resolves to terminal state or timeout
wait.await
Selectors and conditions (GitHub)
- selector:
{ "owner": "ORG", "repo": "REPO", "pr": 123 } - Supported tokens:
condition- — combined status success
checks_succeeded - — combined status failure/error
checks_failed - — merged flag true
pr_merged - — at least one approved review
pr_approved - — an open review with changes requested
changes_requested - — at least one completed workflow run
workflow_completed - — any new PR comment/review/reaction event (see streaming section below)
comment_received
For , optional refine which events count. If omitted, defaults to the wait's timestamp so Dumbwaiter streams everything posted after the wait was created.
comment_receivedfilterssincecreated_atHappy-path flow
- Start wait
- name:
wait.start - arguments:
{ "provider": "github", "selector": {…}, "condition": "checks_succeeded" } - capture
wait_id
- name:
- Await
- name:
wait.await - arguments:
{ "wait_id": "…" } - Observe progress notifications; handle final result
- name:
- Query or cancel as needed
- or
wait.statuswait.cancel
Guidelines
- Prefer when a host can display progress; otherwise poll with
wait.awaiton an interval < backoff cap (default 30s).wait.status - Always report final state back to the orchestrator and link the in logs/notes.
wait_id - On auth errors or rate limits, surface a clear, actionable message; do not retry aggressively (respect backoff).
- On timeouts, return with elapsed seconds; let the caller decide next steps.
timeout - Security: never echo tokens; require least scopes.
目标:为Claude提供一种单一、稳定的方式,在代码托管平台(目前支持GitHub,后续将支持GitLab)上“等待X事件发生”。本Skill将教会Claude何时以及如何使用Dumbwaiter MCP服务器的工具。
前置条件
- 服务器:本仓库可构建一个标准输入输出MCP服务器()。
cargo build && target/debug/dumbwaiter-mcp - 认证:(仓库读取权限足以获取提交状态)。
export GITHUB_TOKEN=… - 持久化(可选):通过覆盖默认的
DUMBWAITER_DB数据库路径。./state/dumbwaiter.sqlite - 等待设置(可选):(默认900秒),设置
DUMBWAITER_AWAIT_TTL_SECS以启用后台引擎(旧别名DUMBWAITER_ENGINE=1仍可使用)。DUMBWAITER_WATCHER=1
何时使用本Skill
- 你需要暂停编排流程,直到PR检查通过、PR被合并或检查失败。
- 你需要具备的可持久化等待任务,支持取消操作,且重启后可恢复。
wait_id - 你希望通过MCP 向宿主展示进度更新。
notify_progress
工具概述
- → 返回对应选择器条件的
wait.start{ wait_id } - → 返回当前状态:
wait.statuspending|satisfied|failed|timeout|cancelled|unknown - → 取消一个待处理的等待任务
wait.cancel - → 以指数退避方式轮询供应商;发送进度通知;最终解析为终端状态或超时
wait.await
选择器与条件(GitHub)
- 选择器:
{ "owner": "ORG", "repo": "REPO", "pr": 123 } - 支持的标识:
condition- — 综合状态为成功
checks_succeeded - — 综合状态为失败/错误
checks_failed - — PR已合并
pr_merged - — 至少有一个已批准的评审
pr_approved - — 存在一个要求修改的未关闭评审
changes_requested - — 至少有一个工作流已完成
workflow_completed - — 收到任何新的PR评论/评审/反应事件(见下方流处理章节)
comment_received
对于条件,可通过可选的筛选符合条件的事件。若省略,则默认使用等待任务创建时的时间戳,Dumbwaiter将流式传输等待任务创建后发布的所有内容。
comment_receivedfilterssincecreated_at最佳实践流程
- 启动等待任务
- 名称:
wait.start - 参数:
{ "provider": "github", "selector": {…}, "condition": "checks_succeeded" } - 记录返回的
wait_id
- 名称:
- 等待结果
- 名称:
wait.await - 参数:
{ "wait_id": "…" } - 观察进度通知;处理最终结果
- 名称:
- 按需查询或取消
- 使用查询状态或
wait.status取消任务wait.cancel
- 使用
指南
- 若宿主支持展示进度,优先使用;否则,以小于退避上限(默认30秒)的时间间隔轮询
wait.await。wait.status - 务必将最终状态报告给编排器,并在日志/备注中关联对应的。
wait_id - 遇到认证错误或速率限制时,展示清晰、可执行的提示信息;不要频繁重试(遵循退避策略)。
- 超时后,返回状态及已耗时秒数;由调用方决定后续操作。
timeout - 安全:切勿回显令牌;使用最小权限原则。
Streaming GitHub comment events
流式处理GitHub评论事件
Set to plus optional filters:
conditioncomment_receivedjson
{
"provider": "github",
"selector": { "owner": "acme", "repo": "widgets", "pr": 42 },
"condition": "comment_received",
"filters": {
"since": "2025-01-01T00:00:00Z",
"include_bots": true,
"author_allowlist": ["alice"],
"author_denylist": ["bot"]
}
}wait.awaitnotify_progressExamples
- “Wait for PR 42 in acme/widgets until checks pass.”
- start →
{ provider: "github", selector: { owner: "acme", repo: "widgets", pr: 42 }, condition: "checks_succeeded" } - await →
{ wait_id }
- start →
- “Stream every new comment on PR 42 since midnight UTC.”
- start →
{ provider: "github", selector: { owner: "acme", repo: "widgets", pr: 42 }, condition: "comment_received", filters: { since: "2025-01-01T00:00:00Z", include_bots: true } } - await → receives per-comment progress events plus the final summary payload
- start →
Troubleshooting
- status: the
unknownwas not found (DB purge or wrong project).wait_id - No progress events: confirm host supports MCP notifications and server is connected.
- Auth failures: ensure is set and valid for the target repo.
GITHUB_TOKEN
将设置为并添加可选的:
conditioncomment_receivedfiltersjson
{
"provider": "github",
"selector": { "owner": "acme", "repo": "widgets", "pr": 42 },
"condition": "comment_received",
"filters": {
"since": "2025-01-01T00:00:00Z",
"include_bots": true,
"author_allowlist": ["alice"],
"author_denylist": ["bot"]
}
}wait.awaitnotify_progress示例
- “等待acme/widgets仓库中PR 42的检查通过。”
- 启动任务 →
{ provider: "github", selector: { owner: "acme", repo: "widgets", pr: 42 }, condition: "checks_succeeded" } - 等待结果 →
{ wait_id }
- 启动任务 →
- “流式传输PR 42自UTC午夜以来的所有新评论。”
- 启动任务 →
{ provider: "github", selector: { owner: "acme", repo: "widgets", pr: 42 }, condition: "comment_received", filters: { since: "2025-01-01T00:00:00Z", include_bots: true } } - 等待结果 → 接收每条评论的进度事件及最终汇总负载
- 启动任务 →
故障排除
- 状态:未找到对应的
unknown(数据库已清理或项目错误)。wait_id - 无进度事件:确认宿主支持MCP通知且服务器已连接。
- 认证失败:确保已设置且对目标仓库有效。
GITHUB_TOKEN