Antigravity MCP Server

io.github.x51xxx由 GitHub 帳號 x51xxx 發布v0.3.0更新於 Nov 14, 2026

Hand work from Claude Code or Cursor to Google Antigravity CLI: delegation, reviews, digests

已驗證STDIO僅桌面開發者工具AI 與機器學習

概覽

AI 產生的概覽

把 Claude Code、Cursor 等 MCP 用戶端接到 Google Antigravity CLI,讓助理把提示、計畫、審查與長任務交給其他模型執行。

可以做什麼
  • 透過 Antigravity CLI 執行提示,可選擇模型與 effort、續接工作階段並控制工作目錄
  • 產生僅供規劃的實作計畫、依 git diff 進行的結構化程式碼審查,以及腦力激盪式構想
  • 一次讀取大量檔案或目錄,借助大模型脈絡回答聚焦問題
  • 依序或平行批次執行多個原子任務
  • 啟動背景分離任務與在獨立 git worktree 中執行的長流程委派,並查詢狀態、追加對話或取回結果
  • 列出可用模型與工作階段、檢查 CLI 健康狀態,並輸出版本與 Prometheus 指標
適用情境
適合讓主要助理把範圍明確或耗時較長的工作交給另一個模型家族,取得獨立的唯讀計畫或程式碼審查,或摘要超出呼叫端脈絡的模組與文件。
執行需求
以本機程序方式執行 npm 套件,需要 Node.js 18 以上版本。必須已安裝 Antigravity CLI,並以 Google 帳號互動式登入一次。選用環境變數 AGY_MCP_CWD、AGY_SESSION_TTL_MS、AGY_MAX_SESSIONS 可設定工作目錄與工作階段上限。可用模型取決於使用者的 Antigravity 方案。
安裝前請注意
背景、批次與委派工具預設啟用 skipPermissions,對應自動核准所有工具與命令權限要求的參數,此時代理可讀寫工作樹以外的路徑並執行任意命令;worktree 只隔離 git 狀態,不隔離檔案系統。委派任務可能消耗付費模型額度。digest 會排除憑證類檔案,但其他工具仍可讀取。工作階段存於記憶體,重新啟動即遺失。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Antigravity MCP Server,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

Antigravity MCP Server

MCP (Model Context Protocol) server for Google Antigravity CLI (agy) integration. Lets any MCP client (Claude Code, Claude Desktop, Cursor, etc.) delegate tasks to Antigravity's agentic CLI — with model selection (Gemini, Claude, GPT-OSS), conversation resume, and workspace controls.

For the why behind it, read the project write-up on trishchuk.com. It covers how I use Claude Code or Cursor as the lead engineer and hand bounded work to Antigravity: long tasks delegated to the Gemini 4 Orchestrator in an isolated git worktree, read-only plans and reviews from a different model family, and large-context digests. It also has a table for choosing the right tool, the costs and isolation limits to know before delegating, and where Google's multi-agent tooling is heading.

Requirements

  • Node.js >= 18
  • Antigravity CLI installed (agy --version works) and authenticated (run agy once interactively and sign in with your Google account)

Installation

bash
npm install -g @trishchuk/antigravity-mcp-server

додай Or run from source:

bash
pnpm install && pnpm build

MCP client configuration

json
{  "mcpServers": {    "antigravity": {      "command": "npx",      "args": ["-y", "@trishchuk/antigravity-mcp-server"],      "env": {        "AGY_MCP_CWD": "/path/to/your/project"      }    }  }}

For Claude Code:

bash
claude mcp add antigravity -- npx -y @trishchuk/antigravity-mcp-server

Tools

ToolDescription
ask-antigravityRun a prompt through agy in print mode. Supports model + effort, mode, session resume, --add-dir, --sandbox, --dangerously-skip-permissions, dry-run.
plan-antigravityGenerate a structured implementation plan (JSON or markdown) without mutating anything.
review-changesCollect a git diff (working tree / vs base branch / specific commit) and run a structured code review.
brainstormStructured ideation (divergent, convergent, SCAMPER, design-thinking, lateral).
digest-antigravityIngest many files/directories and answer a focused question using Antigravity's large model context. Credential files (.env, keys…) are withheld.
batch-antigravityRun multiple atomic tasks sequentially or in parallel (priority order, stop-on-error, concurrency cap).
bg-antigravityDetached background tasks: start / status / tail / stop / remove / list. State persists in ~/.agy-mcp/bg/ across server restarts.
delegate-antigravityLong multi-step tasks: runs detached in its own git worktree, on the Orchestrator model by default; live status, follow-up continue turns, result with the agent report + diff.
list-sessionsList / delete / clear conversation sessions.
list-modelsAvailable models (agy models) grouped by family, with the effort levels each accepts and what it is for.
healthDiagnose CLI installation, authentication, models, and session state.
ping, Help, version, metricsUtilities.

