Agy Bridge

by sshahzaiib

957 downloads
Not rated
GitHub

About

MCP bridge that lets Claude Code delegate heavy tasks to the Antigravity CLI (agy) — purpose-built tools, model routing with fallback, session continuity, and output truncation to save Claude's context and tokens.

Details

Author
sshahzaiib
Downloads
957
Categories
Developer Tools, AI, Automation

- 6 purpose-built tools for different task types
- Per-tool model routing with availability detection and fallback
- Session continuity via the follow_up tool
- Configurable output truncation cap (default 50,000 characters)
- Optional sandbox mode for safety
- Zero-install npx usage (Node.js)

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name Agy Bridge
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Register the MCP server with Claude Code using claude mcp add -s user agy-bridge npx -- -y agy-bridge, then add delegation rules by downloading the recommended CLAUDE.md file. The bridge exposes six tools; Claude self-routes tasks based on their type.

analyze_files

Delegate file analysis to the Antigravity CLI (Gemini) instead of reading files yourself. USE THIS whenever a file is large (>200 lines) or the task spans more than 3 files: logs, database dumps, generated code, cross-file reviews, comparisons. The files never enter your context — only the answer does.

deep_search

Delegate codebase archaeology to the Antigravity CLI: git log/diff/blame spelunking, wide greps across a repo, 'when/why did X change', 'where is Y used'. USE THIS instead of running many search commands yourself — it saves your context.

web_lookup

Delegate a web/documentation lookup to the Antigravity CLI (Gemini with web access): library docs, API references, error messages, current versions, external knowledge. USE THIS when you need information you don't have or that may be newer than your training data.

adversarial_review

Get an adversarial second opinion from a different model family (Gemini Pro). ALWAYS use this for plan critiques, design reviews, and pre-merge code review: it hunts for flaws, edge cases, security issues, and unstated assumptions you may have missed.

follow_up

Continue a previous Antigravity session by session_id (returned by every other tool). USE THIS for follow-up questions about a prior delegation — the full prior context is already on agy's side, so you don't resend anything.

delegate

Raw delegation to the Antigravity CLI for heavy tasks that don't fit the other tools. agy has full tool access (shell, file reads, web) in the given cwd.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "agy bridge": {
            "agy-bridge": {
                "command": "npx",
                "args": [
                    "-y",
                    "agy-bridge"
                ]
            }
        }
    }
}

McpServers

{
    "agy-bridge": {
        "command": "npx",
        "args": [
            "-y",
            "agy-bridge"
        ]
    }
}

An MCP bridge that letsClaude 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 viaagy→ only the answer comes back. Large files, deep git searches, and web lookups never touch Claude's context.

User → Claude Code → agy-bridge (MCP) → agy CLI → Gemini / Claude / GPT-OSS ← ← ←

- Node.js 18+
- Antigravity CLI(agy) installed and authenticated
-
Claude Code

# 1. Register the MCP server (user scope = all projects). # add-json bakes in a generous client-side timeout so long analyze_files / # delegate calls don't trip Claude Code's tool-call deadline (see Timeouts). claude mcp add-json -s user agy-bridge \ '{"command":"npx","args":["-y","agy-bridge"],"timeout":600000}' # 2. Add delegation rules to your project (or ~/.claude/CLAUDE.md for global) curl -o CLAUDE.md https://raw.githubusercontent.com/sshahzaiib/agy-bridge/main/CLAUDE.md

The"timeout": 600000(10 min, milliseconds) is theclient-sidetool-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 inTimeouts and cancellation.

All tools accept optionalcwd(project root) andmodel(exact name fromagy models; validated, with available models listed on mismatch).

--- [agy-bridge] model: Gemini 3.5 Flash (High) | session: 1f0c…-d4 (use follow_up to continue)

On first use the bridge runsagy models(cached for the process lifetime) and picks the first available model in the tool's preference chain. If none is available it falls back toAGY_DEFAULT_MODEL, and finally to agy's own default. agy silently ignores unknown--modelvalues, so the bridge validates names up front instead of letting requests land on the wrong model.

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 onRESOURCE_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.

Each tool has its own default timeout sized to its job:web_lookup120s,deep_search180s,analyze_files/adversarial_review/follow_up300s,delegate600s. SettingAGY_TIMEOUTexplicitly overrides all of them at once. To change a single tool, setAGY_TIMEOUT_<TOOL_NAME>instead (e.g.AGY_TIMEOUT_DEEP_SEARCH=300); a per-tool override takes precedence over the globalAGY_TIMEOUTand the tool's default. The full set of per-tool variables isAGY_TIMEOUT_ANALYZE_FILES,AGY_TIMEOUT_DEEP_SEARCH,AGY_TIMEOUT_WEB_LOOKUP,AGY_TIMEOUT_ADVERSARIAL_REVIEW,AGY_TIMEOUT_FOLLOW_UP, andAGY_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 theagy-sidebudget. Your MCP client (Claude Code) has its own, separatetool-calltimeout, and if it is shorter than the agy budget the client gives up first — you'll seeError: timed out waiting for response(note: agy-bridge's own timeout readsagy timed out after Nsinstead). The work is not lost: the agy session persists, sofollow_upwith the returnedsession_idretrieves the result. But the real fix is to make the client wait at least as long as agy: theInstallcommand already sets a per-servertimeoutof 600000ms (scoped to the agy-bridge entry only). If you registered the server without it, re-run theadd-jsoncommand from Install, or set the global env varMCP_TOOL_TIMEOUT=600000. Rule of thumb:clienttimeout≥ 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 simpleanalyze_filesover 3 files measures around40–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.

All optional, via environment variables:

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. SetAGY_ON_FAILURE=strictto 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.

npm install npm test # vitest unit tests (exec mocked — no agy needed) npm run typecheck npm run build # tsup → dist/index.js

Contributions are welcome — open an issue or PR.

This is a web browser that enables your coding agent, such as Claude Code, to visit websites on your behalf and assist you in identifying bugs or creating UI test cases.

Local agent workbench bundling OpenHands, Goose, Aider, and ashlrcode against one local LLM, with ashlr-plugin MCP servers pre-wired.

Unified MCP server providing access to Claude Code, Codex, and Gemini CLIs through a single gateway. Features multi-LLM orchestration, persistent session management, async job execution with polling, approval gates, retry with circuit breakers, and token optimization. Install: npx -y llm-cli-gateway

Intelligent orchestration platform that routes tasks to the best AI model (Claude, Codex, Gemini, OpenCode) using LinUCB bandits, validates through consensus voting, and learns from outcomes. 29 MCP tools, dev pipeline, 8 memory backends.

Agent-native developer Q&A API with MCP + A2A endpoints for citations, job pickup, and answer submission.

Embeds intelligent guidance into AI workflows to organize development and ensure quality.

Open-source AI coding stack — bundled MCP servers, agent runtime, and developer tooling for shipping AI-native dev tools.

Async Parallel Antigravity for Codex & Claude Code

Run parallel, resumable, human-operable Antigravity CLI sessions from Codex, Claude Code, or any MCP-capable agent harness.

knowledge network for AI coding agents. Developers connect their agents to a shared pool of verified solutions — saving tokens, reducing debugging time, and getting better results. Solution authors earn when their work helps others.

Orchestrates multiple Claude Code agents across iTerm2 sessions, providing centralized management and inter-agent communication.

Multi-LLM Design and Build Team. Confer and create with a team of LLMs.

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.