Cache Hit Monitor for Antigravity
Monitors Google Antigravity powering the agent - displays prompt cache hit rate, context window usage, and compaction (CHECKPOINT) status in Antigravity's side pane, reading local transcript logs to show per-turn token metrics, model limits, and a compact grouped timeline of recent turns.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Cache Hit Monitor for Antigravity
English | 简体中文
A simple, focused little tool for Google Antigravity — it does one thing in the right side pane: shows your real Prompt Cache hit rate, context window usage, and compaction (CHECKPOINT) status.
Zero data leakage / 100% local: Makes zero network requests, collects no telemetry, requires no API keys, and never uploads or injects your conversation data anywhere.
Lightweight, restrained, easy to audit: Just 1 runtime dependency (
@modelcontextprotocol/sdk) and a few hundred lines of readable code you can review in minutes.macOS-friendly: Built and tested natively on macOS out of the box (also works on Linux; on Windows, ensure
python3is available inPATH).A practical plugin starter example: Cleanly demonstrates how to combine an Antigravity
aux_paneMCP App, anapp-onlypolling tool, and a silentPostInvocationhook.
Note: The side-pane UI labels are currently in Simplified Chinese.
Key Features & Principles
Zero Context Intrusion & Zero Cache Busting: Runs in Antigravity's right side pane (
aux_pane->Cache Monitor). Data polling uses anapp-onlyMCP tool invisible to the model, and the backgroundPostInvocationhook only records the active transcript path locally and always returns{}.100% Ground-Truth Metrics: Reads server-reported fields directly from local
transcript_full.jsonl(input_tokens,cache_read_tokens,output_tokens,model,created_at,tool_calls,CHECKPOINT). No character-based token estimation, no rough composition attribution, and no synthetic counters.Honest Context Limits: Displays context bar & percentage only for verified Gemini model limits (
gemini-4-neon*:512k;gemini-4-carbon/argon/hydrogen,gemini-3*,gemini-2.5*:1M), warning at75%. For all other models, displays the exact absolute token count only.Compaction-Aware: Recognizes both standalone
/compactturns and mid-turn automaticCHECKPOINTcompactions—preserving the compaction call's real cache hit rate and displaying the exactbefore → aftercontext drop once the next model response arrives (never estimated beforehand).Compact Grouped Timeline: Shows the latest 10 turns auto-following the active conversation; click any turn to expand step-by-step tool actions, cache hit rates, token ratios, and timestamps.
Related MCP server: codex-goal-viewer
Requirements
Google Antigravity (desktop app / IDE with MCP App side-pane support)
Node.js 18+
Python 3 (used by the silent
PostInvocationhook)
Installation
Clone this repository into Antigravity's global plugins directory:
git clone <your-repo-url> ~/.gemini/config/plugins/cache-hit-monitor
cd ~/.gemini/config/plugins/cache-hit-monitorInstall the runtime dependency (
@modelcontextprotocol/sdk):
npm install --omit=dev(A prebuilt ui/app.html bundle is included. If you modify ui-src/, install dev dependencies and rebuild with npm install && npm run build:ui.)
Enable/reload plugins in Antigravity (or restart Antigravity).
Open the right side pane (
+-> Cache Monitor). It polls local logs every 2.5s and automatically follows your active conversation.
Configuration
Edit config.json to adjust model limits or alert thresholds:
{
"geminiContextWindows": [
{ "prefix": "gemini-4-neon", "limit": 512000 },
{ "prefix": "gemini-4-carbon", "limit": 1000000 },
{ "prefix": "gemini-4-argon", "limit": 1000000 },
{ "prefix": "gemini-4-hydrogen", "limit": 1000000 },
{ "prefix": "gemini-3", "limit": 1000000 },
{ "prefix": "gemini-2.5", "limit": 1000000 }
],
"cacheDropThreshold": 0.5,
"cacheExpiryGapSeconds": 300,
"contextWarnRatio": 0.75
}Field | Description | Default |
| Prefix-matched context window limits (tokens) for Gemini models | See above |
| Turn hit rate below which drop-fact badges are highlighted |
|
| Idle gap (seconds) surfaced as an objective fact on cache drop |
|
| Context window ratio that triggers the high-waterline |
|
How It Works
Antigravity ──(PostInvocation hook)──▶ scripts/track_active.py ──▶ ${PLUGIN_DATA}/active.json
│
Antigravity Side Pane (ui/app.html) ◀──(app-only MCP poll)──▶ server/index.mjs ──▶ transcript_full.jsonlLocal-only: No network calls, no telemetry, no external API keys.
Compatibility note: This plugin parses Antigravity's local
transcript_full.jsonlschema (USER_INPUT,PLANNER_RESPONSE,CHECKPOINT). If a future Antigravity release changes local transcript fields,server/index.mjsmay need an update.
Development
npm install
npm run build:uiAfter changing server/index.mjs or rebuilding ui/app.html, reload the MCP server / reopen the Cache Monitor pane in Antigravity.
License
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Inspect AI brand visibility, tracked prompts, competitors, citations and search fan-outs.
Interactive data visualization and executive PDF dashboards for ChatGPT, Claude, and Cursor.
Read-only analytics for Convex apps, queryable via MCP from Claude, Cursor, and other clients.
Data + AI observability — monitor and troubleshoot production-grade agents and the context they use.
Related MCP Servers
- AlicenseAqualityBmaintenanceProvides a local MCP interface to query captured, PII-scrubbed prompt telemetry from coding agents and browser chats, enabling time summaries, prompt search, and activity analysis without data leaving the machine.9MIT
- AlicenseNot gradedqualityCmaintenanceEnables monitoring of long-running Goal task progress, token usage, and a rough ETA in a compact side panel, using structured plan step counts and Codex thread metrics.MIT
- AlicenseNot gradedqualityCmaintenanceEnables users to view average token throughput, output and reasoning token counts, and recent speed trends for local Codex Desktop conversations through a session panel without modifying the client.MIT
- AlicenseNot gradedqualityBmaintenanceEnables reading locally recorded Codex execution traces — reconstructed requests, nested tool calls and their results, compaction history, and generation timing — browsed alongside the current conversation through timeline, ledger, and inspector views. Also lets users register additional trace directories and inspect large recordings incrementally without any upload or remote service.2MIT