Mcp Server Google Antigravity

io.github.TurkerYakup由 GitHub 账号 TurkerYakup 发布v1.0.2更新于 Oct 24, 2026

MCP server exposing Google Antigravity (agy CLI / Gemini): jobs, codebase analysis, file tools.

概览

AI 生成的概览

让助手把繁重的编码任务异步交给 Google Antigravity 的 agy CLI 代理,并提供本地文件与文件夹工具。

可以做什么
把 Google Antigravity(由 agy CLI 驱动、底层为 Gemini 的终端编码代理)封装为 MCP 工具。use_antigravity 发起任务并立即返回 jobId;antigravity_result 通过轮询或长轮询获取结果,antigravity_continue 可在同一会话中继续追问。还可列出、取消和清理任务,并提供直接创建、读取和列出文件及目录树的文件系统工具。
适用场景
适合让主助手保持轻量,把耗时或整仓库级别的工作(如全仓库分析、网页搜索、搭建文件、长时间编辑)交给后台的第二个代理。也适合在委派任务的同时快速创建或读取本地文件与文件夹。
运行要求
以 npm 包形式通过 stdio 在本地运行(npx mcp-server-google-antigravity 或全局安装)。需要 Node.js 18+、已安装并用 Google 账号登录的 Antigravity CLI(agy),以及 Claude Desktop 或 Claude Code 等 MCP 客户端。所有环境变量均为可选;若 agy 不在 PATH 中,可能需要设置 AGY_PATH。
安装前请注意
AGY_AUTO_APPROVE 默认为 true,会传入 --dangerously-skip-permissions,使 agy 无需确认即可创建和编辑文件并执行终端命令;处理不可信提示时应使用 sandbox 或把 auto_approve 设为 false。add_dirs 会授予 agy 对这些文件夹的读写权限,服务器自带的文件工具也会直接写入而不弹权限提示。任务经由 Google 的 agy CLI 执行,提示内容和文件内容会发送到该服务。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Mcp Server Google Antigravity,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

