
TokenBar
io.github.ChaconLucas由 GitHub 帳號 ChaconLucas 發布v0.5.3更新於 Oct 25, 2026
AI usage limits (Claude Code, Codex, Copilot, Windsurf): check budget and time until reset.
概覽
TokenBar 的 MCP 伺服器讓助理在開始長任務前查詢 Claude Code、Codex、Copilot 等 AI 的用量額度與預算。
- 可以做什麼
- 透過 check_budget 工具查詢 Claude Code、Codex、Copilot、Windsurf 等提供者的剩餘用量預算與重置時間,適合在長任務開始前呼叫。用量資料來自 TokenBar 應用程式或 CLI,它們從本機 AI 工具資料與可選的本機 API 收集額度。配套應用程式也會在桌機、手機和手錶的 LED 顯示器上顯示相同數字。
- 適用情境
- 適合在長時間或高消耗任務前確認剩餘額度或重置時間,或在你已執行 TokenBar 並希望在 Claude Code、Codex、Cursor 中直接查看額度時使用。
- 執行需求
- 以本機 MCP 伺服器(tokenbar-mcp)執行,可透過 TokenBar.mcpb 安裝包或 CLI 安裝腳本安裝,後者需要 Node 18+。用量資料來自同一台電腦上的 TokenBar 應用程式或 CLI;未宣告環境變數或請求標頭。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 TokenBar,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
TokenBar
Your Claude Code, Codex, Copilot, Windsurf, Cursor, Gemini, Kiro, GLM, Kimi, Amp… (or any AI) usage limits and when they reset,
on an LED display everywhere: Mac, Windows, Linux, iPhone, Android, Apple Watch and Wear OS.
[TokenBar on a landscape iPhone]
[M8ven Score]
[OpenSSF Best Practices]
[Latest Release]
[MIT License]
[GitHub Stars]
English · Português
Website & API docs: https://chaconlucas.github.io/tokenbar/
Install
The computer collects the numbers. Phones and watches only show what it sends over Wi-Fi, so always start there.
Updates: Mac, Windows and Android show an update button inside the app. The iPhone (and its watch app) updates by running install-ios.sh again, or automatically with --auto. VS Code updates through the Marketplace.
Mac blocked it ("can't be opened", "unidentified developer", "is damaged")?
TokenBar isn't notarized by Apple yet (that needs a paid developer account), so macOS blocks the first launch when the app comes from a browser. Any of these fixes it:
- Install with the command above. Downloaded from Terminal, the warning doesn't appear.
- Allow it once: try to open TokenBar → System Settings → Privacy & Security → scroll down → Open Anyway → your Mac password.
- "Is damaged"? In Terminal:
xattr -dr com.apple.quarantine /Applications/TokenBar.appand open it again.
The prompt "TokenBar wants to use confidential information stored in Claude Code-credentials" isn't a block: it's the login reading (VS Code panel). Choose Always Allow.
Or ask your AI. Open Claude Code, Codex or any AI with a terminal and say:
Read https://github.com/ChaconLucas/tokenbar/blob/main/INSTALL.md and install TokenBar for me.
INSTALL.md is written for the AI: it asks which devices you have, runs the commands, and only asks for your hands when needed (a permission, the phone, the watch).
What it does
Mac
- An LED device window (bigger, smaller or full screen) and a floating Mini that stays on top of everything, full-screen apps included.
- MOSTRAR A % (show the %): BARRA (little LED bars with the % in the menu bar), NOTCH (a black pill around the camera, hover to open) or OS DOIS (both).
- Clicking the menu bar opens a summary with glass buttons (liquid glass on macOS 26): device, Mini, Ajustes (settings), refresh, quit.
- Widgets (small, medium, large) and Control Center controls (macOS 26): TokenBar, Claude, Codex, floating and device.
- Ajustes in four tabs: GERAL (language, what to show, colors), IAS (AIs), APARELHOS (phones and watches), SERVIDOR (local API, webhook, server). A Primeiros passos (getting started) guide connects everything step by step.
Windows and Linux — the same LED device, the floating Mini, a 12-dot ring in the system tray and the getting-started guide (app in desktop/, built with Tauri).
iPhone
- Opens in landscape, full screen, screen always on: a desk clock for your limits.
- Widgets on the Home Screen and Lock Screen (presets plus a custom one; "one at a time" switches AI on tap).
- Live Activity on the Lock Screen and in the Dynamic Island (on iPhones that have one), with buttons to switch AI and window.
- Built-in QR scanner (ESCANEAR QR) to pair with the computer, and a notice when an update is out or the free-account app is about to expire.
Apple Watch — app (TODOS / CLAUDE / CODEX, 5H / 7D, or turn the Digital Crown), watch-face complications, and a Smart Stack card (the Live Activity on watchOS 11+, plus widgets that rise when a limit is close or about to reset).
Android and Wear OS — phone in landscape with a home-screen widget, alerts and in-app updates. The Wear OS watch works with or without the phone: alone, type the 6-digit code from the computer (Mac: Ajustes → APARELHOS → WEAR OS SEM CELULAR). Complications on the watch face. Huawei without Google services: the QR scan doesn't work, paste the link instead.
[TokenBar on Android] [TokenBar on Wear OS]
AIs
- Claude Code through the terminal statusline (one click: CONECTAR in Ajustes → IAS), or through its login when you use the VS Code panel.
- Codex: automatic, from the terminal, VS Code or the Codex app.
- GitHub Copilot: opt-in (monthly premium requests, via
gh auth token). - Windsurf: automatic.
- Cursor, Gemini CLI, Kiro: opt-in, using the login each one already saved (Gemini: Workspace / Code Assist accounts only).
- GLM (Z.ai), MiniMax, Kimi Code, OpenRouter, Factory Droid, Amp: paste an API key in Settings → AIs (Mac: stored in the Keychain).
- Any other AI through a small JSON file: docs/providers.md.
Everything else
- Languages: Portuguese and English, with an AUTO / PT / EN switch (AUTO follows the system).
- Windows: 5 hours, 7 days, or both on the same screen. The background fills with usage: 23% lights 23% of the display.
- Alerts when a window passes 80% and 95% and when it resets (the iPhone mirrors them to the watch).
- Customization: a color per AI, text and timer colors, color by usage, red from 85%, round or square dots, brightness.
[5H and 7D together] [TokenBar on the Mac]
[Real iPhone: Dynamic Island and the home-screen widget]
[Live Activity on the iPhone Lock Screen] [Real iPhone: Dynamic Island expanded]
[The notch island on the Mac, open]
[Settings] [Getting started guide]
[The TokenBar app on Apple Watch] [The Live Activity in the Apple Watch Smart Stack]
API & developers
- Local API while the app runs (Mac, Windows, Linux):
http://localhost:41777/v1/usage, localhost only; real port in~/.tokenbar/api.json. - CLI
tokenbar: bars in the terminal,tokenbar --promptfor the shell prompt or tmux,tokenbar get claude 5hfor scripts. Works without the app too. - MCP server
tokenbar-mcp: Claude Code, Codex or Cursor callcheck_budgetbefore a long task. - Webhooks at 80% / 95% / reset (Slack and Discord get a sentence; anything else gets the JSON).
~/.tokenbar/snapshot.jsonto read without the app, and~/.tokenbar/providers/*.jsonto add any AI.
Schemas and examples (curl, JavaScript, Python, starship, tmux, zsh): docs/api.md.
How it works
- The computer collects. Claude Code only hands its limits to the statusline; TokenBar installs a small script (
~/.tokenbar/claude-tee.sh) that saves a copy and runs the statusline you already had, unchanged (with a backup ofsettings.json). Codex writes its limits into~/.codex/sessions. - It advertises on the local network (
_tokenbar._tcp) and only answers devices holding the pairing key. - Phones find it on their own on the same Wi-Fi and pass the numbers to the watch.
- Optional server: the computer also sends to it, and phones use the newest number between Wi-Fi and server.
Privacy
- No code, prompt or conversation leaves the computer. Only percentages, reset times and how long ago they were read.
- Wi-Fi: the computer only answers devices that send the pairing key; the advertisement shows only its first 8 characters.
- Local API: listens on 127.0.0.1 only and rejects other
Hostheaders. - Logins: the Claude Code login token only goes to Anthropic; the GitHub token (Copilot) only goes to GitHub. Both are read-only and off by default.
- Server: stores the
sha256of the key, never the key, and the latest snapshot. - Anyone with the QR code can see your numbers. Don't post it.
Known limitations
- iPhone needs a Mac with Xcode, and with a free Apple account the app expires every 7 days (renew with
install-ios.sh, or--auto). - macOS: not notarized (see the "Mac blocked it?" box). Not sandboxed, so no Mac App Store.
- Linux: no package yet; build from source.
- Claude Code: numbers update while a Claude Code session is running (statusline), unless login reading is on.
- Unofficial endpoints: Claude login reading and Copilot use endpoints that aren't publicly documented and may change.
- Widgets: iOS and watchOS refresh them roughly every 15 minutes.
Troubleshooting
Build from source
Mac, iPhone and Apple Watch (Xcode 26+ and brew install xcodegen):
Schemes: TokenBarMac (Mac), TokenBar (iPhone, brings the watch app), TokenBarWatch. iPhone and watch need Developer Mode; on first launch allow Local Network, then pair with the QR in Ajustes → APARELHOS.
Windows and Linux (Rust and Node 18+; Linux also sudo apt install libwebkit2gtk-4.1-dev libayatana-appindicator3-dev librsvg2-dev build-essential):
Android and Wear OS (JDK 17 and the Android SDK):
Optional server (see your numbers away from home)
Without a server, phones only update on the same Wi-Fi as the computer. Deploy your own, free, on Cloudflare (Worker + D1):
Paste the address in Ajustes → SERVIDOR → ENDEREÇO (Windows/Linux: ⚙) and scan the QR again on the phone. The computer only sends when the number changes, or every 10 minutes.
Structure
License
MIT. See LICENSE.
TokenBar is an independent project and is not affiliated with Anthropic, OpenAI, GitHub or the makers of Windsurf. "Claude", "Claude Code", "Codex", "Copilot" and "Windsurf" are trademarks of their respective owners.
來源:README.md,提交 6037027
工具
0版本歷史
1- v0.5.3最新Oct 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分
