
Agy Bridge
io.github.sshahzaiib由 GitHub 账号 sshahzaiib 发布v0.3.1更新于 Oct 24, 2026
Delegate heavy tasks from Claude Code to the Antigravity CLI (Gemini) with quota-aware failover.
概览
一个 MCP 桥接服务,让 Claude Code 把繁重任务交给 Antigravity CLI(agy),只取回答案,并带模型路由与配额感知故障转移。
- 可以做什么
- 分析大文件、日志与转储,或对方案和代码做对抗式评审
- 执行 git log/diff/blame 考古式检索与全仓库 grep,结果不进入调用方上下文
- 通过 CLI 的模型查询文档与外部知识
- 按 session id 继续此前的委派会话,无需重发上下文
- 委派其他繁重任务,可按调用指定模型或工作目录
- 适用场景
- 适合 Claude Code 会话因大文件、仓库检索或网络查询而大量消耗上下文时,把这类工作外包给另一个模型。也适合需要模型配额耗尽时自动切换的场景。
- 运行要求
- 通过 npx 启动的本地 stdio 进程,需要 Node.js 18+。需安装并完成认证的 Antigravity CLI(agy),预期客户端为 Claude Code。可选环境变量:AGY_PATH、AGY_TIMEOUT、AGY_TIMEOUT_ 、AGY_MAX_OUTPUT_CHARS、AGY_DEFAULT_MODEL、AGY_SANDBOX、AGY_ON_FAILURE。建议把客户端工具超时设得足够长。
安装
在 SourceWeft 中
- 打开 控制台中的 Agy Bridge,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
agy-bridge
[CI] [npm version] [npm downloads] [node] [license]
[MseeP.ai Security Assessment Badge]
An MCP bridge that lets Claude Code delegate heavy tasks to the Antigravity CLI (agy) — saving Claude's context window and tokens for what matters.
Claude sends a task → the bridge routes it to the best available model via agy → only the answer comes back. Large files, deep git searches, and web lookups never touch Claude's context.
Listed on
[Glama] [MCP Market] [PulseMCP] [mcp.so] [MCP Servers] [Verified on MseeP]
Why this over claude-to-agy?
Requirements
- Node.js 18+
- Antigravity CLI (
agy) installed and authenticated - Claude Code
Install
The
"timeout": 600000(10 min, milliseconds) is the client-side tool-call deadline — without it, a cold-startanalyze_files(~40–50s) or a longdelegatecan hit Claude Code's default and returntimed out waiting for responsewhile the agy run is still going. If your client doesn't honor a per-servertimeout, set the global env varMCP_TOOL_TIMEOUT=600000instead. Details and the agy-side budgets are in Timeouts and cancellation.
Tools
All tools accept optional cwd (project root) and model (an id or display name from agy models; validated, with available models listed on mismatch).
Every response ends with a footer:
Model routing
On first use the bridge runs agy models (cached for the process lifetime) and picks the first available model in the tool's preference chain. Chain entries name a family and tier rather than a version (Gemini * Flash (High)), and * resolves to the newest version agy currently lists, so a Gemini release never silently breaks routing. Chains are Gemini-first; Claude Opus and GPT-OSS are appended as a last resort and only used when no Gemini model is listed. If none is available it falls back to AGY_DEFAULT_MODEL, and finally to agy's own default. agy silently ignores unknown --model values, so the bridge validates names up front instead of letting requests land on the wrong model.
Quota-aware failover
agy never surfaces quota exhaustion in print mode — it silently retries the 429 until its print-timeout, then exits 0 with empty output, which used to look like an indefinite hang. The bridge now watches each run's log file (via --log-file) and on RESOURCE_EXHAUSTED (code 429):
- kills the agy process group immediately (no waiting out the timeout),
- parses the reset time ("Resets in 4h24m") into an in-process cooldown registry,
- retries the same prompt on the next model in the tool's chain,
- skips cooled-down models on all subsequent calls until their quota resets.
Failovers are annotated in the response footer (failover: <model>: quota exhausted (resets in 4h24m)). Only when every candidate is exhausted does the call fail — in seconds, with reset times listed — instead of hanging.
Timeouts and cancellation
Each tool has its own default timeout sized to its job: web_lookup 120s, deep_search 180s, analyze_files / adversarial_review / follow_up 300s, delegate 600s. Setting AGY_TIMEOUT explicitly overrides all of them at once. To change a single tool, set AGY_TIMEOUT_<TOOL_NAME> instead (e.g. AGY_TIMEOUT_DEEP_SEARCH=300); a per-tool override takes precedence over the global AGY_TIMEOUT and the tool's default. The full set of per-tool variables is AGY_TIMEOUT_ANALYZE_FILES, AGY_TIMEOUT_DEEP_SEARCH, AGY_TIMEOUT_WEB_LOOKUP, AGY_TIMEOUT_ADVERSARIAL_REVIEW, AGY_TIMEOUT_FOLLOW_UP, and AGY_TIMEOUT_DELEGATE. The kill path escalates SIGTERM → SIGKILL across the whole process group, and the deadline fires even if agy's helper processes hold the output pipes open. Cancelling the tool call from the MCP client (e.g. pressing Esc in Claude Code) also kills the agy run instead of orphaning it.
Two timeout layers — align them. The timeouts above are the agy-side budget. Your MCP client (Claude Code) has its own, separate tool-call timeout, and if it is shorter than the agy budget the client gives up first — you'll see Error: timed out waiting for response (note: agy-bridge's own timeout reads agy timed out after Ns instead). The work is not lost: the agy session persists, so follow_up with the returned session_id retrieves the result. But the real fix is to make the client wait at least as long as agy: the Install command already sets a per-server timeout of 600000ms (scoped to the agy-bridge entry only). If you registered the server without it, re-run the add-json command from Install, or set the global env var MCP_TOOL_TIMEOUT=600000. Rule of thumb: client timeout ≥ agy budget.
Expected latency. Most of the perceived "slowness" is cold start: the first call in a session spawns the agy CLI and warms the model. A simple analyze_files over 3 files measures around 40–50s cold (≈46s observed), dropping on subsequent same-session calls. A first call that also hits a quota 429 takes longer while the bridge fails over. So a client timeout below ~60s will intermittently trip on cold starts even for "simple" questions — size it generously.
Configuration
All optional, via environment variables:
Failure behavior
The bridge always fails loudly: agy errors surface as MCP tool errors with agy's actual stderr, and degraded model routing is annotated in the response footer. By default the calling agent (Claude) will typically do the work itself after a failure — visible in the transcript, but easy to stop noticing in a long session. Set AGY_ON_FAILURE=strict to append an explicit "do NOT perform this work yourself — report the failure to the user" instruction to every delegation error, so you keep control over when token savings are silently lost.
Development
Support
agy-bridge is free and MIT-licensed. If it saves you tokens every day, Ko-fi keeps it maintained.
Contributors
Contributions are welcome — open an issue or PR.
[Contributors]Star History
License
MIT
来源:README.md,提交 02c5fa0
工具
0版本历史
1- v0.3.1最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分