Skip to content
Conduit

mcp server

tokenable

pardhusrepo/tokenablecommunitylistedunreviewed

Set up

Runs on your computer. Pick your agent and operating system.

Before you start

  • uv (`curl -LsSf https://astral.sh/uv/install.sh | sh`)
~/Library/Application Support/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "tokenable": {
      "command": "uvx",
      "args": [
        "tokenable"
      ]
    }
  }
}

same format Cursor, GitHub Copilot CLI, Junie, JetBrains AI Assistant, Augment (Auggie CLI), Factory Droid, Kiro, Devin CLI +12

Values in angle brackets are placeholders. Restart Claude Desktop after editing its config.Claude Desktop docs

README

synced Oct 25, 2026

TokEnable

PyPI Python License CI

FinOps CLI for LLM API costs. Scan code, estimate token spend, recommend cheaper models, and block over-budget PRs.


Quick Start

pip install tokenable
tokenable estimate .
┌──────────────────────────────────────────────────────────────────────────┐
│                          TokEnable Estimate                                │
├─────────────┬──────┬───────────┬──────────────────┬─────────┬────────────┤
│ File        │ Line │ Provider  │ Model            │ $/call  │ $/month    │
├─────────────┼──────┼───────────┼──────────────────┼─────────┼────────────┤
│ src/chat.py │   42 │ anthropic │ claude-opus-4-6  │ $0.0450 │ $45.00     │
│ src/sum.py  │   15 │ openai    │ gpt-4o           │ $0.0035 │  $3.50     │
└─────────────┴──────┴───────────┴──────────────────┴─────────┴────────────┘
Total estimated monthly cost: $48.50

Features

FeatureDescription
Code ScannerDetects LLM API calls in .py, .ts, .js files
Cost EstimationProjects monthly costs from token counts and pricing data
Smart RecommendationsSuggests cheaper models with equivalent capabilities
Auto-FixRewrites model IDs in source files automatically
Budget EnforcementPre-commit hooks and CI gates for cost control
MCP IntegrationAI agent tools via Model Context Protocol
CalibrationCorrects estimates with real provider usage data
Multi-ProviderAnthropic, OpenAI, Google, xAI, Perplexity

CLI Commands

tokenable estimate .                    # Estimate costs
tokenable check . --max-monthly-cost 500  # CI budget gate
tokenable audit .                       # Find savings opportunities
tokenable fix . --dry-run               # Preview model swaps
tokenable diff . --base main            # Cost diff between branches
tokenable price anthropic claude-sonnet-4-6  # Look up pricing
tokenable calibrate . --provider openai # Calibrate from production
tokenable init                          # Set up config + hooks
tokenable update-pricing                # Refresh pricing data (--dynamic for live)

CI Integration

# .github/workflows/tokenable.yml
- run: pip install tokenable
- run: tokenable check . --max-monthly-cost 500

Fails the build if estimated costs exceed your budget. See CI Integration docs.

Pricing Updates

TokEnable ships with bundled pricing data updated each release. For the latest prices:

tokenable update-pricing              # Refresh from static provider data
tokenable update-pricing --dynamic    # Fetch live prices from LiteLLM community DB

A GitHub Actions workflow runs daily to keep pricing in sync automatically.

MCP for AI Agents

TokEnable runs as an MCP server for Claude Code, Cursor, and other AI agents:

{
  "mcpServers": {
    "tokenable": {
      "command": "python",
      "args": ["-m", "tokenable.mcp"]
    }
  }
}

Tools: suggest_model, estimate_cost, audit, apply_recommendations. See MCP docs.

Configuration

Create tokenable.config.json:

{
  "defaultVolume": 1000,
  "ignore": ["**/test/**"],
  "overrides": [
    { "pattern": "src/batch/**", "volume": 50000 }
  ],
  "budgets": {
    "block": 0.05,
    "maxMonthlyCost": 500
  }
}

Supported Providers

ProviderExample Models
Anthropicclaude-opus-4-6, claude-sonnet-4-6, claude-haiku-3-5
OpenAIgpt-4o, gpt-4o-mini, o3, o3-mini
Googlegemini-3.1-pro-preview, gemini-2.5-flash
xAIgrok-3, grok-3-mini
Perplexitysonar-pro, sonar-reasoning-pro, sonar

Full list: Supported Models

Documentation

Development

git clone https://github.com/pardhusrepo/tokenable.git
cd tokenable
pip install -e '.[dev]'
make test

License

Apache-2.0

↑↓ navigate openesc close