Skip to main content
Glama
context-dashboard
by nanyuzuo

Antigravity Token 看板 (context-dashboard)

本地只读、零侵入的 Google Antigravity 官方架构 MCP App 侧边栏插件。通过读取 Antigravity 本地会话日志(transcript.jsonl),在侧边栏或独立视图中实时可视化呈现:

  • 上下文窗口占用:当前上下文大小(支持 200K / 500K / 1M 参考刻度切换)、峰值与均值

  • Token 累计消耗拆分:缓存读取(Cache Read)、新输入(Uncached Input)、输出(Output)

  • Prompt 缓存分析:加权与轮均缓存命中率,自动标记缓存未命中(Miss)与上下文压缩(Compact)轮次

  • 5 小时滑动窗口 & 7 天分模型用量:按逐轮精确时间戳聚合近 5 小时时间轴(15 分钟/格)、最早活跃记录滑出倒计时,以及近 7 天按模型家族趋势图与分模型明细表

  • 交互式趋势图表:逐轮上下文/缓存堆叠图、逐轮 LLM/工具耗时堆叠图(悬停查看精确明细)

  • 历史多会话汇总:支持按时间范围筛选(最近 / 24h / 7d / 全部)与点击下钻查看任意历史会话

  • 零 LLM Token 刷新:看板内手动刷新、10 秒自动刷新及会话切换均通过 App 内部通道完成,不额外消耗模型 Token

隐私与安全说明:本插件仅以只读方式解析本机 ~/.gemini/antigravity*/brain/**/.system_generated/logs/transcript.jsonl,不发起任何网络请求,也不修改 Antigravity 客户端文件。

环境要求

  • Google Antigravity(支持 MCP Apps)

  • Node.js >= 20(仓库已附带构建产物 dist/,安装运行无需 npm install)

Related MCP server: context-token-monitor

在其他 Antigravity 上快速安装

方式一:直接克隆到插件目录(推荐,开箱即用)

macOS / Linux:

git clone https://github.com/nanyuzuo/antigravity-context-dashboard.git ~/.gemini/config/plugins/context-dashboard

Windows (PowerShell):

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

后续更新只需拉取最新代码:

git -C ~/.gemini/config/plugins/context-dashboard pull

方式二:先克隆到本地,再运行部署脚本

git clone https://github.com/nanyuzuo/antigravity-context-dashboard.git
cd antigravity-context-dashboard
node scripts/deploy.mjs

使用方法

安装完成后 Antigravity 会自动发现该插件(若当前会话未立即显示,可刷新 MCP 服务器或新开一个会话):

  1. 侧边栏打开:点击右侧辅助面板(Side Pane)顶部的 + → 选择 Token 看板

  2. 全屏视图打开:点击左侧全局导航栏中的 Token 看板 入口

  3. 对话内唤起:直接对 Antigravity 说「打开 Token 看板」

  4. 插件管理:在 Antigravity 的 Plugins / Customizations 页面中可随时启用、禁用或卸载

本地开发与验证

修改 src/ 源码后重新构建、测试并部署到本地插件目录:

npm install
npm run build
npm test
npm run deploy

提示:仅修改前端界面(dist/app.html)时,关闭并重新打开面板即可生效;修改 MCP 服务端(dist/server.mjs)后需重载 context-dashboard_dashboard MCP 服务。

目录结构

.
├── plugin.json               # Antigravity 插件清单
├── mcp_config.json           # MCP 服务配置(启动 dist/server.mjs)
├── assets/logo.svg           # 插件图标
├── src/
│   ├── server.mjs            # 零依赖 MCP stdio JSON-RPC 服务端
│   ├── transcript-analyzer.mjs # 本地 transcript.jsonl 只读解析器
│   └── ui/
│       ├── main.js           # MCP App 前端交互与 SVG 图表
│       └── styles.css        # 明/暗主题自适应样式
├── dist/
│   ├── server.mjs            # 预构建服务端产物(零外部依赖)
│   └── app.html              # 预构建单文件 CSP 兼容前端页面
└── scripts/
    ├── build.mjs             # esbuild 打包脚本
    ├── deploy.mjs            # 复制运行时文件到 ~/.gemini/config/plugins/context-dashboard
    └── smoke-test.mjs        # MCP 协议端到端自测脚本

License

MIT

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 users to inspect real-time prompt cache hit rate, task throughput, and per-model token usage for Antigravity sessions and 5h/1d/7d windows through an interactive local dashboard. It combines lifecycle hook timing with local transcript data, with zero outbound network telemetry.
      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
      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
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables real-time visualization of Google Antigravity agent execution, including tool calls, parallel subagents, MCP routing, context usage, and local session telemetry through an embedded side-pane dashboard.
      MIT