Skip to main content
Glama
Antigravity Context Monitor

Antigravity Context Monitor

by anhpi1

Antigravity Context Monitor

Official-API MCP App plugin for Google Antigravity that displays real-time context window usage, cache hit rate, cache-drop warnings, and local token statistics directly inside Antigravity's side pane and left sidebar.

Why this plugin

  • Uses only Antigravity's built-in Plugin + MCP App (ui://) extension mechanism.

  • Reads local transcript.jsonl files under ~/.gemini/antigravity/brain/ in read-only mode.

  • Does not open --remote-debugging-port (CDP), does not inject JavaScript into the Electron runtime, does not touch OS credentials, and makes no outbound network calls.

Related MCP server: context-token-monitor

Features

  • Session tab (aux_pane & global):

    • Current context window usage (input_tokens + cache_read_tokens) with selectable 200K / 1M scale.

    • Split progress bar (Cache Read vs. New Input), cache hit percentage, peak context, and per-turn growth chart.

    • Cache-drop detection when cache_read_tokens drops sharply across consecutive turns.

    • Per-turn request table (step index, time, model, total context, new input, cache read, output, tools) with 5-second auto-refresh.

  • Overview tab (global):

    • Aggregate totals across all local conversations.

    • 16-week daily activity heatmap.

    • Model token distribution and clickable recent conversations table.

    • Reference API cost estimate (estimated from public API token rates; not actual subscription quota).

Installation (no npm install required)

Prebuilt bundles (dist/server.mjs and dist/app.html) are included in the repository. Node.js (>= 20) is required.

Windows (PowerShell):

git clone https://github.com/anhpi1/antigravity-context-monitor.git "$env:USERPROFILE\.gemini\config\plugins\context-monitor"

macOS / Linux:

git clone https://github.com/anhpi1/antigravity-context-monitor.git ~/.gemini/config/plugins/context-monitor

Antigravity automatically discovers directories containing plugin.json under ~/.gemini/config/plugins/.

Opening the panel

  • Side pane: Click + in the conversation side pane -> Context Monitor.

  • Left sidebar (full page): Click Context Monitor in the left sidebar.

  • If it does not appear immediately, restart the MCP server under MCP Servers settings or reload Antigravity.

Development & Rebuild

npm install
npm run build

npm run build uses esbuild (scripts/build.mjs) to produce:

  • dist/server.mjs — bundled ESM MCP server (stdio).

  • dist/app.html — self-contained single-file HTML UI (@modelcontextprotocol/ext-apps) compliant with the default strict CSP.

Known Limitations

  • Entrypoint launches from Antigravity's + menu / sidebar invoke the tool with {} (no active conversation ID is passed), so the UI defaults to the most recently updated conversation and provides a dropdown to switch conversations.

  • Displays local token logs and reference API cost estimates only; server-side subscription quota is not exposed by any public API.

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
      B
      maintenance
      Enables real-time monitoring of Google Antigravity context usage with detailed Messages/Thinking/Tool breakdowns, cache and checkpoint telemetry, one-click compaction, and smart suggested replies across Desktop, IDE, and CLI/tmux.
      2
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      An Antigravity MCP App plugin that surfaces real-time context window occupancy, remaining tokens, prompt cache hit rate, output speed, rolling 5-hour/7-day quota usage, and a 28-day activity heatmap by read-only parsing of local transcript logs. It presents these metrics in a theme-aware sidebar dashboard without patching or injecting into the host client.
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables 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
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables inspecting Google Antigravity sessions to break down context window composition and prefix-cache hits, rank token-heavy tool output hotspots, track every workspace file the agent read or modified, and search past transcripts and artifacts bilingually. It also lets users open touched files natively in a side pane and inject redacted historical excerpts or file references directly into the next prompt.
      MIT