agy-bus-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@agy-bus-mcp Queue a task to fix failing tests in ~/projects/myapp, then check its status."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
agy-bus
一个轻量级本地异步任务总线(Stdio MCP Server + 后台并发 Worker),用于在 macOS 上以单向调度架构将 Gemini 桌面客户端(Task 模式) 与终端 agy CLI 解耦串联:
Gemini 客户端 负责需求拆解、架构规划、派单与结果验收;
后台
agyWorker 负责重度编码、多仓库并发执行与批量任务;零全盘权限:MCP Server 只读写位于已连接文件夹内的 SQLite(WAL)与日志,无需给 Gemini 客户端勾选
Allow full file access。
架构设计
Gemini Desktop (Local MCP Sandbox)
│ enqueue_task / get_task_status / list_tasks / cancel_task
▼
agy-bus-mcp ──(read/write)──▶ .agy_bus/bus.db (SQLite WAL) + .agy_bus/logs/
▲
│ atomic claim (per-cwd mutex)
│
agy-bus-worker (常规终端 / LaunchAgent,继承完整 PATH / Git / SSH / Keychain)
│
▼ subprocess: agy -p ... --output-format json --mode ...
[--sandbox] [--conversation ...] [--model ...]
[--effort ...] [--agent ...] [--add-dir ...]
agy CLI核心特性
同目录串行互斥,不同目录并发:
claim_next_task()通过BEGIN IMMEDIATE原子抢占任务,跳过正在执行的cwd,避免两个agy同时修改同一 Git 仓库。传引用不传全文:MCP 默认只返回任务状态、退出码、会话 ID、
<= 1500字精简摘要和日志文件路径,避免长输出撑爆客户端上下文。短任务阻塞等待:
get_task_status支持wait_seconds(0..20),可等待短任务完成后再返回,减少轮询次数。异常自动恢复:Worker 启动时自动将异常中断遗留的
running任务标记为failed。兼容
agy多种输出:自动解析单行 JSON、多行 NDJSON 与纯文本降级,提取conversation_id供续接会话。
Related MCP server: Antigravity Worker MCP
快速开始
前置依赖
第 1 步:在 Gemini 已连接文件夹一键安装
重要:请先进入你在 Gemini 客户端中已授权的 Connected Folder(这样无需开启全盘文件访问权限)。安装脚本会自动拉取代码到当前目录下的
agy-bus/(也可通过--dir <路径>或AGY_BUS_INSTALL_DIR自定义目录)。
cd <你的-Gemini-已连接文件夹>
curl -fsSL https://raw.githubusercontent.com/backtomyfuture/agy-bus/main/install.sh | bash安装脚本会自动完成以下工作:
自动拉取或更新
agy-bus源码(支持git与无git环境的 tarball 下载);安装依赖并构建
.venv虚拟环境;运行离线自检测试(
uv run --offline pytest -q);自动安装并启动 macOS
LaunchAgent后台常驻 Worker(支持开机自启;如需跳过可追加--no-service);自动将 MCP 命令路径复制到剪贴板(可直接
Cmd + V粘贴)。
第 2 步:在 Gemini 桌面客户端添加 Local MCP
打开 Gemini 客户端 Task 模式 → Connected Apps → Local MCP,将已自动复制的命令直接 Cmd + V 粘贴到 Command,保持 Allow full file access 不勾选即可立即使用:
配置项 | 填写内容 |
Name |
|
Description |
|
Command |
|
Allow full file access | 保持不勾选 |
为什么不填
uv run? 在未勾选Allow full file access的沙箱中,uv会尝试访问~/.cache/uv而被拦截;直接指向.venv/bin/agy-bus-mcp可免去uv依赖且毫秒级握手。
卸载后台服务:
curl -fsSL https://raw.githubusercontent.com/backtomyfuture/agy-bus/main/install.sh | bash -s -- --uninstall
MCP 工具列表
工具 | 说明 |
| 校验参数并入队,毫秒级返回 |
| 查询状态、退出码、精简摘要、会话 ID 与日志路径; |
| 列出最近任务概览(支持按 |
| 取消尚处于 |
enqueue_task 支持的 agy 参数映射
MCP 参数 | 对应 | 默认值 / 可选值 | 说明 |
|
| 必填 | 给 |
| 工作目录 | 必填 | 目标工作目录路径(同目录串行互斥,不同目录并发) |
|
|
| 执行权限模式 |
|
|
| 为 |
|
|
| 传入既有会话 ID 以续接上下文;留空表示新会话 |
|
|
| 指定模型名称;留空使用 |
|
|
| 指定推理强度 |
|
|
| 指定 |
|
|
| 附加到工作区的额外目录列表(自动展开为可重复 |
常用环境变量(Worker 侧)
变量 | 默认值 | 说明 |
|
| SQLite 数据库与日志目录 |
| 自动探测( |
|
|
| 队列轮询间隔(秒) |
|
| 最大并发执行线程数 |
|
| 单任务超时时间(秒) |
|
| 完成后发送 macOS 原生通知( |
常见问题排查
Gemini 客户端点 Next 一直卡住:先彻底退出客户端(
Cmd + Q)再重启以重置本地 MCP 管理器;同时确保项目使用的是pyproject.toml中锁定的mcp>=1.6.0,<2.0.0(稳定版FastMCP)。Worker 执行报错
authentication required:请确认 Worker 是在常规 macOS 终端或LaunchAgent中启动,并且已在该终端执行过agy完成登录。运行自动化测试:
uv run --offline pytest -q
License
Available Tools
4 toolscancel_taskB
取消尚处于 pending 状态的任务(已在运行或已结束的任务无法取消)。 Cancel a task that is still in 'pending' status.
Args: task_id: 要取消的任务 ID。
Inputs: task_id (required).
enqueue_taskA
将一条编码或执行任务入队,由后台 Worker 异步调用本地 agy CLI 执行。 Enqueue a task into the local agy-bus SQLite queue for asynchronous execution by the background Worker.
Args: prompt: 给 agy 的完整任务指令(建议包含目标、约束与验收标准)。 cwd: 目标工作目录(如 Git 仓库绝对路径);同目录任务会自动串行互斥,不同目录并发执行。 mode: agy 执行权限模式,可选 "accept-edits"(默认)、"auto"、"plan"。 use_sandbox: 是否开启 agy --sandbox 终端限制(默认 True)。 conversation_id: 可选,传入既有会话 ID 以通过 --conversation 续接上下文;留空表示新会话。 model: 可选,指定 agy 使用的模型名称(对应 --model);留空使用默认模型。 effort: 可选,指定推理强度:low / medium / high / xhigh / max(对应 --effort)。 agent: 可选,指定 agy Agent 名称(对应 --agent)。 add_dirs: 可选,附加到工作区的额外目录路径列表(对应可重复的 --add-dir)。
Returns: 包含 task_id、status 与 log_path 的入队回执(毫秒级返回)。
Inputs: cwd (required), prompt (required), mode, agent, +5 more.
get_task_statusA
查询指定任务的执行状态、退出码、精简摘要(<=1500字)、会话 ID 与日志路径。 Query status, exit code, concise summary, conversation ID, and log file path for a task.
默认遵循“传引用不传全文”原则;仅在需要排障时将 include_log_tail 设为 True。 对于短任务,可设置 wait_seconds(1~20)让服务端短暂等待至结束再返回,减少轮询次数。
Args: task_id: enqueue_task 返回的任务 ID。 include_log_tail: 是否附带完整日志文件的末尾若干行(默认 False)。 tail_lines: 当 include_log_tail=True 时返回的末尾行数(默认 40,上限 500)。 wait_seconds: 可选,最多阻塞等待的秒数(0 表示立即返回,上限 20 秒)。
Inputs: task_id (required), tail_lines, wait_seconds, include_log_tail.
list_tasksB
列出最近的任务概览(含截取后的 prompt 预览)。 List recent tasks with truncated prompt previews.
Args: limit: 返回的最大任务数(默认 10,上限 200)。 status: 可选状态过滤:pending / running / done / failed / cancelled;留空表示不过滤。
Inputs: limit, status.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool targets a distinct queue operation: enqueue, list, cancel, and detailed status. The boundary between list_tasks (multi-task overview) and get_task_status (single-task detail) is clear from descriptions and arguments.
All names follow a consistent snake_case verb_noun pattern: enqueue_task, list_tasks, cancel_task, get_task_status. The naming is predictable and readable.
Four tools are well-scoped for a queue-management server, covering creation, listing, cancellation, and status inspection. No tool feels redundant or out of place.
The core task lifecycle is covered: enqueue, list, inspect status, and cancel. Minor gaps exist around retrying failed tasks, purging completed tasks, or retrieving logs separately, but the included log-tail option mitigates most debugging needs.
Maintenance
Related MCP Connectors
Task tracking built for coding agents. Work is leased, so two agents never take the same SubTask.
Run parallel coding agents: Git-worktree workspaces, agent sessions, automations, tasks.
Hosted coding agent: start, follow up on and stop tasks that can open GitHub pull requests.
Task coordination for AI agents. Exclusive locks, shared files, handoffs, per-agent spending limits.
Related MCP Servers
- AlicenseAqualityCmaintenanceA task-level STDIO MCP server that lets Codex or any other MCP client hand off scoped coding jobs to an asynchronous worker agent which reads the code, edits files, and runs tests, while the client keeps ownership of planning and acceptance. Exposes submit, wait, query, follow-up, and cancel tools so multiple clients can queue and monitor tasks against a chosen project root.51MIT
- AlicenseNot gradedqualityBmaintenanceEnables STDIO-compatible AI assistants to queue coding work onto the official Google Antigravity CLI and track status, read reports or patches, query capabilities, or cancel running tasks without blocking. Supports trusted direct execution plus optional isolated or read-only modes depending on the platform.MIT
- AlicenseNot gradedqualityCmaintenanceEnables asynchronous task delegation to local Antigravity and Codex CLI agents, with run IDs, status queries, waiting, cancellation, session resumption, and persistent background execution across client reconnects.2MIT

harflow-mcpofficial
AlicenseBqualityBmaintenanceEnables dispatching coding tasks to multiple coding-agent CLIs with persistent task history, bounded reads, cancellation, continuation, reusable workflows, and opt-in exact-action approvals.63Apache 2.0