TokenGuard
Reads the repository's git diff (e.g. against a base branch such as main) and reports token counts and multi-model USD cost, so you can price a change before sending it to an AI reviewer.
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.
TokenGuard (tokenguard-mcp)
Stop burning AI coding tokens blindly. Zero-dependency CLI & MCP Server that measures repo token costs across Claude / Gemini / GPT / DeepSeek, packs budget-capped context bundles, catches accidental secret leaks, and audits local AI spend.
Quick Start (Zero Dependencies)
# 1. Scan any repo for token count, context hogs, and multi-model USD cost
npx tokenguard-mcp scan .
# 2. Pack highest-signal files strictly inside a 24k token budget
npx tokenguard-mcp pack . --budget 24000 --format xml --out context.xml
# 3. Check the cost of your git diff before sending it to an AI reviewer
npx tokenguard-mcp diff --base mainRelated MCP server: leantoken
Use as an MCP Server (Claude Code / Cursor / Windsurf / Antigravity)
Add to your MCP config (claude_desktop_config.json, .cursor/mcp.json, or Claude Code MCP settings):
{
"mcpServers": {
"tokenguard": {
"command": "npx",
"args": ["-y", "tokenguard-mcp", "mcp"]
}
}
}Exposed MCP tools:
scan_repo_tokens— Inspect token counts, context hogs, and multi-model cost before reading giant files.pack_repo_context— Pack high-signal files within an exact token budget (fullfree,skeletonPro).estimate_prompt_cost— Estimate input + output USD cost across 10 major 2026 models.check_repo_budget_and_secrets(Pro) — Enforce token/cost ceilings and catch leaked keys.
Free (MIT Open-Source) vs. Pro ($19 One-Time, No Subscription)
Feature | Free (MIT) | Pro ($19 One-Time) |
Repo Token Scanner & Context Hog Finder ( | ✅ | ✅ |
Multi-Model 2026 Cost Estimator ( | ✅ | ✅ |
Budget-Bounded Context Packer ( | ✅ | ✅ |
Stdio MCP Server ( | ✅ | ✅ |
Skeleton Compression ( | — | ✅ |
CI Budget Gate + Secret Leak Scanner ( | — | ✅ |
Local AI Spend Ledger & Session Audit ( | — | ✅ |
Lifetime updates + CI env var support ( | — | ✅ |
👉 Get TokenGuard Pro ($19 one-time): https://www.creem.io/product/prod_T2ytVQvgiLAWMMxLKnTXU
tokenguard activate <YOUR_CREEM_LICENSE_KEY>Privacy & Security
100% local execution: your source code, git diffs, and session logs never leave your machine.
Secret scan results automatically redact detected keys (
AKIAIO...MPLE) so secrets are never echoed into CI logs.Zero external runtime npm dependencies.
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
LLM cost optimization gateway, repo token-waste auditor & model arbitrage MCP server.
Exact Claude API cost calc with real cache economics, plus a tiktoken-misuse scanner.
Token guard and rate limiter preventing runaway API cost spikes for OpenAI and Anthropic.
A paid remote MCP for OpenAI Codex context compressor, built to return verdicts, receipts, usage log
Related MCP Servers
- AlicenseBqualityDmaintenanceTrack LLM token costs across Claude, GPT and Gemini. MCP server + CLI with optimization hints and $ savings estimates.81MIT
- AlicenseNot gradedqualityBmaintenanceLocal-first code intelligence MCP server that enables coding agents to search code, inspect structure, read exact ranges, and explore Git history with explicit token budgets.171Apache 2.0
- AlicenseNot gradedqualityBmaintenanceEnables local-first tracking of AI token usage and costs from Claude Code and OpenCode, answering queries about tokens, models, sessions, and cost through MCP tools and a CLI, with no network calls.704 npm1MIT
- AlicenseNot gradedqualityBmaintenanceEnables local LLM tools and agentic IDEs to inspect repository token maps, retrieve clean token-bounded codebase snapshots, and audit code for hardcoded secrets via MCP over stdio.4MIT