Context Meter
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.
Context Meter (agy-ct)
Live context window observer plugin & MCP App for Antigravity IDE, Antigravity 2.0 (App), and Antigravity CLI.
Inspect real-time token consumption, model context limit percentage, cache hit rate, compaction events, and per-turn growth directly inside Antigravity's Side Pane, Global Sidebar, or inline in chat via /context.
Features
Live Context Meter (MCP App UI):
Tracks current context tokens (
input_tokens + cache_read_tokens), limit percentage, and health status (Healthy,Warning,Near Limit).Segmented meter showing Cache Read vs New Input vs Remaining capacity, plus
75%and90%markers and quick limit overrides (Auto,200K,1M,2M).Interactive SVG Turn-by-Turn Context Growth chart with compaction (
↓ Compact) detection and per-turn tool-call inspection.Per-Turn Ledger preserving scroll position across
2.5slive polling updates.Surface filter (
All,IDE,App,CLI) and conversation picker displaying real Antigravity conversation titles (annotations.titleviaConversationServiceand.pbtxtannotations).
/contextSlash Command:Registers
/contextin the chat slash menu (skills/context/SKILL.md).Pairs with a
PreInvocationhook (hooks.json->dist/hook-context.mjs) to render a compact single-line Context Window bar inline with zero model tokens.
Zero External Runtime Dependencies:
Single-file bundled MCP server (
dist/server.mjs), hook (dist/hook-context.mjs), and CSP-compliant single-file HTML app (dist/app.html).
Related MCP server: context-tree_monitor
Requirements
Node.js
>= 22.0.0(used both to run the plugin MCP server/hook and to run native TypeScript tests)Antigravity IDE, Antigravity 2.0, or Antigravity CLI
Installation
Clone, build, and install into ~/.gemini/config/plugins/context-meter/:
git clone https://github.com/nhanhehehe/agy-ct.git
cd agy-ct
npm ci
npm run build
npm run install:pluginAntigravity automatically discovers plugins in ~/.gemini/config/plugins/context-meter/ (on Windows: %USERPROFILE%\.gemini\config\plugins\context-meter\).
Uninstall
npm run uninstall:pluginUsage
Side Pane: Click
+in Antigravity's Side Pane and select Context Meter.Global Sidebar: Open Context Meter from the left sidebar.
Chat: Ask the agent "Open the Context Meter to inspect my current context window" or type
/contextin the chat input.
Architecture
agy-ct/
├── plugin.json # Antigravity plugin manifest
├── mcp_config.json # MCP stdio server definition
├── hooks.json # PreInvocation hook for /context
├── assets/logo.svg # Plugin icon
├── skills/context/SKILL.md # /context slash skill definition
├── src/
│ ├── core/
│ │ ├── models.ts # Context window limits per model family
│ │ ├── scanner.ts # Scans ~/.gemini/{antigravity,antigravity-ide,antigravity-cli}/brain
│ │ ├── parser.ts # JSONL transcript parser, cache/compaction metrics
│ │ └── titles.ts # ConversationService & .pbtxt annotation title resolver
│ ├── hook-context.ts # /context PreInvocation hook logic
│ ├── hook-cli.ts # Async stdin/stdout CLI entrypoint for hook
│ ├── server.ts # MCP server (open_context_meter, get_context_snapshot, ui:// resource)
│ └── ui/ # Single-file Vite MCP App (@modelcontextprotocol/ext-apps)
├── scripts/
│ ├── install-plugin.mjs # Copies built bundle to ~/.gemini/config/plugins/context-meter/
│ └── uninstall-plugin.mjs # Removes installed plugin directory
└── tests/ # Unit & MCP stdio smoke tests (node --test)Development
npm ci
npm run typecheck
npm run build
npm testSee CONTRIBUTING.md for guidelines on submitting pull requests.
Security & Privacy
Context Meter reads only local files under ~/.gemini/ (and optionally queries the local Antigravity Language Server on ANTIGRAVITY_LS_ADDRESS for conversation titles). It makes zero external network requests. See SECURITY.md for reporting vulnerabilities.
License
MIT © 2026 Nguyễn Thiện Nhân
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
Read-only analytics for Convex apps, queryable via MCP from Claude, Cursor, and other clients.
Share one project context across ChatGPT, Claude, Telegram and any MCP client.
Enable secure connectivity between Sentry issues and debugging data, and LLM clients, using a Model Context Protocol (MCP) server.
Analytics for MCP servers. Query your tool calls, first-call success, retries and schema cost.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceAn 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
- AlicenseNot gradedqualityBmaintenanceEnables live monitoring of Antigravity context-window token usage, CHECKPOINT compaction events, and collapsible chat/subchat trees grouped by project, context size, or date.MIT
- AlicenseNot gradedqualityCmaintenanceEnables visualization of live context-window usage, cache hit rates, token growth trends, and compaction events from local desktop session logs with no model-context overhead.MIT
- AlicenseNot gradedqualityBmaintenanceEnables live read-only visibility into Antigravity 2.0 context-window usage, cache hit rate, token trends, and estimated API costs from local logs without model calls or client modification.MIT