antigravity-desktop-live-quota-mcp
A zero-dependency, localhost-only MCP server that gives AI agents live visibility into Google Antigravity Desktop's model quotas and the badge UI.
Check live quotas (
get_quota_status) — get remaining percentages, reset countdowns and usage for Gemini (5-hour and weekly), Gemini Argon, and Claude/GPT; optionally include the rawlanguage_serverresponse or force a cache-clearing cloud refresh.Refresh the title-bar badge (
reinject_badge) — rebuild and refresh the live quota badge in the Antigravity Desktop window, with aforceflag to reinstall even if already present.Inspect server instance (
get_instance_status) — report the process PID,LEADER/STANDBYmulti-window role, and active lock file path.Clean scratch files (
clean_scratch_cache) — safely remove Antigravitybrain/*/scratch/leftovers, withdry_runsize preview and anolder_than_hoursfilter.Stay private — all calls stay on
127.0.0.1against the local language server; no external network traffic or analytics.
Integrates with Google Antigravity Desktop to read live AI model quota status and reset countdowns, force-refresh quota data, and reinject quota badges into the application’s title bar.
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-desktop-live-quota-mcp Show my live model quota percentages and reset countdowns."
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-desktop-live-quota-mcp
English · Türkçe
See your AI model quotas at a glance — right in the Antigravity title bar.
Google Antigravity Desktop hides your Gemini, Claude and GPT quotas behind menus. This tool puts them where you can always see them: a live badge in the window's title bar with remaining percentages, reset countdowns and the model you're using right now. It is also a zero-dependency MCP server, so your AI agents can query the same quota data.
git clone https://github.com/Mefamex/antigravity-desktop-live-quota-mcp.git
cd antigravity-desktop-live-quota-mcp
make install # then fully restart Antigravity Desktop onceWhat is Antigravity? Google Antigravity is Google's agentic IDE / desktop app for working with AI coding agents (Gemini, Claude, GPT). Its usage is limited by rolling 5-hour and weekly quotas per model group.
Author | |
Website | |
License | MIT |
Stack | Python ≥ 3.10, pure standard library (zero dependencies) |
Platform | Linux (Arch, Ubuntu, Wayland/X11) & Windows 11 |
Status | ✅ Production ready (v1.4.0) |
1. Architecture & Preview
Data Flow
[ Antigravity Desktop Window ]
│
├── DevToolsActivePort ──> [ discovery.py ] ──> [ cdp_client.py (RFC-6455) ]
│ │
└── language_server ──> [ quota_client.py ] ────────┴──> [ title-menu-bar ]
(ConnectRPC) (forceRefresh=true) (live badge)The badge is injected into the title bar ([data-testid="title-menu-bar"]) over the Chrome DevTools Protocol. Quota data comes from Antigravity's own local language_server — nothing leaves your machine.
Key Metrics
Cold start:
~56–68 ms(about 6× faster than the official Python MCP SDK).Memory:
~9–12 MB RAM(no extra runtime or virtualenv).External dependencies:
0(standard library only:socket,fcntl,struct,urllib).UI footprint:
~400 pxwide,24 pxtall — does not squeeze the title bar controls.
Related MCP server: Usage Monitor
2. Repository Doc Map
File | Purpose |
Project overview, architecture and usage guide (this file) | |
Turkish version of this README | |
Security model and the local CDP trade-off | |
Internal technical memory, rejected approaches, constraints (Turkish) | |
Roadmap and completed-work log (Turkish) | |
3-layer settings engine ( | |
Self-documenting lifecycle commands ( | |
One-command MCP registration and badge injection |
3. Key Features
All 5 quota types in one place:
⚡G(Gemini Flash/Pro and others, 5-hour and weekly),Ar(Gemini Argon, weekly) andC(Claude/GPT, 5-hour and weekly), tracked at the same time.Live reset countdowns: computed from
resetTimeinstead of static labels (0:50h,6.8d,7.0d). A local DOM loop (every 5 s) ticks the timers without any network traffic.Active model highlight: the model used in the current chat is matched against the API's
quota.groups[].description/displayName(with keyword fallback so new models are picked up automatically), and its label (⚡G:,Ar:,C:) is highlighted with a bright pill and soft glow.Click to force refresh: clicking the badge sends
{ forceRefresh: true }to refresh the language server's cache. A monotonic sequence (fetchSeq) stops stale responses from overwriting fresh data.Rate-limit friendly: background polling is tuned to avoid cloud rate limits (
60 sbrowser loop,120 snotification check, no double refresh while the badge is active), and the workinglanguage_serverendpoint is cached for instant local calls.Full RFC-6455 WebSocket client, no dependencies: reassembles fragmented frames and handles
Ping/Pong/Closecontrol frames. The in-pageMutationObserveris debounced withrequestAnimationFrameto avoid needless re-injection on React re-renders.Multi-window safe: an OS file lock (
fcntl.flock) elects a singleLEADERwhen several windows or CLIs run. Others wait inSTANDBYand take over automatically if the leader exits.Responsive styling:
clamp(6px, 1vw, 12px)andflex-shrink: 0keep the badge readable on HiDPI and fractional-scaling displays.Burn-rate analytics: separate history buffers for the 5-hour Gemini (
g5h) and Claude/GPT (c5h) buckets. The tooltip shows hourly usage and estimated time to depletion (🔥 ~X%/hr (Est. depletion: ~Ym)); a bucket's history resets automatically when its quota refills by more than 5%.Desktop notifications: a native notification (
notify-sendon Linux) when a quota drops to a critical level (≤ 15%) or refills back to90%+, with a 30-minute anti-spam cooldown.Portable install:
install.shresolves the realantigravitybinary from$PATHand standard locations (skipping the managed wrapper to avoid recursion).One-click scratch cleanup: the
clean_scratch_cachetool andmake clean-scratchsafely remove temporary session leftovers from Antigravity's brain directory.
4. Tech Stack & Prerequisites
OS: Linux (Arch, Ubuntu, Debian, Fedora, … — Wayland or X11) and Windows 11 (
v1.4.0+).Interpreter: Python ≥ 3.10 (system Python is fine, no virtualenv needed).
Target app: Google Antigravity Desktop 2.x.
External dependencies: none (
dependencies = [], nopipornpmpackages).
5. Installation & Quick Start
1. Clone the repository
git clone https://github.com/Mefamex/antigravity-desktop-live-quota-mcp.git
cd antigravity-desktop-live-quota-mcp2. Install with one command
# Registers the MCP server, sets permissions, installs the persistent CDP launcher (2.33+) and injects the badge
make installNote for Antigravity Desktop ≥ 2.33.0: starting with
2.33.0, Google turned off the default--remote-debugging-port=0switch.make install(ormake enable-cdpon its own) sets up~/.local/share/applications/antigravity.desktopand~/.local/bin/antigravityso they survive app updates — nosudoneeded. After the first install, fully close and reopen Antigravity Desktop once. If you don't want to open the local CDP debugging port, use./install.sh --no-cdp-launcherto get only the MCP quota tools and desktop notifications (see Section 8).
Windows 11 quick start (v1.4.0+)
python -B main.py --enable-cdp-windows
# Fully close and reopen Antigravity Desktop, then:
python -B main.py --status
python -B main.py --injectTo start it automatically in the background, run scripts\install-windows-startup.cmd.
3. Manual setup (alternative)
Add this entry to the "mcpServers" block in ~/.gemini/config/mcp_config.json:
"antigravity-desktop-live-quota-mcp": {
"command": "python3",
"args": [
"-B",
"/path/to/antigravity-desktop-live-quota-mcp/main.py"
],
"disabled": false
}6. Configuration
config.py applies 3 layers of settings:
Environment variable (ENV) ──> config.py constants ──> safe in-code defaultsAny setting can be overridden with an environment variable, without touching the code:
Variable | Default | Description |
|
| How often the in-page JS loop polls the local quota (ms) |
|
| How often the leader checks that the window and badge exist (s) |
|
| How often the leader checks quotas for desktop notifications (s) |
|
| Controls the background watcher thread ( |
|
| Green indicator threshold ( |
|
| Yellow indicator threshold ( |
|
| Critical quota red pulse animation threshold ( |
|
| Enables the pulse animation |
|
| Enables desktop notifications |
|
| Critical quota notification threshold ( |
|
| Cooldown between repeated alerts for the same quota pool (min) |
|
| Sends a notification when a quota refills to |
7. Usage & CLI Reference
7.1. Make targets
make help # List all targets with descriptions
make status # Print the live quota report and open windows as JSON
make inject # Force-inject the badge into the open Antigravity window
make enable-cdp # Install the user-level persistent CDP launcher (2.33+)
make test-notify # Send a sample critical-quota desktop notification
make test # Run cold start, leader lock, failover and injection tests
make verify # Clean build leftovers and run the full test chain (pre-commit/push)
make clean # Remove bytecode and cache leftovers
make clean-scratch # Remove Antigravity brain scratch/ temporary session files7.2. MCP tools
AI agents (gemini, claude, codex, …) can call these tools over stdio:
Tool | Parameters | What it does |
|
| Returns Gemini, Claude/GPT and Argon quota percentages, time until reset, and optionally the raw language_server output. |
|
| Rebuilds the badge in the Antigravity Desktop window and refreshes it with current data. |
| (none) | Reports the process PID, its |
|
| Safely removes temporary scratch files under Antigravity's brain directory. |
8. Security & Privacy
No external network traffic: neither the server nor the injected script sends data to any external server or analytics service.
Localhost only: all communication stays on
127.0.0.1sockets and the locallanguage_serverprocess.The local CDP trade-off (
--remote-debugging-port=0): the default launcher adds this flag, which opens a DevTools socket on the127.0.0.1loopback interface. It is not reachable from the network, but other local processes running as the same OS user could connect to the app over CDP (Runtime.evaluate) — which is why Antigravity2.33.0+turned remote debugging off by default. If you want strict process isolation, install with./install.sh --no-cdp-launcher: no CDP launcher overrides are created, and you still get the MCP quota tools and background notifications. To also stop the background watcher and notifications, setAGY_UI_INJECTION_ENABLED=false. SeeSECURITY.mdfor details.Clean stdout: nothing is logged to
stdout, so the JSON-RPC 2.0 stream stays intact; all logs go tosys.stderr.No binary patching: Antigravity Desktop's binaries are never modified; the UI is changed only through the Chrome DevTools Protocol (
Runtime.evaluate).
9. License & Contributing
Released under the MIT License — see LICENSE.
Issues and pull requests are welcome. If this saves you a few clicks, a ⭐ helps others find it.
© 2026 Mefamex
Available Tools
4 toolsclean_scratch_cacheB
Safely cleans temporary scratch directories (~/.gemini/antigravity/brain/*/scratch/) created by Antigravity Desktop during sessions.
Inputs: dry_run, older_than_hours.
get_instance_statusA
Returns PID, multi-instance leadership (Leader/Standby), and lock status information for the running MCP server.
Inputs: no named parameters.
get_quota_statusA
Queries live AI model quota and usage status (Gemini 5h/weekly, Claude/GPT, Argon) via the local Antigravity language_server.
Inputs: include_raw, force_refresh.
reinject_badgeB
Immediately reinjects and refreshes the live quota indicator (badge) in the Antigravity Desktop window title bar.
Inputs: force.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool targets a distinct object: quota data, the title-bar badge, the server instance, and scratch directories. The only mild overlap is between get_quota_status and get_instance_status (both 'get_*status'), but the descriptions make the quota-vs-process distinction clear enough.
All four tools follow a strict verb_noun snake_case pattern (get_quota_status, reinject_badge, get_instance_status, clean_scratch_cache). No mixing of conventions or vague verbs.
Four tools is well within a well-scoped range and each one maps to a concrete operation of this niche server (read quota, refresh badge, report instance health, clean scratch data). Nothing feels padded or missing for the stated purpose.
The surface covers the core lifecycle: querying quota, forcing a badge refresh, checking instance leadership/lock state, and cleaning scratch caches. Minor gaps exist (e.g. no way to configure badge thresholds, polling, or retrieve historical quota trends), but agents can work around these.
Maintenance
Related MCP Connectors
Read and edit GA4, Search Console and Google Tag Manager from any MCP client. 29 tools.
Your planner in every AI chat: tasks, calendar, docs, habits, goals and memory, over MCP.
Your org's AI agents, tasks, runs, search, and brain files as MCP tools and resources.
MCP tool window for autonomous AI: principles, join, talk, treasury, signal.
Related MCP Servers
- AlicenseBqualityCmaintenanceThis MCP server gives AI coding agents continuous self-awareness of their remaining Google Antigravity quota across both 5-hour rolling and weekly entitlement windows, plus live session token consumption and context pressure for the active conversation. It enables agents to probe headroom between tool steps, checkpoint work gracefully before hitting rate limits, and govern subagent model choice — all at zero LLM token cost.31MIT
- AlicenseNot gradedqualityCmaintenanceEnables Google Antigravity users to view 5-hour and weekly model quota balances alongside offline local token usage, context size, and cache hit rates from a side-pane interface.MIT
- AlicenseBqualityBmaintenanceEnables Antigravity users to monitor real-time token generation speed and per-model-group rolling 5-hour and 7-day quota clocks in the Side Pane and Sidebar, alongside a reactive pixel-art cockpit.5MIT
- AlicenseNot gradedqualityBmaintenanceEnables users to monitor real-time remaining Gemini, Claude, and GPT model quota percentages with local reset countdowns through Antigravity's MCP Apps interface, without consuming model tokens or telemetry.MIT