Claude Token Analyzer MCP Server

All processing happens locally. The SQLite database lives under the plugin data directory in plugin mode and falls back to `~/.claude/` in standalone

Local serverstdioGo

What is the Claude Token Analyzer MCP server?

Claude Token Analyzer MCP server is a locally run integration for AI assistants that speak the Model Context Protocol. All processing happens locally. The SQLite database lives under the plugin data directory in plugin mode and falls back to ~/.claude/ in standalone mode. No network calls, no external dependencies at runtime.

What you get

  • Diagnose token waste — — Detects 6 statistical anomaly types (HighCost, LowCacheHitRate, CostInefficient, ExcessiveToolUse, HighTokenUsage, UnusualModelMix) with severity scoring
  • Audit costs — — Per-session, per-project, and global cost breakdowns with monthly trends
  • Forecast spending — — Daily/weekly/monthly usage trends with burn-rate projections
  • Optimize cache — — Identifies sessions with poor cache hit rates that inflate costs
  • Prioritize fixes — — Severity-scored anomalies so you know what to fix first, not just what's wrong
  • Converse naturally — — Ask in plain language: "how much did I spend?" or "scan for anomalies"

Setting it up

Setup follows the usual MCP pattern — install or clone the server, register it in your client's configuration file, restart the client.

What the assistant can call

Once Claude Token Analyzer is connected, these are the calls the assistant has available:

  • sync_db — Sync JSONL session logs to SQLite
  • analyze_session — 10-dimension session analysis
  • analyze_project — Project-level aggregation with sorting
  • analyze_global — Cross-project panoramic view
  • cost_report — Monthly cost report (daily granularity available)
  • anomaly_scan — 6-type anomaly detection with severity scoring
  • trend_report — Time-series trends (daily/weekly/monthly)

Configuration and credentials

You will need 2 environment variables: CTA_DB_PATH, CTA_PRICING_PATH. Keep credentials in your client's env block or a secrets manager rather than in a file you might commit.

Before you rely on it

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • MCP clients confirm each tool call by default. Leave that on until you have watched what the claude token analyzer mcp server does with a few real requests.

Choosing this one

Plenty of database access servers cover similar ground. The differences that matter in practice are scope of access and how much setup stands between you and a working tool call. Claude Token Analyzer's toolset — sync_db, analyze_session, analyze_project and 4 more — is a fair guide to whether it matches your workflow. It is maintained by li195111; worth a glance at recent repository activity before you build anything load-bearing on it.

We check each listing at SyncDev against the project's documentation before it goes live — if something here drifts out of date, it is a bug worth reporting.

Available tools

ToolWhat it does
sync_dbSync JSONL session logs to SQLite
analyze_session10-dimension session analysis
analyze_projectProject-level aggregation with sorting
analyze_globalCross-project panoramic view
cost_reportMonthly cost report (daily granularity available)
anomaly_scan6-type anomaly detection with severity scoring
trend_reportTime-series trends (daily/weekly/monthly)

Configuration

VariableDescriptionRequired
CTA_DB_PATHFilesystem location the server is allowed to use.Optional
CTA_PRICING_PATHFilesystem location the server is allowed to use.Optional

Example prompts to try

  • Use Claude Token Analyzer to sync db.
  • Use Claude Token Analyzer to analyze session.
  • Use Claude Token Analyzer to analyze project.

Frequently asked questions

It connects Claude Token Analyzer to MCP-compatible AI assistants such as Claude and Cursor, exposing 7 tools (sync_db, analyze_session, analyze_project, and more) that the assistant can call on your behalf. Instead of copying data back and forth by hand, the assistant works with Claude Token Analyzer directly.