agy-mcp

agy-mcp

This MCP server bridges Claude Code with the Antigravity CLI (agy), allowing Claude to delegate tasks to Google Gemini models via configurable difficulty tiers. It verifies the actual backend model for every call, provides separate tools for safe ask/research vs. shell exec, and supports long-running background jobs.

Category
访问服务器

README

agy-mcp

Personal tool, published as-is. This is not a product: it is not on npm, it is not maintained for anyone else, and there is no support. The repository is archived — read it, copy from it, fork it freely, but do not expect issues or pull requests to be answered. If you want something maintained, agy-bridge is an actively developed alternative with a broader tool surface.

An MCP stdio server that makes the Antigravity CLI (agy) a first-class tool inside Claude Code — and verifies, on every single call, which backend model actually answered.

If you pay for both Claude Code and Google AI Pro, this lets you spend the cheaper subscription on the cheaper work without leaving Claude Code. Claude stays the driver; agy becomes a tool it can hand a task to.

You  →  Claude Code  →  agy_ask(tier: "trivial")  →  agy  →  Gemini Flash
                                                       ↓
                                   [verification] OK — served by "Gemini 3.6 Flash (Low)"

Why not an LLM gateway or proxy

The common way to mix providers is to point Claude Code's Anthropic API traffic at a proxy that translates it to another vendor's API. That means intercepting requests, and often reusing credentials issued to a different client.

This server does none of that. There is no proxy, no API translation, no credential relay, and nothing is re-signed or intercepted. Claude Code talks to Anthropic on your Anthropic account. agy talks to Google on your Google account, through Google's own official CLI, exactly as if you had typed the command yourself. All this server does is let Claude spawn that CLI as a subprocess and read its output.

Check your own subscriptions' terms and decide for yourself whether this fits them. This README makes no legal claim on your behalf.

What you get over calling agy through Bash

  • Backend verification on every call. agy's --model flag is not always honoured, and the model's own self-report will not tell you. Every result is prefixed with a [verification] line naming the model that really served it, parsed out of agy's own log.
  • Known-broken model ids are refused by default, rather than silently answering from the wrong model.
  • New routing bugs are detected on their own — see Model routing verification.
  • Difficulty tiers, not model ids. Claude picks trivial / standard / hard / reasoning, and the server resolves that against the live model list.
  • No shell permission prompt per call, and no risk of the command being reshaped by a shell wrapper.
  • Long runs do not die on the tool timeout. A deep research call hands back a job_id; the run continues in the background and Claude collects it with agy_result.
  • The dangerous capability is a separate tool (agy_exec), so the rest can be allowlisted safely. See Security model.

Requirements

  • Node.js ≥ 18 (zero dependencies)
  • The Google Antigravity CLI (agy) installed, on PATH, and signed in
  • Claude Code

Built and tested against agy 1.1.9.

Install

Not published to npm, and there are no plans to. Clone it and point Claude Code at the script — there is nothing to build, and no dependencies to install.

git clone https://github.com/Sh3rm/agy-mcp.git
cd agy-mcp
npm test          # optional; needs neither agy nor network

Register with Claude Code

MCP servers can be registered at three scopes. Pick the one that matches how you want to use it. Use the absolute path to bin/agy-mcp from your clone.

User scope — available in every project on this machine. Most people want this.

claude mcp add agy --scope user -- /absolute/path/to/agy-mcp/bin/agy-mcp

Project scope — checked into the repo, shared with your team. Creates or updates .mcp.json in the project root.

claude mcp add agy --scope project -- /absolute/path/to/agy-mcp/bin/agy-mcp

The resulting .mcp.json:

{
  "mcpServers": {
    "agy": {
      "type": "stdio",
      "command": "/absolute/path/to/agy-mcp/bin/agy-mcp",
      "args": [],
      "env": {}
    }
  }
}

Local scope — this project only, not shared.

claude mcp add agy --scope local -- /absolute/path/to/agy-mcp/bin/agy-mcp

Then verify:

claude mcp list

Restart Claude Code after registering, and the six agy_* tools appear.

Tools

Tool Purpose Key parameters
agy_ask General delegation: research, summarising, codegen, conversions. Cannot grant shell or file access. prompt, tier, model, parallel_subagents, effort, conversation_id, continue_conversation, wait_seconds
agy_research Web research with Google Search grounding and parallel subagents. Also exec-free. question, plus the common parameters above
agy_exec Local shell and file access on this machine. Prompts every time by design. everything in agy_ask, plus workdirs, sandbox
agy_result Collect a long run that handed back a job_id. job_id, wait_seconds
agy_models Live model list, current tier map, blocked ids, observed misroutings.
agy_selftest Call every model once and report which backend really served it. Run this after agy update.