text
   ____ _                 _  / ___| | __ _ _   _  __| | ___ | |   | |/ _` | | | |/ _` |/ _ \ | |___| | (_| | |_| | (_| |  __/  \____|_|\__,_|\__,_|\__,_|\___|
               |          +----+----+          |   MCP   | (- you are here          +----+----+               |
     _          _   _                       _ _    / \   _ __ | |_(_) __ _ _ __ __ ___   _(_) |_ _   _   / _ \ | '_ \| __| |/ _` | '__/ _` \ \ / / | __| | | |  / ___ \| | | | |_| | (_| | | | (_| |\ V /| | |_| |_| | /_/   \_\_| |_|\__|_|\__, |_|  \__,_| \_/ |_|\__|\__, |                      |___/                       |___/

Let Claude (or any MCP client) hand its heavy work to Google Antigravity's agy agent.

[npm] [MCP] [Node] [Platforms] [Agent] [License]


What is this?

mcp-server-google-antigravity is a small MCP (Model Context Protocol) server. It exposes Google Antigravity — Google's terminal coding agent, driven by the agy CLI (Gemini under the hood) — as a set of tools any MCP client can call.

The idea: your primary model (Claude Desktop, Claude Code, Codex, …) stays lean and delegates the grunt work — web search, whole-repo analysis, scaffolding files, long-running edits — to a second agent running in the background. Jobs are async and unlimited: you fire a task, get a jobId instantly, and poll for the result while the caller keeps working.

   Claude / Codex          this MCP server            Antigravity  +---------------+  tool  +----------------+ spawns  +--------------+  |  "analyze the | -----> | use_antigravity| ------> | agy  --print |  |   whole repo" |        | -> jobId(async)|         | (Gemini)     |  +---------------+ <----- +----------------+ <------ +--------------+        keeps working        polls result / logs        does the work

Requirements

NeedWhy
Node.js 18+Runs this server (ships with npx/npm). Check: node --version
Antigravity CLI (agy)The agent this server drives. Install below.
An MCP clientClaude Desktop, Claude Code, or anything that speaks MCP

Step 1 — Install the Antigravity CLI (agy)

Never used agy before? Start here. It's one command. First launch signs you in with Google.

macOS / Linux

bash
curl -fsSL https://antigravity.google/cli/install.sh | bash

Windows (PowerShell)

powershell
irm https://antigravity.google/cli/install.ps1 | iex

Windows (CMD)

cmd
curl -fsSL https://antigravity.google/cli/install.cmd -o install.cmd && install.cmd && del install.cmd

Where it lands (remember this — you may need it for AGY_PATH below):

OSDefault agy location
macOS / Linux~/.local/bin/agy
WindowsC:\Users\<you>\AppData\Local\agy\bin\agy.exe

Sign in and verify:

bash
agy            # first run opens a Google Sign-In in your browser (creds cached in your OS keyring)agy --version  # should print a version, e.g. 1.1.1agy models     # lists the models you can use (Gemini 3.5 Flash, Gemini 3.1 Pro, ...)

If agy isn't found afterwards, open a new terminal (so PATH reloads) or run agy install to fix shell paths.


Step 2 — Get this MCP server

Option A — npx (recommended): Skip straight to Step 3 and use the npx config. The npx path works seamlessly from the public npm registry with no authentication required.

Alternatively, you can install the package globally:

bash
npm install -g mcp-server-google-antigravity

This exposes the mcp-server-google-antigravity command (which you can register directly in your MCP client's config instead of npx).

Option B — from source (for hacking on it):

bash
git clone https://github.com/TurkerYakup/mcp-server-google-antigravity.gitcd mcp-server-google-antigravitynpm installnpm run check   # quick syntax check

node-pty (used only for clean output on Windows) is an optional dependency — if it can't build on macOS/Linux the install still succeeds and the server falls back automatically. No compiler needed.


Step 3 — Register it with your MCP client

Claude Desktop

Edit your claude_desktop_config.json:

OSConfig file
macOS~/Library/Application Support/Claude/claude_desktop_config.json
Windows%APPDATA%\Claude\claude_desktop_config.json
Linux~/.config/Claude/claude_desktop_config.json

Using npx (Option A) — recommended:

json
{  "mcpServers": {    "antigravity": {      "command": "npx",      "args": ["-y", "mcp-server-google-antigravity"],      "env": {        "AGY_MODEL": "Gemini 3.5 Flash (Medium)",        "AGY_AUTO_APPROVE": "true"      },      "timeout": 900000    }  }}

Windows note: Electron (Claude Desktop) often can't spawn npx directly — if the server fails to start, wrap it in cmd: set "command": "cmd" and "args": ["/c", "npx", "-y", "mcp-server-google-antigravity"] (keep the same env/timeout).

From source (Option B): set "command": "node" and "args": ["/absolute/path/to/mcp-server-google-antigravity/index.js"] instead. On Windows use forward slashes, e.g. "C:/path/to/mcp-server-google-antigravity/index.js".

Restart the app fully after editing (quit from the tray/menu bar, not just close the window).

Claude Code (CLI) — works on macOS, Windows, Linux
bash
# npx (Option A)claude mcp add antigravity -- npx -y mcp-server-google-antigravity
# from source (Option B)claude mcp add antigravity -- node /absolute/path/to/mcp-server-google-antigravity/index.js

That's it. Your client now has tools like use_antigravity, antigravity_continue, and the filesystem helpers.


Quick example

Ask your MCP client something like "use antigravity to analyze the repo at C:/Dev/Repos/foo and summarize its architecture". Under the hood the client calls:

  1. use_antigravity({ prompt: "...", add_dirs: ["C:/Dev/Repos/foo"] }) → returns { "jobId": "mrib1q20_wa5ma1", "status": "running" } instantly.
  2. antigravity_result({ jobId, wait_ms: 10000 }) → blocks/long-polls until the job is done or the 10-second wait elapses. While still running, it returns a lean payload containing status, character count, and the last 200 characters of output ({ status, jobId, chars, tail, startedAt }). Once complete, it returns the full record (including durationMs and bytes telemetry).

Follow up in the same session with antigravity_continue({ prompt: "now list the top 3 risks" }). Need agy to write files? Pass add_dirs so it has a workspace; auto_approve (default) lets it create/edit without prompts.


Configuration (environment variables)

Everything is optional — sane defaults out of the box.

VarDefaultWhat it does
AGY_PATHauto-detectedFull path to the agy binary. Only needed if it's not on PATH. On Windows the path is auto-collapsed to an 8.3 short path, so a non-ASCII username no longer breaks anything.
AGY_MODELagy's defaultDefault model when a call omits model. Use the exact name from agy models, e.g. Gemini 3.5 Flash (Medium).
AGY_AUTO_APPROVEtruePass --dangerously-skip-permissions so headless jobs don't hang on a prompt. Set false for read-only.
AGY_SANDBOXfalseRun every job with --sandbox (terminal-restricted). Cheap; safer for untrusted prompts. Per-call sandbox overrides.
AGY_PRINT_TIMEOUT10magy's --print-timeout.
AGY_HEARTBEAT_MS15000Interval for the "job running" progress notification. 0 disables.
AGY_MODEL_TTL_MS300000How long the cached agy models list is trusted.

Tools

ToolWhat it does
use_antigravityDelegate a task (async). Returns a jobId immediately. Params: prompt, thinking_depth (low/high), add_dirs (folders agy may read/write), auto_approve, new_project, model, mode (plan/accept-edits), agent, project, sandbox, write_to_file, extract (optional "last_code_block" to extract the last code block to the extracted field on the record).
antigravity_continueContinue the previous conversation (or a specific conversation_id) with a new prompt.
antigravity_resultGet a job's result by jobId. Supports long-polling via optional wait_ms and poll_interval_ms. While running, returns a lean payload ({ status, jobId, chars, tail, startedAt }). On done/error, returns full record (including durationMs and bytes telemetry).
antigravity_jobsList recent jobs and statuses.
antigravity_cancelKill a running job by jobId.
antigravity_cleanupDelete old job files by age (older_than_hours).
antigravity_create_folderCreate a folder (recursive), done directly by the server.
antigravity_create_fileCreate/write a text file (creates parent dirs); overwrite:false to protect existing.
antigravity_create_treeBuild a whole folder/file tree from a JSON spec.
antigravity_read_fileRead a UTF-8 text file (instant); optional max_bytes cap.
antigravity_list_dirList a folder's entries.
antigravity_modelsList available models (agy models).
antigravity_agentsList available agent profiles (agy agents).
antigravity_healthCheck that agy is reachable + report effective defaults. Run this first when something's off.

The server-side filesystem tools use Node's fs directly — instant, and never gated by a permission prompt.


Live progress notifications

Because jobs return a jobId immediately, the server pushes MCP logging notifications (notifications/message, logger antigravity) so the client can see activity without polling:

  • job started — jobId, kind, prompt snippet
  • job running — heartbeat every AGY_HEARTBEAT_MS (default 15s) with a tail of the current partial output
  • job done / job failed — final status, byte count / error

Best-effort: if the client didn't negotiate the logging capability they're silently dropped. Polling antigravity_result works either way.


How it works (design notes)

The agy CLI runs a single prompt with agy --print "<prompt>" and returns when done. Three problems and their fixes:

  1. MCP client request timeout (~60s). Long tasks made the client give up even though agy kept running. → Async job pattern: use_antigravity spawns agy in the background, returns a jobId instantly, writes the result to a JSON file in the OS temp dir (agy_jobs/), and the client polls antigravity_result. Optional long-polling (wait_ms) lets clients wait inside the request when short runs are expected. No request ever blocks.
  2. agy's own print timeout (default 5m). Heavy prompts hit timeout waiting for response. → every job passes --print-timeout 10m.
  3. Headless file-permission gate. In --print mode agy's file-writes get denied by the "ask" policy and the job hangs. → auto_approve (default true) passes --dangerously-skip-permissions; add_dirs passes --add-dir <path> for the workspace it needs.

Security note

auto_approve defaults to true (--dangerously-skip-permissions) — agy will create/edit files and run terminal commands without prompting. This is intentional: in headless --print mode agy otherwise blocks on a permission prompt and the job hangs. For untrusted prompts, prefer sandbox: true (terminal-restricted, cheap — a permission layer, not a VM) over turning auto-approve off. Use auto_approve: false only for genuinely read-only asks.


Platform support

Fully cross-platform — macOS, Windows, and Linux. Windows gets a node-pty path for clean streaming (with an automatic fallback if it's unavailable) and auto 8.3 short-path resolution for non-ASCII usernames; macOS/Linux use plain child_process. The only per-OS difference is where agy lives and where your client's config file is (both covered above).


Troubleshooting

SymptomFix
agy not found / server won't startOpen a new terminal so PATH reloads, or run agy install. Still stuck? Set AGY_PATH to the full binary path (Step 1 table). The antigravity_health tool confirms whether the server sees agy.
Job stays running foreveragy is probably waiting on a permission prompt. Keep auto_approve at its default true (headless mode hangs otherwise). Watch progress via antigravity_jobs or the job's partial field.
Model '...' was not found warningAdvisory only — the job still runs. Use the exact name from antigravity_models (they contain spaces, e.g. Gemini 3.5 Flash (Medium)).
Windows: path breaks on a non-ASCII usernameHandled automatically — the server resolves agy to its 8.3 short path. No action needed.
First run wants you to sign inRun agy once in a terminal to finish the Google Sign-In; credentials are then cached in your OS keyring.
Client reports "tool timed out"Raise the client's own timeout (e.g. 900000 ms in Claude Desktop). Jobs are async so the call returns instantly, but some clients still enforce a ceiling.

License

MIT © Türker Yakup Altınsoy.

来源:README.md,提交 f22b60f

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v1.0.2最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分