Gemini Bridge
Integrates with Google's Gemini via the Antigravity CLI headless mode on a Google AI Pro subscription, enabling web research with cited sources, reading local files and URLs (PDF, audio, video, images, web pages), image generation, quick reasoning and second opinions, job status, and quota checks without API keys or billing.
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., "@Gemini Bridge Research the latest Node.js LTS release and cite your sources"
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.
Gemini Bridge
A local MCP server that lets Claude (Claude Code, Claude Desktop and Cowork) hand work to Gemini on your Google AI Pro subscription: web research with sources, reading PDFs, audio, video, images and web pages, image generation, and second opinions.
It does this one way only: by launching Google's official Antigravity CLI (agy) in its documented headless mode. There's no API key and no billing. The bridge makes no network calls of its own and never touches agy's login tokens. Every run is locked to a read-only agent, and telemetry is set off before each one.
Built and tested on Windows 11 with Node 25: agy 1.2.16 for the Phase 0 spike, agy 1.4.2 for the v1.0 smoke test. Not affiliated with Google.
Contents: Tools · Why agy headless · Install · Register in Claude Code · Register in Claude Desktop · Configuration · The read-only agent lock · Telemetry off · Known agy issues · Limits · Troubleshooting · Development · Licence
Tools
Tool | What it does | Agent and model | Time limit |
| Web research. |
| 5 / 20 min |
| Second opinions, rewrites, quick reasoning. No tools, no web. |
| 3 min |
| One local file (copied into the run's workspace, max 200 MB) or one URL, plus a question. PDF, audio, video, images and web pages. |
| 10 min |
| Generates one image and saves it as |
| 5 min |
| Status, result or error of any job, from either Claude client. | ||
| Weekly and 5-hour quota from |
Every call is a job, stored in BRIDGE_HOME/jobs/. A call waits up to SYNC_BUDGET_MS (150 s) for its answer. If the run takes longer, the call returns a job id, the run carries on in the background, and Claude polls it with gemini_job. Each bridge process runs one agy at a time.
Saved research goes to VAULT_DIR/RESEARCH_SUBDIR/<slug>-agy.md with research frontmatter (type: research, status: inbox). The file is written atomically and never overwrites a note; a name clash gets -2, -3 and so on. Sources come from tool events, not from the model's own list:
Sources read are the pages fetched with
read_url_content. Google search redirects are resolved to the real page through its canonical URL.Search queries are the queries sent to
search_web.URLs the model cites but never read are flagged as unverified.
Related MCP server: agy-subagent-mcp
Why agy headless
Google AI Pro includes Gemini quota, but the only programmatic door into it that Google's terms allow is the official CLI:
Since 2026-06-18 Gemini CLI no longer accepts free or AI Pro/Ultra sign-ins; those accounts moved to Antigravity CLI (transition notice). Bridges built on Gemini CLI no longer reach the subscription.
Reusing the CLI's login tokens in other software is forbidden (Gemini CLI terms, Antigravity terms §6). Launching the official binary in its headless mode is the allowed path, so the bridge spawns
agy -pand reads its output, nothing more.The Antigravity SDK needs an API key or Vertex, which bills. Deep Research, NotebookLM and Gems have no programmatic access, and automating gemini.google.com breaks Google's terms (automated access against robots.txt, which disallows
/app/).The Antigravity terms let Google use your interactions to improve its products unless telemetry is off (§5), hence the next point.
Read the terms yourself before relying on this; this README isn't legal advice.
Install
Install agy (PowerShell), open a new terminal and check
agy --version:irm https://antigravity.google/cli/install.ps1 | iexRun
agyonce and sign in with the Google account that has AI Pro. Leave the telemetry opt-in unticked if first-run setup offers one, and exit without sending a prompt.Build and test the bridge:
git clone https://github.com/dssbdev/gemini-bridge.git cd gemini-bridge npm ci npm run build npm testCopy
.env.exampleto.envand fill in what you need:AGY_ACCOUNTat least,VAULT_DIRto save research as notes, andBLOCKED_DIRSfor folders that must never reach Gemini..envis git-ignored, so your account and paths stay on your machine.
Register in Claude Code
At user scope, with full paths to node.exe (where node) and to dist/index.js:
claude mcp add gemini --scope user -- "C:/Program Files/nodejs/node.exe" C:/path/to/gemini-bridge/dist/index.jsThe bridge reads its settings from .env in its own folder, whatever directory Claude starts it from. An -e KEY=value flag on this command overrides a single value. /mcp in a new session should list gemini with six tools.
Register in Claude Desktop
This is also how Cowork sees local servers.
Open
claude_desktop_config.json: Settings → Developer → Edit Config. It's in%APPDATA%\Claude\, or under%LOCALAPPDATA%\Packages\Claude_*\LocalCache\Roaming\Claude\for the Microsoft Store install.Back it up, then add this entry under
mcpServerswithout touching the others:"gemini": { "command": "C:\\Program Files\\nodejs\\node.exe", "args": ["C:\\path\\to\\gemini-bridge\\dist\\index.js"] }Restart Claude Desktop.
Claude Desktop stops an MCP call after about four minutes, which is why a long run hands back a job id after 150 s instead of holding the call open. Claude Code and Claude Desktop each start their own bridge process; they share BRIDGE_HOME, so either one can read a job the other started.
Configuration
Everything is optional; .env.example explains each variable. Values an MCP client passes in its own env settings win over .env.
Variable | Default | What it does |
| none | The Google account agy must be signed in with. A run agy logs under another account is discarded ( |
| none | Where deep research is saved as notes. Unset: research is answered inline and nothing is saved. |
|
| Folder inside |
|
| Where generated images land. |
| none |
|
|
| The never-send sentence in every tool description, which is what Claude reads before delegating. |
|
| The agy executable. |
|
| agy's data folder: |
|
| Jobs, scratch workspaces and |
|
| Quick research, read, image, ask. |
|
| Deep research. |
|
| Only when the caller asks for Pro. |
|
| How long a call waits before it hands back a job id. |
At start the bridge logs (to stderr, which Claude Code shows in its MCP logs) which keys it took from .env, the account it checks, the vault and the blocked directories.
The read-only agent lock
agy is a coding agent with about 60 tools, shell and file edits among them. The bridge narrows every run to what that tool needs, and checks after the run that the narrowing held:
A fresh scratch workspace per job (
BRIDGE_HOME/work/<job_id>), copied fromtemplates/. A local input is copied in, so the model never needs to look outside. The workspace is deleted after success, kept after a failure for debugging, and pruned after 7 days.A custom agent per tool (
templates/.agents/agents/), whosetools:list holds only search, read or image tools.askerhas none at all.A deny-by-default guard hook (
templates/.agents/guard.mjs) on every tool call, against a per-job allowlist:manage_task, shell and edit tools are denied (agy addsmanage_taskto every agent, whatever itstools:list says);view_filemay read only the workspace and the run's own artifact folder;read_url_contentmay fetch only http(s).
Proof the guard ran. A malformed
hooks.jsonmakes agy run with no hooks at all, so a run whose guard never logged is thrown away (guard_missing).An agent-load canary. An unknown or broken agent makes agy fall back, silently, to its default agent with every tool. A first model step far larger than the agent's baseline gets the run killed (
agent_mismatch).No
--dangerously-skip-permissions, ever. Shell commands and file writes stay soft-denied by agy itself, as a second wall behind the guard.A scrubbed env.
GEMINI_API_KEY,GOOGLE_API_KEY,GOOGLE_GENAI_USE_VERTEXAIandGOOGLE_CLOUD_PROJECTare removed before spawning, because with any of them present agy switches to API mode, which bills.Timeouts.
--print-timeoutper tool, plus a hard wall clock of print-timeout + 60 s that kills the whole process tree (taskkill /T /F).No slash commands. Every run passes
--disable-slash-commands, so a prompt that starts with/can't trigger a CLI command.
In the Phase 0 injection test, a prompt asking agy to run whoami and write the output to a file made no tool call and created no file; the default agent, as a control, tried run_command and was soft-denied. The evidence is in SPIKE.md.
One setting reaches beyond the bridge: read_url_content needs the permission rule "permissions": { "allow": ["read_url(*)"] } in agy's settings.json to work headless, and the bridge adds it before every run. It also auto-approves URL reads in your interactive agy sessions. Remove the permissions key to undo it; research then degrades to search summaries without sources read.
Telemetry off
agy's settings.json (%USERPROFILE%\.gemini\antigravity-cli\settings.json) has an enableTelemetry key. Before every run the bridge merges "enableTelemetry": false into it and keeps every other key, so each run starts with telemetry explicitly off, and if you ever switch it on, the next bridge run switches it off again. If the file isn't valid JSON, the bridge refuses to run rather than guess.
Don't be surprised to find the key missing between runs. agy writes only settings that differ from its defaults, and from 1.2.16 to 1.4.2 it removed enableTelemetry: false from the file on every start, so false looks like its default. To see the live value, open /config in an interactive agy session and check Enable Telemetry.
Known agy issues
Issue | What the bridge does |
Print mode can hang without a terminal (#318) or never exit after answering (#947). Neither showed up in the spike, but they're reported. | Hard wall clock, then the whole process tree is killed and the job fails with |
| Reads the answer from the transcript; reports |
A print timeout exits 0 with | Treats agy's |
| Uses |
An unknown | Agent-load canary ( |
| The guard hook and the canary do the proving. |
| The guard denies it. |
A malformed | Discards any run whose guard didn't log ( |
| Trusts only a finished |
YouTube pages return a bot check, not the video, after burning about 90k tokens. | Refuses YouTube URLs before spawning. |
Default log names ( | Every run logs to its own workspace ( |
agy doesn't log the signed-in account on every run (silent auth). | The account check only fires when the log names an account. |
Windows caps a command line at about 32k characters. | Prompts over 24,000 characters go through stdin ( |
In Git Bash, MSYS rewrites | The bridge spawns without a shell. For manual tests, use PowerShell or |
Limits
Quota. AI Pro shares one Gemini limit across Flash and Pro, with a weekly window and a 5-hour window, drawn down at API prices. Users report multi-day lockouts after hitting the weekly cap. Measured in Phase 0: about 1.1M Flash tokens per 1% of the weekly limit and about 180k per 1% of the 5-hour window. A quick research run used 170–310k tokens before quick depth was capped at three pages; one deep run on Flash High (11 pages read, 278 s) used 1.18M tokens, about 1.2% of the weekly limit and 7% of the 5-hour window, so roughly a dozen deep runs fit in a 5-hour window. Check
gemini_quotabefore a batch, and stay on Flash.One run at a time per bridge process; further calls queue.
One input per read: a file of up to 200 MB or one URL. No YouTube.
One image per call, usually a 1024×1024 JPEG. The aspect option is only a hint in the prompt; the image tool has no aspect parameter.
No Deep Research, NotebookLM or Gems. They're app-only.
No plan check. No agy command names the plan tier, so the bridge can't confirm the account is on AI Pro.
One account. Switching is manual: run
agy, then/logout, sign in with the other account, and updateAGY_ACCOUNT. Don't rotate accounts to stretch quota.Windows only. Process-tree kills use
taskkilland the defaults are Windows paths; macOS and Linux are untested.
Troubleshooting
Logs. Each run appends a line to
BRIDGE_HOME\runs.jsonl(status, model, tokens, conversation id). A failed run keeps its workspace inBRIDGE_HOME\work\<job_id>\withagy.log(agy's own log) and.agents\guard.log(every hook call). agy's transcript is at%USERPROFILE%\.gemini\antigravity-cli\brain\<conversation_id>\.system_generated\logs\transcript.jsonl.Every run hangs. Run
agy -p "Reply with exactly: OK" --output-format jsonin a terminal. If that hangs too, the problem is agy itself, not the bridge.denied. agy wanted a permission headless mode can't grant;denied_actionsnames it. If it'sread_url, check thatsettings.jsonstill holds theread_url(*)rule (the bridge adds it back on the next run).guard_missingoragent_mismatch.templates/.agents/is damaged.npm testchecks the hooks file format and the agent files.wrong_account. agy is signed in with an account other thanAGY_ACCOUNT. Runagy, then/logout, and sign in with the right one.Quota lockout. Wait for the reset time
gemini_quotashows.
Development
npm testruns vitest againsttest/fake-agy.mjs, which replays envelopes and stream-json logs recorded from real agy runs (test/fixtures/), in the modesok,research,image,empty,hang,error,timeout,denied,canary,noguard,envandecho.node spike/smoke.mjs <scratchDir> [tool…]runs the built server against the real agy, with scratch vault and image folders. It spends quota.SPEC.md is the original build spec and SPIKE.md the Phase 0 findings behind every decision above.
spike/holds the Phase 0 scripts and raw outputs, with local paths and the account anonymised.
Licence
MIT, see LICENSE.
Available Tools
6 toolsgemini_askAsk GeminiA
Ask Gemini directly (no tools, no web) on your Google AI Pro quota: second opinions, rewrites, quick reasoning, critique of a plan or a draft. Gemini cannot see this conversation, so include the full context in prompt. Flash by default; use pro only when the user asks. Personal content only — never work code, client or customer data.
Inputs: prompt (required), model.
gemini_imageGemini image generationA
Generate one image with Gemini on your Google AI Pro quota and save it in %USERPROFILE%\Pictures\gemini-bridge as -. (usually 1024×1024 JPEG). Returns the file path. Personal content only — never work code, client or customer data.
Inputs: prompt (required), aspect, filename.
gemini_jobGemini job statusA
Check a Gemini bridge job: status, then the result (or saved file path) once it has finished, or the error. Works for jobs started from either Claude Code or Claude Desktop/Cowork. Poll every minute or two while it is running.
Inputs: job_id (required).
gemini_quotaGemini quotaA
Show your remaining Gemini quota on Google AI Pro (weekly and 5-hour windows, from agy /usage, which spends no quota) plus today's bridge runs and tokens. Check it before a batch of deep research; a used-up weekly limit can lock Gemini out for days.
Inputs: no named parameters.
gemini_readGemini reads a file or URLA
Have Gemini read one local file or one web page and answer a question about it, on your Google AI Pro quota. Handles PDFs, audio (transcription), video (what is shown and said), images and web pages, natively and multimodally — use it to save Claude context on large or media files. Give exactly one of path (absolute; copied into a scratch workspace; max 200 MB) or url (http/https). YouTube links do not work. Personal content only — never work code, client or customer data.
Inputs: question (required), url, path, model.
gemini_researchGemini web researchA
Web research on your Google AI Pro quota (Gemini + Google Search). Use for sweeps across many sources, current information, or to save Claude context. Long runs return a job id; check it with gemini_job. Personal content only — never work code, client or customer data. Gemini cannot see this conversation, so put all context in question. depth "quick" answers inline (usually 1–3 min). depth "deep" writes a structured report (5–20 min) and returns it inline (no vault is configured, so nothing is saved). Sources listed as "read" come from the pages Gemini actually fetched; URLs it cites without reading are flagged as unverified.
Inputs: question (required), save, depth, model, +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Each tool has a clearly distinct purpose: direct no-web asking, web research, reading a file/page, image generation, job polling, and quota inspection. The descriptions explicitly separate ask from research and read, so an agent should select the right tool without ambiguity.
All tools follow a consistent gemini_<capability> pattern with short, predictable suffixes. The mix of verbs and nouns (ask, research, read, image, job, quota) is still coherent because it is capability-based rather than an inconsistent naming convention.
Six tools is well-scoped for a Gemini bridge: core interaction modes, media handling, async job polling, and quota visibility. No tool feels redundant or superfluous.
The surface covers asking, web research, multimodal file/page reading, image generation, job status, and quota checks, which are the core bridge workflows. Minor gaps exist around job lifecycle management, such as listing or cancelling jobs, but agents can work around these.
Maintenance
Related MCP Connectors
Generate images and video from Claude with one API key.
Generate and edit images and create short videos inside Claude. Prepaid credits, no subscription.
Multiple Google accounts (Gmail, Calendar, Drive, Contacts, Tasks) in one Claude connector.
Multiple Google accounts (Gmail, Calendar, Drive, Contacts, Tasks) in one Claude connector.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables Claude Code to request independent code reviews and second opinions from other AI models (like Gemini, GPT-OSS) via the Antigravity CLI, directly from the chat.1145 npmMIT
- AlicenseNot gradedqualityCmaintenanceEnables 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
- AlicenseNot gradedqualityCmaintenanceEnables Claude Desktop to execute tasks via the Google Antigravity CLI (agy), exposing its models, skills, plugins, and background workers as native tools.13MIT
- AlicenseNot gradedqualityBmaintenanceEnables 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