z121245017-ai

Tokendiet MCP — Security skill for Claude Code

Security community

Zero-dependency Open-Core MCP server, CLI & GitHub Action to audit MCP JSON Schema token weight, simulate multi-turn prompt-cache TTL cliffs across 9 LLMs, and gate CLAUDE.md/AGENTS.md/.mcp.json bloat.

How to install Tokendiet MCP

This entry records only its repository, not the path inside it, so there is no exact command to give. Open z121245017-ai/tokendiet-mcp and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Tokendiet MCP does

Zero-dependency Open-Core MCP server, CLI & GitHub Action to audit MCP JSON Schema token weight, simulate multi-turn prompt-cache TTL cliffs across 9 LLMs, and gate CLAUDE.md/AGENTS.md/.mcp.json bloat in PRs.

Alternatives in Security

  • Security Fundamentals Pack — Core security skills and practices 1.6k ★
  • Rolecraft — The security-first skill manager for AI agents — every install runs a security scan 75 ★
  • Cache Audit — A Claude Code skill that audits your setup against the 6 prompt caching rules from Anthropic's engineering tea 58 ★

README

tokendiet-mcp

[![MCP Server](https://glama.ai/mcp/servers/z121245017-ai/tokendiet-mcp/badges/score.svg)](https://glama.ai/mcp/servers/z121245017-ai/tokendiet-mcp) [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](./LICENSE) [![Node >= 20](https://img.shields.io/badge/node-%3E%3D20.0.0-brightgreen.svg)](./package.json)

**Zero-dependency Open-Core MCP Server, CLI, and GitHub Action** for auditing MCP JSON Schema token weight, simulating multi-turn `O(T^2)` prompt-cache TTL cliffs across 9 LLM pricing tiers, computing cost-minimizing `/compact` checkpoints, and blocking `CLAUDE.md` / `AGENTS.md` / `.cursorrules` / `.mcp.json` bloat in pull requests.

  • 100% Local & Offline: Zero external runtime dependencies, zero network telemetry, non-root node:22-alpine container.
  • Dual MCP Stdio Framing: Supports both newline-delimited JSON (NDJSON) and Content-Length framing out of the box.
  • Strict Tool Safety: All 4 tools enforce additionalProperties: false and explicit read-only safety annotations (readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false).

Exposed MCP Tools

Tool Name Purpose
audit_mcp_schema_tokens Breaks down MCP tools[] or .mcp.json JSON Schema token weight per server and per tool, projects 30-turn cumulative cost, and flags additionalProperties: true, verbose descriptions, and wildcard mounts.
simulate_agent_session_cost Simulates 1..100 turn O(T^2) coding session and monthly spend across 5m / 1h prompt-cache TTLs, idle pause gaps, and mid-session screenshot cache-bust cliffs across 9 LLM pricing tiers (Claude Sonnet 4.5, Claude Opus 4.5, GPT-5, OpenAI o3, Gemini 2.5 Pro, Gemini 2.5 Flash, DeepSeek V3, DeepSeek R1, Qwen-Max).
find_optimal_compact_turn Scans every candidate /compact checkpoint turn (4..T-2) to find the exact turn minimizing total session spend.
`audit_instruction_bloat