MohitBansal321

AI Usage MCP — Data skill for Claude Code

Data community

A local-first MCP server that answers, from real data on your machine: How many tokens have I used, from which client, model and session — and what did it cost.

How to install AI Usage MCP

This entry records only its repository, not the path inside it, so there is no exact command to give. Open MohitBansal321/ai-usage-mcp and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What AI Usage MCP does

A local-first MCP server that answers, from real data on your machine: How many tokens have I used, from which client, model and session — and what did it cost?

Alternatives in Data

  • Claude Code Memory Setup — Up to 71.5x fewer tokens per session on Claude Code with Obsidian + Graphify 947 ★
  • Token Dashboard — See where Claude Code is burning tokens - turn raw JSONL transcripts into local cost analytics, hotspot views 669 ★
  • Query Token Info — Search tokens and fetch metadata, real-time market data, and K-Line candlestick charts by keyword or contract 483 ★

README

ai-usage-mcp

[![npm version](https://img.shields.io/npm/v/ai-usage-mcp?logo=npm&color=cb3837)](https://www.npmjs.com/package/ai-usage-mcp) [![CI](https://github.com/MohitBansal321/ai-usage-mcp/actions/workflows/ci.yml/badge.svg)](https://github.com/MohitBansal321/ai-usage-mcp/actions/workflows/ci.yml) [![npm downloads](https://img.shields.io/npm/dm/ai-usage-mcp?logo=npm&color=cb3837)](https://www.npmjs.com/package/ai-usage-mcp) [![node](https://img.shields.io/node/v/ai-usage-mcp?logo=node.js&color=5fa04e)](https://nodejs.org) [![license](https://img.shields.io/npm/l/ai-usage-mcp?color=blue)](LICENSE)

A local-first MCP server that answers, from real data on your machine:

How many tokens have I used, from which client, model and session — and what did it cost?

Phase 1 supports two coding agents: **Claude Code** and **OpenCode**. It reads the data those clients already wrote to disk, normalises it into one schema, stores it in a local SQLite database, and exposes seven MCP tools -- plus resources, prompts and a debug CLI.

**It never fabricates a number.** If a source does not record something, it is reported as unavailable — not as zero.


Install

Requires **Node.js 22+** and **npm 11+**. No compiler or build tools needed — the one native dependency ships prebuilt binaries for macOS, Linux (glibc and musl/Alpine) and Windows, on x64 and arm64.

Claude Code

Nothing to install first — `npx` fetches it on demand:

claude mcp add ai-usage -s user -- npx -y ai-usage-mcp

`-s user` makes it available in every project. Drop it to add the server to the current project only. Then run `/mcp` inside Claude Code to confirm it connected.

No claude command? (VS Code / JetBrains extension users)

The extension reads the same configuration as the CLI, so you can add the server by editing a file — no CLI needed. Pick whichever scope you want:

**For one project** — create `.mcp.json` in the project root