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

costpilot-mcp

v0.1.2

Published

CostPilot MCP server for per-request AI cost tracking and prompt optimization for Claude Code, Cursor, Windsurf, and more

Readme

CostPilot MCP

Track AI spend, catch prompt waste, and audit AI coding setups from any MCP-compatible client.

CostPilot MCP connects Claude Desktop, Claude Code, Cursor, Windsurf, and other AI tools to your CostPilot dashboard. It exposes tools for request-level cost tracking, prompt optimization, spend insights, and local setup audits.

Install

Run the MCP server with npx:

npx -y costpilot-mcp

Node.js 18 or newer is required.

Claude Desktop

Add CostPilot to your Claude Desktop MCP config:

{
  "mcpServers": {
    "costpilot": {
      "command": "npx",
      "args": ["-y", "costpilot-mcp"],
      "env": {
        "COSTPILOT_KEY": "pilot_live_your_key_here"
      }
    }
  }
}

On Windows, use npx.cmd as the command because many MCP hosts spawn commands directly without going through a shell:

{
  "mcpServers": {
    "costpilot": {
      "command": "npx.cmd",
      "args": ["-y", "costpilot-mcp"],
      "env": {
        "COSTPILOT_KEY": "pilot_live_your_key_here"
      }
    }
  }
}

On Windows, the config file is usually:

%APPDATA%\Claude\claude_desktop_config.json

On macOS, the config file is usually:

~/Library/Application Support/Claude/claude_desktop_config.json

Restart Claude Desktop after saving the config.

Environment

COSTPILOT_KEY=pilot_live_your_key_here

Optional:

COSTPILOT_API_URL=https://api.aicostpilot.online
COSTPILOT_SKIP_TRACKING=true

Use COSTPILOT_SKIP_TRACKING=true when another integration, such as a Claude Code hook or gateway, already records requests. In that mode the MCP server exposes optimization, insights, and audit tools without double-counting usage.

Tools

costpilot_start : Starts a tracked request and estimates input cost before the model answers.

costpilot_track : Completes a tracked request and records final output cost.

costpilot_optimize : Reviews long prompts for token waste and practical savings.

costpilot_insights : Returns recent AI spend, request volume, token usage, and tool breakdown.

costpilot_audit : Audits local AI tool configs for bloated rules files, unused MCP servers, uncapped shell output, and other token-wasting setup issues.

Example Prompts

After connecting the MCP server, try:

How much have I spent on AI this month?
Audit my Claude and Cursor setup for wasted tokens.
Can you optimize this long prompt before answering?

Troubleshooting

If the server prints COSTPILOT_KEY is required, add a valid CostPilot API key to the MCP config env block.

If Claude Desktop does not show the tools, restart Claude Desktop and confirm the package command is exactly:

"args": ["-y", "costpilot-mcp"]

On Windows, also confirm:

"command": "npx.cmd"

If you already track Claude Code with a CostPilot hook, set:

"COSTPILOT_SKIP_TRACKING": "true"

Links

  • Dashboard: https://aicostpilot.online
  • Package: https://www.npmjs.com/package/costpilot-mcp