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

mcp-cost-tracker

v1.0.0

Published

MCP server that automatically tracks LLM API call costs, token usage, and generates visual dashboards. Supports OpenAI, Anthropic Claude, Google Gemini, DeepSeek, Mistral and more.

Readme

MCP Cost Tracker

An open-source MCP server that automatically tracks LLM API call costs, token usage, and generates visual dashboards.

MCP Server License: MIT TypeScript

mcp-cost-tracker is a powerful, easy-to-use MCP server designed for developers who want to monitor and control their LLM API spending. It provides a comprehensive suite of tools to track token usage, calculate costs across 50+ models, set budgets, and visualize spending patterns.

Dashboard Screenshot
(This is a placeholder image. A real screenshot will be added after the first release.)

✨ Key Features

  • Comprehensive Cost Tracking: Automatically calculates costs for 50+ models from major providers including OpenAI, Anthropic, Google, DeepSeek, Mistral, and more.
  • 15+ MCP Tools: A rich set of tools for tracking usage, analyzing costs, setting budgets, comparing models, and exporting data.
  • Visual Dashboard: Generate a beautiful, interactive HTML dashboard with charts for daily trends, cost breakdowns by model/provider/project, and top expensive requests.
  • Budget Management: Set daily, weekly, or monthly budgets with alerts to prevent cost overruns.
  • SQLite Persistence: All usage data is stored locally in a SQLite database, ensuring data ownership and enabling historical analysis.
  • Easy Integration: Use as a standalone MCP server with any compatible client (like Claude Desktop) or integrate into your existing applications.
  • Non-Intrusive: Designed to work without modifying your existing API call logic.

🚀 Getting Started

Installation

npm install -g mcp-cost-tracker

Running the Server

Simply run the command in your terminal:

mcp-cost-tracker

This will start the MCP server, listening on stdio for requests from a compatible client.

Connecting with Claude Desktop

  1. Open Claude Desktop settings.
  2. Go to the "MCP Servers" section.
  3. Click "Add Server" and choose "From Command".
  4. Enter mcp-cost-tracker as the command.
  5. Save and enable the server.

Now you can use all the cost tracking tools directly within Claude!

🛠️ MCP Tools

mcp-cost-tracker provides a rich set of tools to manage your LLM costs. Here are some of the key tools available:

| Tool Name | Description | | :--- | :--- | | track_usage | Record an API call with token counts and automatically calculate its cost. | | get_summary | Get a summary of total costs, tokens, and request counts, with filters. | | get_cost_by_model | See a cost breakdown grouped by model to identify top cost drivers. | | get_daily_trend | View daily cost trends to spot spending patterns. | | set_budget | Create or update a spending budget with alerts. | | check_budget | Check the current status of your budgets. | | generate_dashboard | Generate an interactive HTML dashboard. | | lookup_pricing | Look up pricing for any supported model. | | estimate_cost | Estimate the cost of an API call before making it. | | compare_models | Compare the cost of a workload across different models. | | export_data | Export usage data to CSV or JSON for external analysis. |

For a full list of tools and their arguments, you can use the tools/list method from your MCP client.

📊 Dashboard

To generate the HTML dashboard, use the generate_dashboard tool:

> generate_dashboard

This will create a dashboard.html file in your ~/.mcp-cost-tracker/ directory. Open this file in your browser to see a detailed visualization of your spending.

⚙️ Configuration

By default, the database is stored at ~/.mcp-cost-tracker/costs.db.

You can specify a custom database path by setting the MCP_COST_TRACKER_DB environment variable:

export MCP_COST_TRACKER_DB=/path/to/your/costs.db
mcp-cost-tracker

🤝 Contributing

Contributions are welcome! Please feel free to submit a pull request or open an issue to discuss improvements.

📄 License

This project is licensed under the MIT License. See the LICENSE file for details.