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

@yawlabs/tokenmeter-mcp

v0.3.1

Published

MCP server for LLM spend tracking, cost estimation, and provider comparison

Readme

Token Meter

Open-source MCP server for LLM spend tracking, cost estimation, and provider comparison.

tokenmeter.sh | Docs | Dashboard

What it does

Token Meter tracks your LLM API costs across 10+ providers. Compare model pricing, estimate costs before you spend, set budget alerts, and route requests to the cheapest provider — all from your AI editor.

Works as a local MCP server (open source), remote MCP server (hosted), API gateway, and dashboard.

Quick Start

Local MCP Server (no account needed)

npx @yawlabs/tokenmeter-mcp

This runs the MCP server locally with in-memory storage. All Community tier tools are available immediately — no API key, no sign-up.

Add to Claude Code

claude mcp add tokenmeter -- npx @yawlabs/tokenmeter-mcp

Add to Cursor / VS Code

Add to your MCP client config:

{
  "mcpServers": {
    "tokenmeter": {
      "command": "npx",
      "args": ["@yawlabs/tokenmeter-mcp"]
    }
  }
}

Remote MCP (hosted, no install)

Sign up at tokenmeter.sh and add to your MCP config:

{
  "mcpServers": {
    "tokenmeter": {
      "url": "https://mcp.tokenmeter.sh",
      "headers": {
        "Authorization": "Bearer tm_your_api_key"
      }
    }
  }
}

API Gateway

Swap your provider base URL for smart routing and automatic failover:

OPENAI_BASE_URL=https://gateway.tokenmeter.sh/v1

Tools

Community (Free, Open Source)

Available locally with no account:

| Tool | Description | |------|-------------| | get_spend_summary | Total spend for today, this week, and this month by provider | | get_session_cost | Cost of the current conversation/session | | get_model_pricing | Per-token pricing for any model or provider | | get_cost_estimate | Estimate cost for a workload across multiple models | | compare_models | Side-by-side cost comparison for a specific workload | | get_budget_status | Check spend against configured budget limits | | get_providers | List supported LLM providers |

Pro ($12/mo)

Requires a tokenmeter.sh account:

| Tool | Description | |------|-------------| | get_spend_breakdown | Detailed spend by provider, model, and project | | get_cost_trend | Daily spend over time with trend analysis | | get_top_models | Rank models by spend or token volume | | get_anomalies | Flag unusual spend spikes | | set_budget_alert | Create spend threshold notifications | | set_budget_cap | Set hard spending caps that block requests | | delete_budget_alert | Delete a budget alert by name or ID | | tag_session | Label sessions by project for cost attribution | | export_report | Generate spend reports (JSON/CSV) | | get_rate_limits | Rate limit status per provider | | get_routing_status | Provider health and routing status | | set_routing_rule | Configure smart routing (cheapest, fastest) | | set_fallback_chain | Define provider failover order | | set_project_quota | Set per-project spend caps | | get_latency_report | P50/P95/P99 latency per provider | | set_model_alias | Map friendly names to provider/model pairs | | get_cache_stats | Semantic cache hit rate and cost savings | | set_cache_config | Enable/disable caching, adjust TTL |

Team ($39/mo per seat)

| Tool | Description | |------|-------------| | get_team_spend | Aggregated spend across all team members | | set_team_budget | Organization-level budget caps |

Supported Providers

Anthropic (Claude), OpenAI (GPT, o-series), Google (Gemini), Groq, DeepSeek, Mistral, Cohere, Ollama, Azure OpenAI, AWS Bedrock

Development

# Install dependencies
npm install

# Run locally (stdio MCP server)
npm run dev

# Run tests
npm test

# Build
npm run build

Architecture

src/
  index.ts          # Local MCP entry point (stdio)
  mcp/server.ts     # Tool definitions and handlers
  db/memory.ts      # In-memory data store (local)
  db/postgres.ts    # PostgreSQL store (cloud)
  pricing/          # Model pricing engine + YAML data
  tools/            # Tool handler implementations
  gateway/          # API gateway + smart routing
  api/              # REST API server (cloud)
  billing/          # LemonSqueezy integration
  auth/             # Auth + team management

The local MCP server (src/index.ts) uses MemoryStore and requires zero external infrastructure — no database, no Redis, no API keys. Data is ephemeral (in-process memory).

The cloud service adds persistent storage (PostgreSQL), caching (Valkey), authentication, billing, and the web dashboard.

Part of the Yaw Labs ecosystem

License

Copyright (c) 2026 Yaw Labs LLC. All rights reserved.