{"id":"658ec758-7c02-4fdc-98ed-081269fc8907","slug":"tokenable","kind":"mcp","name":"tokenable","summary":"","owner":"pardhusrepo","repoUrl":"https://github.com/pardhusrepo/tokenable","license":"Apache-2.0","licenseTier":"permissive","trust":"community","stars":2,"match":null,"fewStars":true,"format":"mcp","createdAt":"2026-06-11T07:38:30.000Z","addedAt":"2026-10-21T21:18:10.619Z","logoUrl":"https://avatars.githubusercontent.com/u/81660938?u=c5fa56481301d8b4d16f71e39a7297ac681c582f&v=4","linkOnly":false,"collection":null,"skillPath":null,"categories":["utilities"],"tags":[],"runtime":"python","local":true,"cloudCapable":false,"cloudCapability":"unknown","cloudReadyOnPlatform":false,"needsApiKey":false,"reviewed":false,"syncedAt":"2026-10-25T22:42:10.149Z","sample":false,"url":"https://conduits.dev/tools/tokenable","language":"Python","transports":["stdio"],"install":{"pypi":"tokenable"},"requirements":{"env":[],"upstreamMayCharge":false},"tools":null,"readme":"# TokEnable\n\n[![PyPI](https://img.shields.io/pypi/v/tokenable)](https://pypi.org/project/tokenable/)\n[![Python](https://img.shields.io/pypi/pyversions/tokenable)](https://pypi.org/project/tokenable/)\n[![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](LICENSE)\n[![CI](https://github.com/pardhusrepo/tokenable/actions/workflows/ci.yml/badge.svg)](https://github.com/pardhusrepo/tokenable/actions)\n\n**FinOps CLI for LLM API costs.** Scan code, estimate token spend, recommend cheaper models, and block over-budget PRs.\n\n---\n\n## Quick Start\n\n```bash\npip install tokenable\ntokenable estimate .\n```\n\n```\n┌──────────────────────────────────────────────────────────────────────────┐\n│                          TokEnable Estimate                                │\n├─────────────┬──────┬───────────┬──────────────────┬─────────┬────────────┤\n│ File        │ Line │ Provider  │ Model            │ $/call  │ $/month    │\n├─────────────┼──────┼───────────┼──────────────────┼─────────┼────────────┤\n│ src/chat.py │   42 │ anthropic │ claude-opus-4-6  │ $0.0450 │ $45.00     │\n│ src/sum.py  │   15 │ openai    │ gpt-4o           │ $0.0035 │  $3.50     │\n└─────────────┴──────┴───────────┴──────────────────┴─────────┴────────────┘\nTotal estimated monthly cost: $48.50\n```\n\n## Features\n\n| Feature | Description |\n|---------|-------------|\n| **Code Scanner** | Detects LLM API calls in `.py`, `.ts`, `.js` files |\n| **Cost Estimation** | Projects monthly costs from token counts and pricing data |\n| **Smart Recommendations** | Suggests cheaper models with equivalent capabilities |\n| **Auto-Fix** | Rewrites model IDs in source files automatically |\n| **Budget Enforcement** | Pre-commit hooks and CI gates for cost control |\n| **MCP Integration** | AI agent tools via Model Context Protocol |\n| **Calibration** | Corrects estimates with real provider usage data |\n| **Multi-Provider** | Anthropic, OpenAI, Google, xAI, Perplexity |\n\n## CLI Commands\n\n```bash\ntokenable estimate .                    # Estimate costs\ntokenable check . --max-monthly-cost 500  # CI budget gate\ntokenable audit .                       # Find savings opportunities\ntokenable fix . --dry-run               # Preview model swaps\ntokenable diff . --base main            # Cost diff between branches\ntokenable price anthropic claude-sonnet-4-6  # Look up pricing\ntokenable calibrate . --provider openai # Calibrate from production\ntokenable init                          # Set up config + hooks\ntokenable update-pricing                # Refresh pricing data (--dynamic for live)\n```\n\n## CI Integration\n\n```yaml\n# .github/workflows/tokenable.yml\n- run: pip install tokenable\n- run: tokenable check . --max-monthly-cost 500\n```\n\nFails the build if estimated costs exceed your budget. See [CI Integration docs](docs/ci-integration.md).\n\n## Pricing Updates\n\nTokEnable ships with bundled pricing data updated each release. For the latest prices:\n\n```bash\ntokenable update-pricing              # Refresh from static provider data\ntokenable update-pricing --dynamic    # Fetch live prices from LiteLLM community DB\n```\n\nA [GitHub Actions workflow](.github/workflows/sync-pricing.yml) runs daily to keep pricing in sync automatically.\n\n## MCP for AI Agents\n\nTokEnable runs as an MCP server for Claude Code, Cursor, and other AI agents:\n\n```json\n{\n  \"mcpServers\": {\n    \"tokenable\": {\n      \"command\": \"python\",\n      \"args\": [\"-m\", \"tokenable.mcp\"]\n    }\n  }\n}\n```\n\nTools: `suggest_model`, `estimate_cost`, `audit`, `apply_recommendations`. See [MCP docs](docs/mcp-integration.md).\n\n## Configuration\n\nCreate `tokenable.config.json`:\n\n```json\n{\n  \"defaultVolume\": 1000,\n  \"ignore\": [\"**/test/**\"],\n  \"overrides\": [\n    { \"pattern\": \"src/batch/**\", \"volume\": 50000 }\n  ],\n  \"budgets\": {\n    \"block\": 0.05,\n    \"maxMonthlyCost\": 500\n  }\n}\n```\n\n## Supported Providers\n\n| Provider | Example Models |\n|----------|---------------|\n| Anthropic | claude-opus-4-6, claude-sonnet-4-6, claude-haiku-3-5 |\n| OpenAI | gpt-4o, gpt-4o-mini, o3, o3-mini |\n| Google | gemini-3.1-pro-preview, gemini-2.5-flash |\n| xAI | grok-3, grok-3-mini |\n| Perplexity | sonar-pro, sonar-reasoning-pro, sonar |\n\nFull list: [Supported Models](docs/supported-models.md)\n\n## Documentation\n\n- [Installation](docs/installation.md)\n- [Quick Start](docs/quick-start.md)\n- [CLI Reference](docs/cli-reference.md)\n- [Supported Models](docs/supported-models.md)\n- [CI Integration](docs/ci-integration.md)\n- [MCP Integration](docs/mcp-integration.md)\n- [FAQ](docs/faq.md)\n- [Contributing](docs/contributing.md)\n\n## Development\n\n```bash\ngit clone https://github.com/pardhusrepo/tokenable.git\ncd tokenable\npip install -e '.[dev]'\nmake test\n```\n\n## License\n\nApache-2.0\n"}