Background, batch and delegate tools default to --dangerously-skip-permissions because print mode cannot answer interactive permission prompts; pass skipPermissions: false to opt out. An explicit mode turns that default off (the mode is the permission policy), and mode: "plan" with skipPermissions: true is rejected.

Models

The model parameter takes a display label (Gemini 4 Hydrogen (High)), a full ID (gemini-4-hydrogen-high), or a base ID plus effort (model: "gemini-4-hydrogen", effort: "xhigh"). A base label with effort is rejected by the CLI. As of Antigravity CLI v1.5.9 (availability depends on your plan — list-models shows the live list):

FamilyBase IDeffortWhat it is for
Gemini 4 Hydrogengemini-4-hydrogenlow, medium, high, xhighFast everyday coding and maintenance (upgrades, boilerplate, tests, docs). The implementer inside Orchestrator.
Gemini 4 Argongemini-4-argonlow, medium, highMaximum reasoning depth on every step; planner of Orchestrator (Argon).
Gemini 4 Carbongemini-4-carbonlow, medium, highMaximum-depth reasoning (e.g. designing complex systems); planner of Orchestrator (Carbon). Ultra / Enterprise only.
Orchestrator (Argon)gemini-pro-orchestrator-g1-pro— (fixed)Long tasks: the planner plans and reviews, Hydrogen implements, builds and tests, and hands back on repeated failures. One agent, no parallel subagents.
Gemini 3.8 Flashgemini-3.8-flashlow, medium, high
Claude Opus 5.5claude-opus-5-5low, medium, high
Claude Sonnet 5.5claude-sonnet-5-5low, medium, high
GPT-OSS 120Bgpt-oss-120bmediumScheduled for removal on 2026-11-18.

agy --effort accepts low | medium | high | xhigh | max, but each model supports only the subset above (no current model accepts max); a suffixed ID such as gemini-4-hydrogen-high only accepts its own level. Orchestrator has a fixed thinking level and rejects effort.

Omit model and the server passes no --model flag, so the CLI's own default applies ("model" in ~/.gemini/antigravity-cli/settings.json). The label this server uses in its examples and hints is Gemini 4 Hydrogen (High) — see DEFAULT_MODEL in src/constants.ts.

Delegating long tasks

delegate-antigravity hands a multi-step implementation task to Antigravity and returns immediately:

json
{  "task": "Add rate limiting to the /api routes",  "autoTest": "pnpm test",  "acceptanceCriteria": ["429 after 100 req/min"]}
  • Creates a git worktree on a fresh agy/<random> branch under ~/.agy-mcp/delegations/ and runs agy detached there (survives the MCP call and server restarts).
  • Without model, picks the Orchestrator (Carbon if your plan has it, else Argon); otherwise falls back to Gemini 4 Hydrogen (High).
  • Captures --output-format stream-json: action: "status" shows steps, tool calls, the last command and the latest text; action: "continue" with a message sends a follow-up turn into the same conversation and worktree; action: "result" returns the agent's final report, outcome (finished_reason), token usage and the diff against the base commit (cleanup: true removes the worktree and branch).
  • Per-turn timeout defaults to 2 hours (timeout: 0 = none). stop signals the whole process group (signal: SIGTERM by default, SIGKILL for a run that ignores it).

Sessions and conversation resume

ask-antigravity supports multi-turn conversations:

json
{  "prompt": "Analyze src/auth.ts for security issues",  "sessionId": "auth-review"}
json
{  "prompt": "Now suggest fixes for the issues you found",  "sessionId": "auth-review"}

How it works: in text output agy doesn't print its conversation ID to stdout, so the server passes --log-file to a temp file and parses the ID from it (Created conversation <uuid> / conversationID="<uuid>"). The next call with the same sessionId resumes via agy --conversation <uuid>.

You can also pass a native conversationId directly, or continueLatest: true for agy --continue.

Session storage is in-memory (lost on server restart). Configure with:

  • AGY_SESSION_TTL_MS — session TTL (default 24h)
  • AGY_MAX_SESSIONS — max stored sessions (default 50)
  • AGY_MCP_CWD — default working directory for agy runs. Resolution order: workingDir → AGY_MCP_CWD → the project root of an @path in your prompt (ask, digest, delegate) → the server's launch directory

