npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

token-tracker-mcp

v1.0.0

Published

Track LLM token costs across Claude, GPT and Gemini. MCP server + CLI dashboard with optimization hints.

Readme

token-tracker-mcp

See where your AI tokens go — and how to spend less of them.

npm npm downloads License: MIT CI Node ≥20


token-tracker-mcp is an MCP server + CLI that logs every Claude / GPT / Gemini API call locally, shows you a cost dashboard in your terminal, and — crucially — tells you exactly how to reduce that cost.

  ⬡ token-tracker  LAST 7 DAYS
────────────────────────────────────────────────────────────────────────────────

  Overview
  Total cost          $18.7421   (~$80.59/month est.)
  API calls           347
  Input tokens        4.82M
  Output tokens       692K
  Cache reads         620K  (11.4% hit rate)
  Avg cost/call       $0.0540

  Daily Cost                           7 days
  Mon Jun 02  ████████████░░░░░░░░░░░░   $2.1400
  Tue Jun 03  ████████████████████░░░░   $3.8200
  Wed Jun 04  ██████░░░░░░░░░░░░░░░░░░   $1.2000
  Thu Jun 05  ████████████████████████   $4.5100

  💡 Optimization Hints               saves $31.20/mo
  ● CRIT  Prompt cache barely used
          Move static content to the top of your messages…
          Evidence: Cache hit rate: 11.4% (620K cached vs 4.82M total input)

  ● HIGH  Expensive model doing test generation
          Route test-gen to claude-haiku-4-5. Saves 80% on those calls.

Install

# global install
npm install -g token-tracker-mcp

# or run without installing
npx token-tracker-mcp report

Connect to Claude Desktop

token-tracker setup

Or add manually to ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "token-tracker": {
      "command": "token-tracker",
      "args": ["serve"]
    }
  }
}

Restart Claude Desktop. Done.


CLI Commands

| Command | Description | |---|---| | token-tracker report | Full 7-day dashboard (default) | | token-tracker report --period month | Monthly report | | token-tracker today | Today only | | token-tracker hints | All optimization hints, ranked by saving | | token-tracker hint cache-utilization | Deep-dive on one hint | | token-tracker status | One-line status: cost · cache % · top hint | | token-tracker budget | Budget gauges | | token-tracker models | Pricing table for all known models | | token-tracker export > usage.csv | Raw data export |


MCP Tools (use inside Claude)

| Tool | Description | |---|---| | log_usage | Log an API call with token counts — auto-calculates cost | | get_summary | Summary for today / week / month / all | | get_hints | Ranked optimization hints with $ savings | | get_hint_detail | Deep-dive on a specific hint | | set_budget | Set a daily / weekly / monthly spend limit | | list_sessions | Sessions ranked by cost | | list_models | Pricing table | | export_csv | CSV dump |


Optimization Hints (8 rules, zero LLM cost)

The hints engine is fully deterministic — no API calls, runs instantly on your local data.

| Hint ID | Triggers when | |---|---| | cache-utilization | Cache hit rate < 30% | | model-swap-testing | Test gen on Sonnet / Opus | | model-swap-debug | Debugging on Opus | | verbose-outputs | Output / input ratio > 0.35 | | session-spike | Any session costs 3× your average | | context-bloat | Avg tokens / call > 8K | | retry-loops | Sessions with 30+ high-token calls | | single-model-dependency | 100% traffic on one expensive model |

Each hint includes: severity · evidence · recommended action · estimated monthly saving.


Data & Privacy

All data is stored at ~/.token-tracker/usage.db (SQLite).
Nothing leaves your machine. No telemetry, no external calls, no account required.


Development

git clone https://github.com/yourusername/token-tracker-mcp
cd token-tracker-mcp
npm install
npm run dev          # watch mode

# run tests
npm test

# release
npm run release:patch   # 1.0.0 → 1.0.1
npm run release:minor   # 1.0.0 → 1.1.0

Roadmap

  • [ ] Team / Supabase backend (multi-user shared dashboard)
  • [ ] Weekly email digest
  • [ ] Slack / webhook alerts
  • [ ] macOS menubar app

License

MIT © 2026