Claude Code Usage

io.github.wheelbarrel00Published by GitHub account wheelbarrel00v0.1.0Updated Oct 24, 2026

Claude Code token usage, cost, and plan limits from local logs and Anthropic's usage API.

The publisher's own server: Claude Platform Docs

Overview

AI-generated overview

A local MCP server that reports Claude Code token usage, estimated cost and plan-limit status from local logs and Anthropic's usage API.

What you can do
Show today's cost and tokens, 5-hour and weekly plan-limit utilization with reset times and pace projection, burn rate, context-window fill and extra pay-as-you-go usage from local Claude Code logs and the usage API. Break usage down by model, project, session or git branch, or over time by day this month and by month all-time. Answer on-demand questions such as current usage or spend by project this month.
When to use it
Useful when you want an assistant to answer questions about your own Claude Code consumption, spending and plan limits without leaving the chat, or to break that spend down by project or model.
Requirements
Runs locally over stdio, typically launched with npx from the npm package claude-code-usage-mcp. Needs an authenticated Claude Code install, since it reads the credentials file and project logs under the Claude Code config directory. Optional environment variables tune currency, decimals, live API use, request interval, burn window, project grouping and config directory. Network access is used for live plan limits.
Before you install
Reads Claude Code's local credentials file and session logs, and sends the on-disk OAuth token to Anthropic's usage endpoint to fetch live limits; the token is refreshed in memory only. Usage and cost figures are derived from local logs and are estimates. No write, send or delete tools are described.

Installation

In SourceWeft

  1. Open Claude Code Usage in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.

Other MCP clients

Follow the launch instructions in the repository.

README

Claude Code Usage

[npm version] [MCP Registry] [License: MIT]

An MCP server that surfaces your Claude Code token usage, estimated cost, and plan-limit status in any MCP client (Zed, Claude Desktop, Cursor, and others). It reads Claude Code's own logs (~/.claude/projects/**/*.jsonl) and Anthropic's usage API, then exposes the data as tools the agent can call.

Published on npm as claude-code-usage-mcp and in the official MCP registry as io.github.wheelbarrel00/claude-code-usage.

What you get

Two tools:

  • get_claude_usage — today's cost and tokens, 5-hour and weekly plan-limit utilization (with reset times and a pace projection), recent burn rate, current context-window fill, and pay-as-you-go extra usage.
  • get_usage_breakdown — usage grouped by model, project, session, or git branch, or over time (daily this month / monthly all-time).

Ask the agent things like "what's my Claude usage right now?" or "break down my Claude spend by project this month." MCP tools are queried on demand — there's no persistent status-bar display.

Install

sh
npx -y claude-code-usage-mcp

Register it with your client. For Zed (settings.json):

json
{  "context_servers": {    "claude-code-usage": {      "command": "npx",      "args": ["-y", "claude-code-usage-mcp"]    }  }}

For Claude Desktop (claude_desktop_config.json), use the same command under "mcpServers" instead of "context_servers".

Requirements

An authenticated Claude Code install — the server reads ~/.claude/.credentials.json and ~/.claude/projects, the same files the CLI writes.

Configuration

Optional environment variables:

VariableDefaultMeaning
CCU_CURRENCYUSDISO currency code for cost formatting.
CCU_DECIMALS2Decimal places for cost figures.
CCU_USE_LIVE_APItrueFetch live limits from Anthropic; falls back to the on-disk cache.
CCU_LIVE_MIN_INTERVAL_SECONDS180Minimum seconds between live usage requests.
CCU_BURN_WINDOW_MINUTES15Trailing window for the burn-rate calculation.
CCU_PROJECT_GROUPINGgitgit, folder, or flat grouping for the project breakdown.
CLAUDE_CONFIG_DIR~/.claudeOverride the Claude Code config directory.

How it works

Live plan limits come from api.anthropic.com/api/oauth/usage using the OAuth token already on disk; the access token is refreshed in memory only, so a running Claude Code session is never logged out. Token and cost figures are parsed from the local session logs.

Repository layout

  • mcp-server/ — the MCP server (TypeScript, bundled to dist/server.mjs).
  • extension.toml, Cargo.toml, src/lib.rs — a self-contained Zed extension that embeds and launches the server (an alternative to the npx install above).

Build from source

sh
cd mcp-servernpm installnpm run build      # bundles to dist/server.mjsnode dist/server.mjs --selftest

Zed extension (self-contained, no npm needed)

The Zed extension embeds the bundled server and launches it with Zed's own Node. Build the server first, install rustup and the WebAssembly target (rustup target add wasm32-wasip1), then in Zed open Extensions → Install Dev Extension and select this repository's root folder.

License

MIT

Source: README.md at commit bca551d

Tools

0
SourceWeft has not started this package in its sandbox yet, so its tools are not known.

Version history

1
  1. v0.1.0LatestSep 16, 2026

Score

50% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 days25 pts

    Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.

  • Auth declared10 pts

    Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.

  • Tools listed15 pts

    Answer tools/list without a credential, or ship a package that starts in a sandbox without one.

  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts
  • License10 pts

Other Claude integrations