Safety

  • skipPermissions: true maps to --dangerously-skip-permissions — agy auto-approves all tool/command permission requests. Use deliberately.
  • sandbox: true maps to --sandbox — terminal restrictions enabled.
  • Since CLI 1.5.7 headless runs start in Auto mode where it is available, which edits files without asking. plan-antigravity, review-changes, digest-antigravity and brainstorm therefore pass --settings '{"agentMode":"","permissions":{"allow":[]}}': Default mode, plus your allow-rules suspended for that run (otherwise a pre-approved command such as git checkout still executes). A headless run cannot answer permission prompts, so writes and shell commands are auto-denied; reading files works and the answer still reaches stdout. (--mode plan is not used because it writes the answer into a plan artifact instead.)
  • mode maps to --mode accept-edits | auto | plan; Auto is not available on every account.
  • A delegation worktree isolates git state, not the filesystem: with skipPermissions (the default for background work) the agent can read and write outside it and run any command.
  • digest-antigravity never sends credential-like files (.env*, .npmrc, private keys, *.pem, …) and does not follow symlinks while walking directories.
  • Cancelling a tool call from the client stops the agy / git processes it started; background and delegated tasks keep running until you stop them.
  • An explicit workingDir / cd that does not exist is an error — the server never falls back to another directory.
  • Otherwise agy uses your configured permission rules (/permissions in interactive agy).

Development

bash
pnpm build          # tscpnpm lint           # tsc --noEmitpnpm test           # build + node --testpnpm format         # prettier

License

MIT

來源:README.md,提交 2eefe25

工具

15

ask-antigravity

Execute Google Antigravity CLI (agy) in print mode with model selection, conversation resume, and workspace controls.

輸入參數cdmodemodeldryRuneffortprompt必填addDirssandboxtimeoutsessionIdworkingDirresetSession另有 4 個

batch-antigravity

Delegate multiple atomic tasks to Antigravity for batch processing. Ideal for repetitive operations, mass refactoring, and automated transformations.

輸入參數modemodeltasks必填efforttimeoutparallelworkingDirconcurrencystopOnErrorskipPermissions

review-changes

Run a code review against the current repository using Antigravity (collects git diff + structured review prompt).

輸入參數basemodeltitlecommiteffortprompttimeoutworkingDiruncommitted

plan-antigravity

Generate a structured implementation plan using Antigravity. Use BEFORE coding to get steps, files-to-touch, risks, and open questions. Distinct from ask-antigravity: enforces a plan-only system prompt and parses structured output.

輸入參數goal必填modeleffortformattimeoutacceptanceworkingDirconstraintscontextFiles

brainstorm

Generate creative ideas using structured frameworks with domain context and feasibility analysis.

輸入參數cdmodeldomaineffortprompt必填ideaCountconstraintsmethodologyexistingContextincludeAnalysis

bg-antigravity

Run Antigravity CLI as a detached background task. Subactions: start (returns taskId), status, tail (log output), stop, remove, list. Use for long-running autonomous work — the MCP call returns immediately and you poll status later.

輸入參數cdmodelabellinesmodelaction必填effortpromptsignaltaskIdaddDirssandbox另有 3 個

digest-antigravity

Ingest many files at once and answer a focused question. Uses Antigravity's large model context (Gemini ~1M tokens) to swallow whole modules / docs that don't fit in the caller's context. Walks directories (symlinks are not followed), filters by extension, withholds credential files (.env, .npmrc, keys…), truncates oversized files, caps total payload. Returns a concentrated brief.

輸入參數modelpaths必填shapeeffortexcludetimeoutquestion必填recursiveextensionsworkingDirmaxTotalBytesmaxBytesPerFile

delegate-antigravity

Delegate a long, multi-step implementation task to Antigravity. Runs detached in its own git worktree/branch, by default on the Orchestrator model (planner + Gemini 4 Hydrogen implementer, built for long tasks). Returns a taskId immediately; poll `status` for live progress, `continue` to send follow-up instructions into the same conversation, and `result` for the final answer + diff. The worktree isolates git state only — with skipPermissions (default) the agent can run any command.

輸入參數modetaskmodelactioneffortsignaltaskIdcleanupmessagesandboxtimeoutautoTest另有 5 個

list-sessions

List active conversation sessions with metadata, or manage them (delete/clear)

輸入參數actionsessionId

health

Check Antigravity CLI installation, authentication, available models, and session health

輸入參數verbosesessionId

list-models

List the models available to Antigravity CLI (`agy models`), grouped by family with the `effort` levels each accepts and what it is for. Pass a label, a full ID, or a base ID plus `effort` as the `model` parameter.

無需輸入參數。

ping

Echo

輸入參數prompt

Help

Show Antigravity CLI help output

無需輸入參數。

version

Display version and system information

無需輸入參數。

metrics

Expose Prometheus-formatted metrics for Antigravity MCP server

無需輸入參數。

版本歷史

1
  1. v0.3.0最新Nov 14, 2026

評分

已滿足適用檢查項的 90%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分
  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分