agy-image
Generates images through Google's internal AI image generation endpoint using an existing Google AI Pro quota and Antigravity CLI OAuth login. Provides tools to create images from prompts, select aspect ratios, save the generated image to disk, and report authentication/configuration/quota status.
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., "@agy-image generate a 16:9 image of a mountain sunrise, save as sunrise.png"
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.
agy-image
An MCP server that generates images using the Google AI Pro quota already logged in to the
Antigravity CLI (agy) on your machine — without spinning up the agy agent loop.
It calls the image generation endpoint directly, so a picture takes seconds instead of tens of seconds, and it works headlessly from any MCP client (Claude Code, Cursor, etc.).
⚠️ This targets an internal Google endpoint, not a public supported API. It reuses the credentials and quota of your own
agylogin. Use at your own risk.
How it works
Reads your existing login.
agystores an OAuth token at~/.gemini/jetski-standalone-oauth-token. That file'srefresh_tokenis the only thing this server needs from you — it's produced by logging into the Antigravity CLI once.Refreshes the access token when needed. To do that it needs an OAuth client (id + secret). It reads that pair out of the
agybinary installed on your machine, verifies it against Google's token endpoint, and caches the working pair at~/.cache/agy-image/credentials.json. Nothing is bundled with this package, so no single OAuth client gets shared by everyone who installs it.Calls the endpoint directly.
POST https://daily-cloudcode-pa.googleapis.com/v1internal:generateContent Authorization: Bearer <access token> Content-Type: application/json { "project": "aicode-consumers", "requestId": "image_gen/<epoch_ms>/<uuid>/1", "request": { "contents": [{ "role": "user", "parts": [{ "text": "<prompt>" }] }], "generationConfig": { "candidateCount": 1, "imageConfig": { "aspectRatio": "1:1" } } }, "model": "gemini-3.1-flash-image", "userAgent": "antigravity", "requestType": "image_gen" }Writes the image to disk. The response carries the image inline as base64, which is decoded and saved to the path you asked for.
Falls back to the agent if the direct call breaks. If the request shape ever changes underneath us, it runs
agyin print mode and lets that agent generate the image instead. Slower, but it keeps working. Disable withAGY_FALLBACK=0.
Related MCP server: MCP Image Generator
Install
{
"mcpServers": {
"agy-image": {
"command": "npx",
"args": ["-y", "agy-image"]
}
}
}No credentials or environment variables needed — they're read from your local agy install.
Requirements:
Antigravity CLI installed and logged in at least once, so
~/.gemini/jetski-standalone-oauth-tokenexists and contains arefresh_token.Node.js 18+.
Tools
Tool | Arguments |
|
|
| none — reports config, token, credential source and the last known quota reset, without spending any quota |
Configuration
All optional.
Variable | Default | Purpose |
| read from the | Override the OAuth client, e.g. if Google rotates it |
|
| Where to find the binary to extract credentials from, and to run as fallback |
|
|
|
|
| Set to |
|
| Fallback time limit, in seconds |
|
| Request host |
|
| Image model |
|
| Value of the |
|
| Request timeout, in seconds |
|
| Where the last quota info is cached |
Troubleshooting
HTTP 429 QUOTA_EXHAUSTED— the image model's quota is spent. It's separate from chat quota, and the error message includes the reset time. Fixed window, not a rolling one from your last request.HTTP 403 SUBSCRIPTION_REQUIRED— image models other thangemini-3.1-flash-imagerequire an enterprise license.HTTP 403on an otherwise valid request — a malformedrequestIdis reported this way. The server always generates it correctly; this only shows up if you craft requests by hand.Authentication error: ... token ...— theagylogin is gone. Runagyinteractively once to log in again.File is
.pngbut contains JPEG — the model returns JPEG regardless of the extension you asked for. The response says so whenever the two disagree.Prompt looks different from what you sent —
agyitself enriches prompts before calling the model; this server sends yours verbatim, so results can differ slightly from the CLI.
License
MIT
Available Tools
2 toolsantigravity_statusAntigravity StatusA
Check Antigravity image-generation configuration & auth status. Only inspects local state (token file, model, host) and makes sure the token can be refreshed — it doesn't call the image endpoint, so it doesn't use any quota. Use this when generate_image fails.
Inputs: no named parameters.
generate_imageGenerate ImageB
Generate an image using the logged-in Google AI Pro quota (Antigravity), by calling the image generation endpoint directly instead of running the agy agent.
Inputs: prompt (required), output_path, aspect_ratio.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 2 tools
The two tools have clearly distinct purposes: generate_image performs generation while antigravity_status only inspects local configuration/auth state and uses no quota. An agent can easily tell which to call, and the description of antigravity_status even directs use after generate_image fails.
generate_image follows a clear verb_noun pattern, while antigravity_status is noun_noun naming a status resource. This is a minor, readable deviation within an otherwise consistent snake_case style.
Two tools is on the thin side for a server, though the scope (quota-backed image generation plus diagnostics) is genuinely narrow. The set just barely covers the domain without feeling under-served, landing at borderline.
The core lifecycle of generating an image and diagnosing failures is covered. Minor gaps exist — no way to inspect remaining quota or explicitly refresh/reconfigure auth beyond the status check — but these are workable around for such a focused server.
Maintenance
Related MCP Connectors
Focused MCP server for OpenAI image/audio generation (v2.0.0). Wraps endpoints via HAPI CLI.
MCP server exposing the YourImageShare upload API (upload/list/delete) as tools for AI agents.
Generate AI images and videos from any compatible MCP client.
MCP server for Qwen Image 3 AI image generation
Related MCP Servers
- FlicenseBqualityDmaintenanceAn MCP server that enables image generation using Google's Gemini Nano Banana Pro model via the Google AI Studio API. Users can generate and save images locally by providing text prompts through MCP-compatible clients.1-
- AlicenseAqualityDmaintenanceMCP server for AI image generation supporting multiple providers (OpenRouter, Together AI, Replicate, fal.ai) and compatible with various MCP agents.263 npm1MIT
- FlicenseNot gradedqualityDmaintenanceAn MCP server for AI-powered image processing (generate, edit, vary, analyze) supporting OpenAI, Gemini, Ideogram, and custom relay endpoints.-
- AlicenseAqualityCmaintenanceMCP server for generating images via Google Flow's API without daily quota limits, supporting text-to-image and image-to-image generation.11MIT