TokenZero MCP sunucusu
Commit 5 Kas 2026Audit projects for LLM token waste, price model alternatives, and optimize prompt payloads for caching.
Ayrıca bilinen adı tokenzero-ai/tokenzero
- Yıldızlar
- 0
- Araçlar
- —
- İndirmeler, 30 gün
- —
- En son sürüm
- 0.2.2
- Son commit
- 5 Kas 2026
- Lisans
- Apache-2.0
TokenZero MCP nedir?
TokenZero bir MCP sunucusudur. Audit projects for LLM token waste, price model alternatives, and optimize prompt payloads for caching.
Özet, projenin README dosyasından oluşturuldu
TokenZero MCP sunucusu hakkında
TokenZero provides a suite of tools designed to help developers identify and reduce unnecessary LLM expenditures. The MCP server version allows coding agents like Claude Code, Cursor, Windsurf, and Cline to perform local audits of an open project. It identifies token waste by analyzing code through static heuristics rather than monitoring live traffic. This process helps developers find opportunities for cost savings through model arbitrage and prompt optimization.
Users can run specific tools such as audit_repo_token_waste and calculate_model_arbitrage entirely on their own machines. The optimize_prompt_payload tool is different because it sends the provided request body to the TokenZero service at tokenzero.sh. The system detects specific patterns like LLM calls inside loops, large static prompts lacking caching directives, and the use of frontier models for simple extraction tasks. It also flags unpriced or retired model IDs to ensure budget accuracy.
Neler yapabilirsiniz
- 1Identify local token wasteAsk your AI agent to scan the current repository to find where LLM spending can be reduced.
- 2Find cheaper model alternativesRequest a comparison of different pricing models to see if a cheaper model can handle a specific task.
- 3Optimize prompts for cachingProvide a request body to the server to make it more compatible with prompt caching mechanisms.
- 4Prevent cost regressions in CISet up a gate in your continuous integration pipeline to fail if recoverable waste exceeds a certain percentage.
Projenin README dosyasından alınmıştır. Her kullanım durumu, oradaki bir alıntı ile kontrol edilir.
TokenZero MCP nasıl yüklenir
Biçimler 10 Kas 2026 tarihinde doğrulandıCursor'a ekleGoose'a ekleTokenZero MCP'yi Claude Code içine yükleyin
$ claude mcp add --transport http tokenzero https://tokenzero.sh/mcpTokenZero MCP'yi Cursor içine yükleyin
~/.cursor/mcp.json
{
"mcpServers": {
"tokenzero": {
"url": "https://tokenzero.sh/mcp"
}
}
}TokenZero MCP'yi VS Code içine yükleyin
.vscode/mcp.json
{
"servers": {
"tokenzero": {
"type": "http",
"url": "https://tokenzero.sh/mcp"
}
}
}TokenZero MCP'yi VS Code CLI içine yükleyin
$ code --add-mcp '{"name":"tokenzero","type":"http","url":"https://tokenzero.sh/mcp"}'TokenZero MCP'yi Codex içine yükleyin
$ codex mcp add tokenzero --url https://tokenzero.sh/mcpTokenZero MCP'yi Codex config.toml içine yükleyin
~/.codex/config.toml
[mcp_servers.tokenzero] url = "https://tokenzero.sh/mcp"
TokenZero MCP'yi Gemini CLI içine yükleyin
$ gemini mcp add -s user --transport http tokenzero https://tokenzero.sh/mcpTokenZero MCP'yi Gemini settings.json içine yükleyin
~/.gemini/settings.json
{
"mcpServers": {
"tokenzero": {
"url": "https://tokenzero.sh/mcp",
"type": "http"
}
}
}Otomatik kontroller
Çalıştırıldı 15 Kas 2026Tam rapor →Henüz doğrulanmadı. Bir sunucunun 80 puana, ciddi bir bulgu olmamasına ve kontrol edebilmemiz için yeterli veriye ihtiyacı vardır. Kontroller nasıl çalışır · Daha fazla puan için nelerin düzeltileceği
- Kaynak deposu bağlantılı ve erişilebilirtokenzero-ai/tokenzero is public and reachablegithub.com/tokenzero-ai/tokenzero ↗Geçti
- Paket, bu depoyu kaynağı olarak gösteriyorKontrol edilmedi
- Derleme kökeni (Sigstore onayı)Kontrol edilmedi
- Açık kaynak lisansı (OSI)Apache-2.0spdx.org/licenses/Apache-2.0.html ↗Geçti
- Son bir yıl içinde commit veya sürüm mevcutLast commit or release 2026-11-05github.com/tokenzero-ai/tokenzero ↗Geçti
- OpenSSF ScorecardKontrol edilmedi
- Paket adı popüler bir pakete yakın değilKontrol edilmedi
- Pakette veya bağımlılıklarında kritik uyarı yokKontrol edilmedi
- Modele yönelik gizli talimat yok0 tool descriptions and the README read; no override phrases, credential paths or hidden charactersGeçti
- Yıkıcı araçlar etiketlenmişKontrol edilmedi
- Uzak uç nokta MCP el sıkışmasına yanıt veriyorinitialize answered with protocol 2025-06-18 in 289 msGeçti
TokenZero tools
Open-source tools from TokenZero, the independent ledger of record for AI spend (metering, attribution, budget control, audit).
-
The receipt verifier (
verifier/tokenzero-verify.mjs) checks a TokenZero receipt without trusting TokenZero: Ed25519 signature over canonical JSON, the savings-bucket math and the hash chain. Zero dependencies; library or CLI. The format is specified indocs/receipt-spec.md. -
@tokenzero/mcpis a stdio MCP server for Claude Code, Cursor, Windsurf and Cline: audit the open project for token waste (locally), price model alternatives, make request bodies cache-friendly. -
@tokenzero/cliconnects a project to the ledger (through the gateway sensor) with no code changes, audits LLM token waste locally, shows usage and verifies signed savings receipts. -
The analyzer (
src/audit-core.ts) is the static token-waste audit used by the CLI, the hosted repo audit and the PR cost-diff check. It runs entirely on your machine. -
The pricing table (
src/pricing.ts) lists the list prices every estimate is computed from, versioned and dated.
Audit a project
npx -y @tokenzero/cli audit # local, nothing is uploaded
npx -y @tokenzero/cli audit --json
npx -y @tokenzero/cli audit --fail-over 30 # CI gate: exit 1 above 30% recoverable
git diff origin/main | npx -y @tokenzero/cli audit --diff - --format markdown
Audits are static heuristics: they read code, not traffic. Numbers are estimates at list prices; verified savings come from the gateway's signed ledger once requests flow through it.
What it looks for:
- large static prompts sent without caching directives (Anthropic
cache_control, OpenAI prefix stability) - prompt templates defined away from their call sites with no caching anywhere
- frontier models on prompts that read like extraction or classification
- LLM calls inside loops (Batch API or shared-prefix caching candidates)
- unpriced or retired model ids
Library and SDK repositories are detected and their findings downgraded, since their call sites pass through whatever the caller chooses.
Check every pull request (GitHub Action)
# .github/workflows/tokenzero.yml
name: TokenZero cost check
on: pull_request
permissions: { contents: read, pull-requests: write }
jobs:
cost-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 0 }
- uses: tokenzero-ai/tokenzero/action@v0
One comment per PR, updated on every push; nothing leaves the runner. See action/README.md for inputs and outputs.
Use it from a coding agent (MCP)
claude mcp add tokenzero -- npx -y @tokenzero/mcp # Claude Code
{ "mcpServers": { "tokenzero": { "command": "npx", "args": ["-y", "@tokenzero/mcp"] } } }
audit_repo_token_waste and calculate_model_arbitrage run entirely on your machine. optimize_prompt_payload sends the request body you give it to the TokenZero service (https://tokenzero.sh unless TOKENZERO_URL is set), so do not put secrets in it.
Connect a project to the gateway
npx -y @tokenzero/cli init
init audits locally, creates a workspace, and (with your consent) adds OPENAI_BASE_URL / ANTHROPIC_BASE_URL to .env. Your provider keys pass through untouched and are never stored.
Authentication: send the workspace key as the X-TokenZero-Key header (recommended). For zero-code setups the CLI can also embed it in the base URL (/w/<key>/v1); treat such URLs as secrets and use tokenzero rotate-key if one leaks.
Develop
npm install
npm run build # bundles cli/bin/tokenzero.mjs (single file, no runtime deps)
npm test
License: Apache-2.0 · support@tokenzero.sh
TokenZero MCP soruları
TokenZero MCP'yi Claude Code'a nasıl eklerim?
Terminalinizde claude mcp add --transport http tokenzero https://tokenzero.sh/mcp komutunu çalıştırın. Her projede kullanılabilir olması için --scope user ekleyin.
TokenZero MCP'yi Cursor'a nasıl eklerim?
~/.cursor/mcp.json dosyasını açın ve yukarıdaki yükleme bölümünde gösterilen Cursor yapılandırmasını kullanarak sunucuyu mcpServers altına ekleyin.
Does the MCP server send my secrets to a remote service?
The optimize_prompt_payload tool sends request bodies to the TokenZero service, so you should avoid including secrets in those bodies.
Can I use this in my CI/CD pipeline?
Yes, you can use a GitHub Action to check pull requests for cost changes.
Are the audit numbers exact?
The numbers provided are estimates based on list prices; actual verified savings are provided by the gateway's signed ledger.