antigravity-cli-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@antigravity-cli-mcp Have agy refactor auth.ts to use async/await, then run the tests"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
antigravity-cli-mcp
A minimal MCP server that exposes Antigravity CLI (agy) as a single tool callable from Claude Code (or any MCP client). This wraps the terminal CLI, not the Antigravity IDE; you need agy installed and signed in.
This project started as gemini-cli-mcp, wrapping Gemini CLI. Gemini CLI is deprecated in favor of Antigravity, so the server now spawns agy instead. The tool interface is the same shape; see Migrating from gemini-cli-mcp.
How it works
Claude Code sends prompts to this server via MCP. The server spawns agy -p "..." in headless mode and returns the response. Antigravity inherits your Google sign-in, so no API key is required.
Claude Code ──MCP/stdio──▶ antigravity-cli-mcp ──spawn──▶ agy -p "..." --output-format json --add-dir <cwd>Related MCP server: agy-headless-bridge MCP server
Prerequisites
Antigravity CLI installed, on your
PATHasagy, and signed in (runagyonce interactively to complete login). Requires a version with headless JSON output (1.1.8 or later; tested against 1.2.7).
Installation
From source
git clone https://github.com/danwahl/antigravity-cli-mcp
cd antigravity-cli-mcp
npm install
npm run buildConfiguration
User install (available across all projects):
claude mcp add antigravity -s user -- npx -y @danwahl/antigravity-cli-mcpProject install (shared with your team via .mcp.json):
claude mcp add antigravity -s project -- npx -y @danwahl/antigravity-cli-mcpOr from source, replace npx -y @danwahl/antigravity-cli-mcp with node /absolute/path/to/antigravity-cli-mcp/dist/index.js.
Verify with claude mcp list.
Tool: cli
Parameter | Type | Required | Description |
| string | yes | Task or question to send to Antigravity |
| string | yes | Absolute path to the working directory (agy's workspace) |
| string | no | Model name, e.g. |
| string | no | Reasoning effort: |
| boolean | no | Default |
| string | no |
|
| string | no | Custom agent name, defined at |
| object | no | JSON Schema enforced on the final answer. The parsed object comes back in |
| string | no | Resume a previous conversation. Returned in the structured output of each call. Pass the same |
| number | no | Seconds before the run is stopped. Default 120. On expiry the call returns an error; any partial response is in the structured output. |
Structured output
Each call returns structured content alongside the text response:
{
"conversationId": "dc381a74-...",
"response": "Antigravity's answer...",
"status": "SUCCESS",
"usage": {
"inputTokens": 12447,
"outputTokens": 122,
"thinkingTokens": 121,
"cacheReadTokens": 0,
"totalTokens": 12569
},
"structuredOutput": null,
"durationSeconds": 2.6,
"numTurns": 1,
"deniedActions": []
}agy's JSON output does not include per-tool call counts or a per-model breakdown, so those fields from the Gemini CLI version are gone.
What Antigravity can do
agy runs with --dangerously-skip-permissions, giving it full tool access: read/write files, run shell commands, web search, and more. Headless agy cannot prompt for permission, so without this flag any tool needing approval is silently denied and the turn ends early. Deny rules in agy's own settings.json still apply; when one fires the call returns an error listing deniedActions.
The cwd you specify is passed as --add-dir so it becomes the agent's workspace; the spawn working directory alone is not enough in headless mode.
--sandbox is on by default as a check against the permission bypass. It restricts shell commands only: they can read anywhere but write only under /tmp. agy's file edit tools can still modify the workspace.
Timeouts and cancellation
The timeout is passed to agy as --print-timeout, so agy stops its own turn at the deadline and returns whatever it has. The server reports that as an error with the partial response in the structured output. If agy fails to exit within a few seconds after that, its process group is killed. Cancelling the MCP call (for example, interrupting Claude Code) kills the agy process group immediately.
Errors
On a model or API failure agy prints an AGY_ERROR: {...} line to stderr and exits with code 3. The server surfaces the status and message from that line as the tool error.
Migrating from gemini-cli-mcp
sessionIdis nowconversationId(both the input parameter and the output field).modelsandtoolsin the structured output are replaced by a singleusageobject.Gemini CLI model aliases (
auto,pro,flash,flash-lite) are not recognized; use a name fromagy models.Re-add the server under the new package name:
claude mcp remove gemini-clithen theclaude mcp addcommand above.
Development
npm run build # compile with tsc
npm test # run unit testsSmoke test
echo '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}' | node dist/index.jsDesign
One tool, no prompt wrappers. Claude Code is the orchestrator: it decides what to ask Antigravity and how to phrase it. This server is a thin, reliable pipe between MCP and agy -p.
See CLAUDE.md for project conventions.
Available Tools
1 toolcliA
Send a task to Antigravity CLI (agy) and return the response. Antigravity runs headlessly with full tool access (file read/write, web search, shell commands) and operates in the working directory you specify via cwd.
When to use this tool:
Delegating rote coding tasks: boilerplate generation, repetitive refactors, bulk edits across many files
Getting a second opinion: code review, architecture feedback, sanity-checking an approach
Research and brainstorming: Antigravity has web search and a large context window, useful for exploring options or summarizing docs
Large file analysis: processing files that would be expensive to handle directly
Parallel workstreams: offloading independent subtasks while you continue other work
Sandbox: on by default. Antigravity's file tools can still edit the workspace, but shell commands can only write under /tmp. Set sandbox: false for tasks whose shell commands must write to the workspace (builds, installs, git commits, test runs that produce files).
Conversation resumption: each response includes a conversationId. Pass it back via the conversationId parameter (with the same cwd) to continue a conversation without re-sending context — useful for multi-step tasks or follow-up questions.
Keep prompts self-contained: include all necessary context in the prompt since Antigravity has no access to your conversation history or MCP state.
Inputs: cwd (required), prompt (required), mode, agent, +6 more. Returns: usage, status, numTurns, response, +4 more
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 1 tool
With only one tool there is no risk of picking the wrong one, so misselection is essentially impossible. However, the tool is an open-ended 'do any task' delegation surface whose boundary against the agent's own native capabilities (code review, research, bulk edits) is fuzzy rather than crisply defined.
A single name can't be internally inconsistent, so there is no convention clash. But 'cli' is a bare noun that describes the transport (command-line delegate) rather than the action, deviating from the verb_noun convention and giving little signal about what the tool actually does.
The entire surface is one catch-all tool, which is thin even for a delegation gateway. Practical needs that would normally be separate operations (cancel/status of a long-running task, list or inspect conversations, choose model/effort) are all collapsed into prompt parameters or unavailable.
Core delegation is covered and thoughtfully so: conversation resumption via conversationId, explicit cwd, and a sandbox toggle for shell-write tasks. Still, there is no way to cancel or poll a long-running job, list prior conversations, or set timeouts/limits, leaving dead ends for multi-step or parallel workflows that the description itself promotes.
Maintenance
Related MCP Connectors
MCP server for your apps' tools and custom tools, plus hosted AI agents and approval-gated workflows
Your org's AI agents, tasks, runs, search, and brain files as MCP tools and resources.
MCP facade over the Nebelus Construction API. ~48 tools give full agent build parity: create/update/probe agents, edit graphs, attach knowledge and vector stores, wire connectors, set governance policies and locked guardrails, enable grounding-trace, and read deployment wiring. Purpose-built for regulated industries: data residency is enforced per region (EU / GCC-KSA), with PII controls and an audit trail. Agents are created as drafts — no deploy tool is exposed over MCP by design; publishing happens in the Nebelus console.
214 tools for AI agents over one MCP endpoint: image, video, audio, 3D, data, storage, mail, GPUs.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables Claude to drive the Antigravity agent by running prompts through the agy CLI non-interactively, supporting session management and optional sandboxed execution.51ISC
- AlicenseBqualityBmaintenanceEnables calling Google's Antigravity CLI (agy) headlessly through MCP, providing tools like agy_ask and agy_research for agents like Claude Code.260 PyPI21MIT
- AlicenseAqualityAmaintenanceMCP 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.6148 npm72MIT
- AlicenseAqualityCmaintenanceLets MCP clients such as Claude Code, Claude Desktop, Cursor, or Codex hand tasks to the Antigravity CLI (agy) so the work runs on the user's Antigravity plan instead of the client's. Exposes tools for delegated coding tasks and reviews, web search with sources, image/PDF analysis, shell command generation or execution, brainstorming, and model/quota checks.7MIT