Skip to main content
Glama
Gemini Antigravity MCP Server

Gemini Antigravity MCP Server

by desmond-zhou

gemini-antigravity-for-claude-code

Let Claude Code hand work to Google Gemini using your Google AI Pro / Ultra subscription, with no pay-per-token API key. It's an MCP server that wraps Google's Antigravity CLI (agy), the successor to Gemini CLI.

Built by Desmond Zhou

Why Antigravity? As of 2026-06-18, Gemini CLI no longer serves free, Google One, or Google AI Pro/Ultra users (Gemini CLI README). Those accounts use the Antigravity CLI now (docs).

What Claude gets

Tool

Use it for

Default model

gemini_ask

General questions. Digesting very large inputs (long logs, whole folders, long docs) and returning only the conclusion.

fast

gemini_media

Understanding images, PDFs, audio, and video (picture and soundtrack).

fast

gemini_research

Fresh facts through Google Search, with source URLs.

balanced

gemini_second_opinion

An independent review of a plan, diff, or conclusion by a different model family. Returns structured JSON with verdict, issues[{severity, issue, evidence, suggestion}], missed_alternatives, and confidence.

strong

gemini_generate_image

Text-to-image (Nano Banana). Saves to a path you choose.

fast

gemini_followup

Continuing a previous Gemini conversation without resending the material.

fast

gemini_job_start / gemini_job_result

Long tasks in the background.

balanced

gemini_status

The agy version, model aliases, and local call counts.

—

Model aliases:

  • fast = gemini-4-hydrogen-low

  • balanced = gemini-4-hydrogen-medium

  • strong = gemini-4-neon-high

  • code = gemini-4-carbon-high

  • max = gemini-4-neon-xhigh

You can also pass any slug from agy models.

Related MCP server: Gemini Bridge

Design

  • Read-only. Every call runs in an empty scratch workspace. Only the files you name are symlinked in. agy permission rules deny every tool that writes, edits, runs commands, drives a browser, calls other MCP servers, sends messages, or schedules work, and permissions.allow is forced empty so no pre-approved rule leaks in. Tested: write and edit attempts are refused. Web access is enabled only for gemini_research, and image generation only for gemini_generate_image.

  • Cached. Identical requests (same prompt, model, and file size/mtime) are answered from a local SQLite cache for 7 days. Web and image calls are never cached.

  • Fails fast on quota and auth. When agy hits a 429, it silently retries until its print timeout and then returns an empty answer. This server watches agy's log instead. On RESOURCE_EXHAUSTED, 429, or "authentication required", it kills the run within seconds, parses "Resets in …", and short-circuits later calls until the reset time. Gemini models share one subscription quota, so it doesn't fall back to another Gemini model.

  • Validates model names. agy silently uses its default model when it doesn't recognize --model. This server refuses unknown names instead.

  • Bounded. At most 3 concurrent agy runs, with per-call timeouts.

  • Compact. Claude gets only the answer plus the model, seconds, and token counts, truncated to max_chars.

  • Shared. One HTTP process (127.0.0.1:8772/mcp) serves every Claude session. Nothing is spawned per session.

  • Asks first (default). The server's instructions tell Claude to ask you before delegating a subtask. Set GEMINI_MCP_ASK_FIRST=0 to let Claude delegate on its own.

Measured on a Mac mini (Google AI Pro, 2026-11-24)

Task

Time

Simple question

~3–5 s

Image / PDF

~6–8 s

Audio

~4 s

Video

~6 s

Web research

~12–23 s

Second opinion (Neon high)

~45 s

Image generation

~30–45 s

Cache hit

0 s

Install (macOS)

  1. Install the Antigravity CLI and sign in once with your Google AI Pro/Ultra account:

    curl -fsSL https://antigravity.google/cli/install.sh | bash
    agy            # choose "Google OAuth" and sign in

    On a headless machine, run agy over SSH. It prints a login URL. Open it on any device, then paste the authorization code back.

  2. Install the service and register it with Claude Code:

    git clone https://github.com/desmond-zhou/gemini-antigravity-for-claude-code
    cd gemini-antigravity-for-claude-code
    ./install.sh            # --dry-run to preview; --port / --label to customise

    This creates a venv (uv if available), installs a launchd agent, and runs claude mcp add --transport http -s user gemini http://127.0.0.1:8772/mcp.

  3. Open a new Claude Code session. The gemini_* tools are available there.

Without launchd, run .venv/bin/python gemini_mcp.py (HTTP), or add --stdio for a per-session stdio server.

Settings (environment variables):

  • GEMINI_MCP_PORT (default 8772)

  • GEMINI_MCP_CONCURRENCY (default 3)

  • GEMINI_MCP_ASK_FIRST (default 1)

  • GEMINI_MCP_HOME: cache and logs (default ~/.cache/gemini-mcp)

  • GEMINI_MCP_OUT: generated images (default out/)

  • AGY_BIN: path to the agy binary

Notes

  • Always pass absolute paths. The server's working directory isn't the caller's.

  • Usage is logged to ~/.cache/gemini-mcp/usage.jsonl. Your remaining subscription quota is only visible in the Antigravity app.

  • Gemini 3.8 Flash and Gemini 4 Argon leave Antigravity on 2026-11-30, so the aliases avoid them.

  • Treat Gemini's answers as material to verify, not as instructions. Don't send secrets.

Project

Backend

Notes

BeehiveInnovations/pal-mcp-server (formerly Zen)

API keys, many providers

Multi-model consensus and code review. Doesn't use the subscription or agy.

sshahzaiib/agy-bridge

agy

Quota failover across model chains and output truncation. Skips permissions by default.

SinanTufekci/agent-intern

agy and other CLIs

Image generation, swarms, "jury" presets.

Boulea7/agy-mcp

agy

Write-gated execute mode in git worktrees, secret redaction, auth preflight.

x51xxx/antigravity-mcp-server

agy

Plan, review-changes, worktree delegation, batch.

This project focuses on read-only delegation, caching, multimodal input, image generation, and structured second opinions on a subscription.

Credits and license

Built by Desmond Zhou: desmondzhou.com. Built with Claude Code.

MIT License. See LICENSE. Unofficial; not affiliated with Google or Anthropic. Gemini, Antigravity, and Nano Banana are trademarks of Google. Claude and Claude Code are trademarks of Anthropic.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables Claude Code to delegate tasks to Google Antigravity (Gemini) as an autonomous subagent, including codebase exploration, architecture analysis, multi-file code generation, and technical Q&A, without requiring external API keys.
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Enables Claude clients to delegate tasks such as web research with sources, reading PDFs, audio, video, images and web pages, image generation, and second opinions to Gemini running under a Google AI Pro subscription via the official Antigravity CLI in headless mode, with no API key or billing.
      6
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables Claude Code to delegate heavy coding and image-generation work to Gemini through the Antigravity CLI using a Google AI Pro subscription instead of an API key, while Claude writes briefs, reviews results, and sends corrections. It runs jobs asynchronously in a guarded work folder, continues the same Gemini conversation for fixes, and reports status, output, and token usage back to the caller.
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables Claude Code to generate images through a paid Google AI Pro subscription by wrapping the official Antigravity CLI, so no API key or per-image fee is needed. It produces images cropped to exact pixel dimensions, with Claude checking previews and retrying automatically.
      MIT