gemini-relay
Gemini Relay is a local MCP server that lets your coding agent delegate large-context reading, analysis, planning, image generation, and brainstorming to Google Gemini, returning only concise answers instead of filling the agent's context window.
ask-gemini: Ask questions, review code, or request changes; include files/folders with
@, choose model/effort/mode, enforce JSON schema output, resume conversations, get token usage, and receive structured changeMode edits.gemini-plan: Generate architectural and implementation blueprints, dependency analysis, and risk assessments without modifying code.
gemini-image: Generate images from text descriptions, choose aspect ratios, and save them directly into your project workspace.
brainstorm: Structured ideation using frameworks like SCAMPER or Design Thinking, with constraints, domain context, and feasibility analysis.
gemini-models: List available Gemini models, defaults, reasoning capabilities, and backend status.
gemini-doctor: Diagnose CLI/agy installation, backend, login, version, and remaining quota.
fetch-chunk: Retrieve additional cached chunks from a prior changeMode response.
ping and Help: Verify server connectivity and get the active backend CLI's help.
Enables image generation through Google Imagen with selectable aspect ratios and saving generated assets to the workspace path.
Provides access to Google Gemini models via the Antigravity CLI, supporting configurable reasoning effort, planning mode, structured JSON schema outputs, token usage metrics, and workspace context inlining.
TL;DR — Gemini Relay is a bridge between your coding agent and Google Gemini. Claude asks, Gemini answers, and Claude keeps working. Image generation, a second pair of eyes on your code, plans, brainstorms, huge files, and models Claude cannot reach on its own. Ask in plain English. Point at files with
@, or let Gemini find them itself.
What is this?
Claude is a great coding agent. It is also one model, with one set of strengths and one quota.
Gemini Relay is a small MCP server that sits beside it. Your agent sends it a request, the request goes to Google Gemini through the Antigravity CLI, and the answer comes back as if Claude had done the work itself. No copy-pasting between two chats. No switching windows.
That turns Gemini into a set of tools Claude can pick up whenever they fit: draw an image, review a diff, design a refactor, read a folder that would never fit in its window, or ask a different model the same question and compare.
Gemini can read the project on its own, too. Point it at files with @ when you want exactly those. Say nothing and it goes looking.
Related MCP server: MCP Gemini Server
What Gemini brings
Things Claude gets by having Gemini next door.
Images. Gemini generates pictures. Claude does not. Ask for a hero image for the README, an icon, a diagram, a mock screenshot, and it lands in your repo as a file.
A second opinion. A review from a different model catches different bugs. Hand Gemini a diff or a folder and get back a report that Claude did not write, then let Claude act on it.
Plans and brainstorms. A dedicated planning tool for architecture and refactors, and a brainstorming tool with a choice of methods, both run on Gemini's deepest reasoning.
Big reading. Gemini takes the files, Claude takes only the answer. The 181 KB package-lock.json in this repo would cost Claude roughly 45,000 tokens to open. Sent through the relay it came back in 19 seconds as one line:
{ "count": 392 }
More models, more quota. Whatever Antigravity offers is available: Gemini Flash and Pro at every effort level, plus Claude and GPT-OSS models on a separate quota bucket. When one well runs dry, another is a parameter away.
Install
You need two things: this server, and Google's Antigravity CLI that it drives.
1. Install the CLI and sign in.
curl -fsSL https://antigravity.google/cli/install.sh | bash
agyRun agy once and it walks you through signing in. On Windows, use the official installer from https://goo.gle/gemini-cli-migration instead of the curl line.
2. Add the server.
Claude Code, one command:
claude mcp add gemini-relay -- npx -y gemini-relayClaude Desktop, in claude_desktop_config.json:
{
"mcpServers": {
"gemini-relay": {
"command": "npx",
"args": ["-y", "gemini-relay"]
}
}
}Cursor and Windsurf: add a server named gemini-relay with the command npx -y gemini-relay.
3. Check it. Ask your agent to run gemini-doctor. It reports whether the CLI was found, whether you are signed in, and how much quota is left. It costs nothing to run.
Node 18.19 or newer.
What you can ask for
Talk to your agent normally. These are the shapes that work.
You want to… | Say something like |
Make a picture | "Use gemini-image for a 16:9 dark hero image, save it to |
Get a second review of your code | "Have gemini review |
Ask another model the same question | "Ask gemini the same question, but with Claude Opus." |
Get a plan before you write anything | "Use gemini-plan to design retry with backoff for the upload queue." |
Kick ideas around | "Brainstorm ten ways to cut our cold-start time." |
Let Gemini go find the problem itself | "Ask gemini to find the riskiest code in this repo." |
Look at something too big to open | "Ask gemini what's in |
Get an answer your code can parse | "Ask gemini for the outdated deps as JSON." |
Pick up an earlier thread | "Run gemini-conversations and continue the one about the upload queue." |
Stop a run that is taking too long | "Run gemini-cancel." |
See what models you have | "Run gemini-models." |
Find out why it broke | "Run gemini-doctor." |
@ accepts a file, a folder, @. for the whole project, or a glob like @src/**/*.ts.
Eleven tools, every one prefixed gemini-. Every parameter, every default. A twelfth, gemini-timeout-test, appears only when GEMINI_MCP_TEST_TOOLS is set.
Tool | Parameter | Type · default | Notes |
|
| string, required | Supports |
| string | Any id | |
|
| Thinking depth. | |
|
|
| |
| object | string | Enforces structured JSON. Suppresses | |
| string[] | Extra directories agy may see. | |
| string | Resume a thread. A plain reply reports the id it created or continued. | |
| string | Run a custom | |
| boolean · | Let a | |
| boolean · |
| |
| boolean · | Appends tokens and timing. Ignored with | |
| boolean · | Forwarded, but agy does not isolate tool execution headless, and says so in a notice. The legacy | |
| boolean · | Gemini emits | |
| number | string | Which chunk (1-based). With | |
| string | Exactly 8 lowercase hex characters, or the call is refused. | |
|
| string, required | The thing to plan. |
| string | Constraints, or | |
| string · | Pinned unless you override it. | |
|
| ||
| string[] | ||
| boolean · | Never reports a conversation id. | |
|
| string, required | |
| enum · |
| |
|
| Omit to let Gemini pick. | |
| string | Relative workspace path. Escaping the root is refused. | |
|
| string, required | |
|
| ||
| string | ||
| integer · | ||
| boolean · | Never reports a conversation id. | |
|
| string, number — both required | Both reported by the initial |
|
| integer · | Recent conversations from agy's local store, newest first: id, last activity, cwd, first prompt. Max 100. No model turn. |
| — | Kills every CLI run in flight. Each cancelled call returns an error to its caller. | |
| — | Live catalogue from | |
| — | Binaries, versions, backend, plus login and quota via a free | |
|
| string · | Answered in process. Proves the transport is alive, not the CLI. |
| — | The backend CLI's own |
One rule for every flag. The relay sends a flag only when the installed agy advertised it in --help. If that probe finds nothing, no flags are sent at all and the run falls back to agy's defaults — an unknown flag makes agy exit non-zero and fails the whole request.
Models. Gemini 3.8 / 3.7 / 3.6 Flash in high, medium and low; Gemini 3.1 Pro in high and low; plus claude-sonnet-4-6, claude-opus-4-6-thinking and gpt-oss-120b-medium, which draw on a separate quota bucket.
What @ actually sends. A file inlines. A folder or @. inlines the text files beneath it. A glob inlines its matches. A token that resolves to nothing is left in the prompt verbatim. During folder and glob expansion node_modules, .git, dist and secret-looking files are skipped — name @.env directly and it is sent. Any file is dropped if it is binary, unreadable, or past the budget of 256 KB per file and 2 MB per prompt; a cut file carries TRUNCATED:, and dropped files are named in OMITTED: and UNREADABLE: footers. Nothing outside the project root is ever read.
Variable | Default | What it does |
| resolves by date |
|
| auto-detected | Full path to |
| auto-detected | Full path to the legacy |
|
| Wrapper timeout in minutes. Fractions accepted. Read once at load. |
| derived | Go duration forwarded to |
| unset |
|
| unset | Registers the test-only |
Going deeper
Everything technical lives here, so this page can stay short.
Every tool schema, recipes, and how to spend a context window well | |
What happens between your question and the answer | |
What | |
The catalogue, reasoning effort, and the quota buckets | |
Parameters and defaults, in long form | |
The errors you will actually see, and what to do | |
Why the backend moved, and what the code still guards against |
Good to know
Gemini reads your project on its own. Not only what you send with
@. It has file, search, web, memory and shell tools, and it uses them in whatever folder the server runs in.mode: "plan"keeps a run read-only.Headless runs are not sandboxed. Asking for
sandboxforwards the flag but does not isolate tool execution on theagybackend, and you get a notice saying so. Your ownagypermission settings are what hold.Secrets are skipped when a folder is expanded, not when you name one.
@.envsends the file.Quota is shared with your other agy use.
gemini-doctorshows what is left, free of charge. Claude and GPT-OSS models sit on their own bucket.Windows finds
agyat%LOCALAPPDATA%\agy\bin\agy.exe. If the server cannot see it, setAGY_CLI_PATHto the full path.Nothing leaves your machine except the prompt. Files are read locally and sent to Google as prompt text, the same as if you had pasted them.
Working on it
npm run doctor # is the environment sane
npm test # 150 unit + integration tests
npm run test:e2e # build, then drive the real CLI
npm run lint # type-check source and tests
npm run build # compile to dist/Support
If this saves you tokens or time, buy me a coffee.
License
MIT — see LICENSE.
Available Tools
11 toolsgemini-askA
Send one prompt to Google Gemini (or the Claude and GPT-OSS models the Antigravity CLI also offers) and get the answer back: questions, code review, analysis, edits, structured JSON. Reference project files with @path to send their contents along. Pass conversationId to continue a thread. For a phased implementation blueprint use gemini-plan; for idea generation use gemini-brainstorm; for everything else use this.
Inputs: prompt (required), mode, agent, model, +11 more.
gemini-brainstormA
Generate a ranked list of ideas for an open-ended challenge using a named creativity method (SCAMPER, design thinking, lateral, divergent, convergent), with optional feasibility analysis. Ideation only: use gemini-ask for answers and gemini-plan for implementation blueprints.
Inputs: prompt (required), model, domain, effort, +5 more.
gemini-cancelA
Stop every Gemini CLI run the relay has in flight right now: a slow gemini-ask, gemini-plan, gemini-brainstorm or gemini-image. Each cancelled call returns an error to its caller. Nothing else is touched.
Inputs: no named parameters.
gemini-conversationsA
List recent Gemini conversations the relay can resume: id, last activity, working directory, first prompt. Pass an id to gemini-ask as conversationId to continue that thread. Reads agy's local store; no model turn.
Inputs: limit.
gemini-doctorA
Diagnose and verify Gemini CLI / Antigravity CLI (agy) installation, active backend, CLI version, and system readiness.
Inputs: no named parameters.
gemini-fetch-chunkA
Retrieve one chunk of a chunked changeMode reply from gemini-ask, by the cacheKey and chunkIndex that reply reported. No model turn; the cache lives 10 minutes.
Inputs: cacheKey (required), chunkIndex (required).
gemini-helpA
Print the active backend CLI's own --help text (agy or gemini), to see which flags the installed version supports.
Inputs: no named parameters.
gemini-imageA
Generate images from text descriptions through the Antigravity CLI's image generation tool. Supports aspect ratio and output size selection, plus optional export directly into your project.
Inputs: prompt (required), size, outputPath, aspectRatio.
gemini-modelsA
Lists available Gemini models, default selections, reasoning capabilities, and active backend status.
Inputs: no named parameters.
gemini-pingA
Liveness check: echoes the prompt back from the relay itself, without touching the CLI or any model. Use gemini-doctor to check the CLI.
Inputs: prompt.
gemini-planA
Produce a read-only, phased implementation blueprint for one task — steps, dependencies, risks — on Gemini's highest reasoning effort. Never edits files and never answers general questions; use gemini-ask for those.
Inputs: task (required), model, effort, addDirs, +2 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 11 tools
Each tool targets a distinct mode: gemini-ask for general answers, gemini-plan for blueprints, gemini-brainstorm for ideation, and gemini-image for generation. The descriptions explicitly cross-reference which tool to use, so there is little risk of selecting the wrong one.
All tools share the gemini- prefix and kebab-case style, making the family instantly recognizable. However, gemini-models and gemini-conversations are noun-style subcommands while others like gemini-ask and gemini-fetch-chunk are verb-style, a minor deviation from a strict verb_noun pattern.
11 tools is well within the ideal range and each tool earns its place: four generation modes, conversation and chunk retrieval support, cancellation, and diagnostics. There is no obvious redundancy or padding.
The surface covers generation, planning, ideation, images, conversation resumption, chunked-response retrieval, cancellation, and environment diagnostics—no dead ends for the relay's stated purpose. Optional capabilities like conversation deletion are not implied by the server's scope.
Maintenance
Related MCP Connectors
MCP server unifying ERPs, CRMs, APIs and knowledge base for Claude, ChatGPT and Gemini.
Shared memory MCP server for Claude Code, Codex, Gemini CLI and Cursor. Cited, editable.
Chat, image, video, and audio models from many vendors behind one remote MCP server and one key.
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Related MCP Servers
- AlicenseAqualityDmaintenanceModel Context Protocol (MCP) server implementation that enables Claude Desktop to interact with Google's Gemini AI models.6264MIT
- FlicenseNot gradedqualityDmaintenanceA server implementing the Model Context Protocol that enables AI assistants like Claude to interact with Google's Gemini API for text generation, text analysis, and chat conversations.-
- AlicenseNot gradedqualityNot gradedmaintenanceAn MCP server implementation that allows using Google's Gemini AI models (specifically Gemini 1.5 Pro) through Claude or other MCP clients via the Model Context Protocol.1MIT
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol (MCP) server implementation for the Google Gemini language model. This server allows Claude Desktop users to access the powerful reasoning capabilities of Gemini-2.0-flash-thinking-exp-01-21 model.1MIT