Difficulty tiers

Tiers resolve against the live model list from agy models, by pattern — highest version wins, broken ids are skipped. A new Gemini generation is adopted with no code change.

Tier Resolves to Use for
trivial Gemini Flash, low effort single-fact lookups, formatting
standard Gemini Flash, medium effort everyday tasks, straightforward search
hard Gemini Flash, high effort multi-step work needing a capable model
reasoning Gemini Pro genuinely hard synthesis
claude Claude Sonnet when the Gemini tiers are not enough
claude_max Claude Opus quota-constrained, use sparingly

Model routing verification

agy has had model ids that silently route to a different backend — the flag is accepted, the response looks normal, and the model's own claim about its identity is not reliable. Confirmed on 1.1.7 and still present on 1.1.9:

gemini-3.1-pro-high   →  actually served by "Gemini 3.6 Flash (High)"
gemini-3.5-flash-low  →  actually served by "Gemini 3.5 Flash (Medium)"

This server runs every call with --log-file and parses agy's own line:

Propagating selected model override to backend: label="..."

The requested id and the reported label are compared by normalisation, not against a lookup table:

normalize(s) = s.toLowerCase().replace(/[^a-z0-9]/g, '')
match if normalize(label).startsWith(normalize(requestedId))

Because there is no hardcoded table, a routing bug introduced in a future agy build is caught the same way the known ones are. When a mismatch is detected the server names the model that actually answered, records it in ~/.local/state/agy-mcp/mismatches.json, and surfaces it in agy_models.

The two ids above are seeded as blocked and refused by default; pass force_broken_model to override and get an explicit warning instead of silent wrong-model output.

Security model

The reason there is a separate agy_exec tool is that MCP permission rules in Claude Code match on tool name only — there is no argument-level matching. If local execution were a boolean parameter on agy_ask, allowlisting agy_ask would allowlist arbitrary shell access.

So the capability is split:

  • agy_ask and agy_research can never give agy shell or file access, whatever arguments are passed. Safe to allowlist.
  • agy_exec is the only path to --dangerously-skip-permissions. Do not allowlist it. Let it prompt every time.

A suggested allowlist for ~/.claude/settings.json, deliberately excluding agy_exec:

{
  "permissions": {
    "allow": [
      "mcp__agy__agy_ask",
      "mcp__agy__agy_research",
      "mcp__agy__agy_result",
      "mcp__agy__agy_models",
      "mcp__agy__agy_selftest"
    ]
  }
}

What agy_exec does and does not enforce

workdirs is required and validated before agy is started. Every entry must be an absolute path to an existing directory; symlinks are resolved first, and the filesystem root, the home directory and system roots are refused outright — those are the over-scopes people reach for by accident. The first entry also becomes the working directory of the agy process, so relative paths resolve inside the scope. sandbox defaults to true, enabling agy's own terminal restrictions; the safer setting is what you get by not thinking about it.

Be blunt about the limit of all this: it constrains the invocation, not the agent. agy still runs with --dangerously-skip-permissions and has a shell. Writing "read-only" into the prompt is an instruction to the model, not an enforced sandbox — a request that will probably be respected, never a guarantee. This project does not claim to jail agy, and you should not describe it that way to your users.

Configuration

Variable Default Meaning
AGY_BIN agy Path to the agy binary

State (detected misroutings, background jobs) lives in ~/.local/state/agy-mcp/.

Known limitations

  • The seeded broken-model list is tied to an agy version. It may be stale in either direction. Run agy_selftest after agy update to re-map.
  • agy may decline remote-host work framed as a security audit. Describing the task accurately — your own machine, access already configured, a configuration inventory rather than a security analysis — is usually what was missing.
  • /usage is not reachable headlessly. agy usage needs a real TTY; agy -p "/usage" returns a generic description, not real quota data.
  • Headless agy cannot prompt for permission, which is exactly why file and shell work needs agy_exec.
  • Parallel subagents in --print mode are real — each has a conversation tree under ~/.gemini/antigravity-cli/brain/<id>/ with genuine search grounding. The mechanism is trustworthy; individual figures can still be stale, so spot-check anything load-bearing.

Disclaimer

Unofficial and unaffiliated. Not endorsed by Google or Anthropic. "Antigravity", "Gemini", "Claude" and "Claude Code" belong to their respective owners; they are used here only to describe what this tool interoperates with.

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选