TAN TokenDiet
Provides a reusable GitHub Action and CI/PR workflow integration for auditing MCP tool schemas and agent context files, enforcing token budgets and cache-buster checks, and optionally posting PR cost-delta comments and budget gates in GitHub repositories.
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.
TAN TokenDiet v1.4.0
Audit, benchmark, and safely compact MCP tool schemas & AI agent context files to cut LLM token burn and fix 5m / 1h prompt-cache misses.
Live Browser Analyzer (100% client-side, zero upload): https://20171806011.github.io/tan-tokendiet/
Zero-dependency Python CLI & MCP Stdio Server:
tokendietCLI +tokendiet-mcp(docker run -i --rm ghcr.io/20171806011/tan-tokendiet:1.4.0)Reusable GitHub Action:
uses: 20171806011/tan-tokendiet@v1.4.0
Verified Empirical Benchmarks (modelcontextprotocol/servers, 44 Tools)
Measured directly against upstream official MCP reference servers (full methodology):
Official MCP Server | Tools | Raw Tok/Turn | Safe Lossless | Aggressive | Structural Invariants |
| 16 | 2,133 | 1,581 (-25.9%) | 931 (-56.4%) | ✅ 100% |
| 14 | 1,805 | 1,170 (-35.2%) | 1,170 (-35.2%) | ✅ 100% |
| 9 | 1,014 | 704 (-30.6%) | 411 (-59.5%) | ✅ 100% |
| 3 | 354 | 213 (-39.8%) | 213 (-39.8%) | ✅ 100% |
| 1 | 257 | 189 (-26.5%) | 189 (-26.5%) | ✅ 100% |
| 1 | 294 | 234 (-20.4%) | 66 (-77.6%) | ✅ 100% |
Combined 6-Server Stack | 44 | 5,840 | 4,074 (-30.2%) | 2,962 (-49.3%) | ✅ All 44 Passed |
Why Prompt-Cache Safety Matters More Than Raw Token Count: Recent coding agents (e.g. Claude Code) write 1-hour TTL prompt caches billed at 2.0× input (vs 1.25× for 5-minute TTL). A single dynamic timestamp, UUID, or non-deterministic tool order silently turns a 90% cached-read discount into repeated 2.0× cache writes. TokenDiet flags all cache-busters (
TD005/TD006) and enforces deterministic JSON sorting.
Related MCP server: context-doctor
Quick Start (CLI & GitHub Action)
CLI
pip install git+https://github.com/20171806011/tan-tokendiet.git
# Audit an MCP schema JSON, mcp.json, AGENTS.md, or an entire repository
tokendiet audit examples/bloated_mcp_tools.json --model claude-sonnet --turns-per-day 200 --team-size 5
# Safely compact tool schemas with 100% JSON Schema structural invariant verification
tokendiet minify examples/bloated_mcp_tools.json --aggressive -o tools.compact.json
# CI regression diff gate
tokendiet diff tools.compact.json examples/bloated_mcp_tools.json --max-delta 200Reusable GitHub Action
- uses: 20171806011/tan-tokendiet@v1.1.0
with:
path: "."
model: "claude-sonnet"
max-tokens: "4000"
fail-on-cache-buster: "true"Commercial Editions (Zero Subscriptions)
TAN TokenDiet Free (£0 · MIT): Core CLI, 100% client-side browser analyzer, reusable GitHub Action, 12 rules.
TAN TokenDiet Pro Kit (£15 GBP / $19 USD · one-time): Automated GitHub PR Cost-Delta Commenter & Budget Gate, Multi-Repo FinOps Batch Auditor (HTML Executive Report + CSV), curated MCP server profile presets, perpetual commercial v1.x team license.
Done-For-You MCP & Prompt-Cache Audit (£29 GBP / $39 USD · fixed fee, 24h): Hands-on audit of your repo/MCP stack, drop-in compacted schemas + cache-fix PR, Executive FinOps report, includes TokenDiet Pro Kit.
Details, live interactive calculator & policies: https://20171806011.github.io/tan-tokendiet/
License
Core CLI, Action & browser analyzer: MIT License.
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
Statically audits MCP tool surfaces for token cost, schema quality, and design issues.
Convert, lint and generate LLM tool schemas for OpenAI, Anthropic, Gemini and MCP
LLM cost optimization gateway, repo token-waste auditor & model arbitrage MCP server.
Free MCP contract auditing for AI agents and developers. Check tool schemas, detect potential breaking changes between versions, and get structured compatibility findings before deployment. Static analysis only.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables analyzing and optimizing context window token usage by measuring, compressing, and eliminating waste from MCP tool definitions.54 npmMIT
- AlicenseNot gradedqualityBmaintenanceProvides MCP tools to profile and optimize LLM conversation context, identifying token waste and applying deterministic fixes to reduce context window usage.1,207 npm3MIT
- AlicenseNot gradedqualityBmaintenanceEnables auditing MCP servers' tools by their estimated context token cost, ranking verbose names, descriptions, and schemas before they consume the agent window. Can run as an MCP tool so agents can budget their own context.1MIT
- FlicenseNot gradedqualityNot gradedmaintenanceEnables MCP-compatible clients and autonomous agents to dynamically compress long-horizon context by pruning verbose tool outputs, HTML boilerplate, and semantic redundancy by 40-70%. It reduces token burn and latency through deterministic, zero-dependency processing.-