AI Usage
NPM · AI-USAGE-MCP
Reports real token usage and cost from Claude Code and OpenCode data. Nothing leaves your machine.
Available components
Last scanned (8 hours ago)
Scores higher than 97% of npm servers
Category Developer Tools
How this component scores in each security and reliability category. Every signal is checked automatically from public evidence about the published package, including repeated runs of it in an isolated sandbox, and we only credit what we can confirm. How we score → Why this is hard to score →
Supply Chain Security98
- No malware found by supply-chain analysis.Pass
- No known CVEs affecting this package version or its production dependencies.Pass
- No install/post-install scripts declared.Pass
- 30 of 94 dependencies flagged as unhealthy. View diagnostics → Partial
Provenance & Transparency100
- Source repository is publicly reachable at the declared URL. View diagnostics → Pass
- Cryptographically verified build provenance (signed, bound to MohitBansal321/ai-usage-mcp). View diagnostics → Pass
- Clear OSI-approved license (MIT).Pass
- Actively maintained (last published 12 days ago).Pass
- Publishes a security disclosure policy (SECURITY.md).Pass
Schema Quality & AI Usability74
- 100% of prompts and resources have a non-trivial description (not blank, and not just the item's name).Pass
- AI-judged instruction clarity (good).Pass
- Context-footprint check failed: tool/resource definitions use about 3806 tokens (~253/item across 15 items; 12 tools + 3 resources), over budget; trim descriptions and params. See how to fix → Fail
- Usage-examples check failed: none of the tools include examples. See how to fix → Fail
Stability & Change Management97
- Stability observed for 29 of 30 days with no destabilising changes; credit accrues until the full window elapses.Partial
Tool Coverage100
- 100% of tools have a non-trivial description (not blank, and not just the tool's name).Pass
- 100% of tool parameters carry a description.Pass
Tool Safety100
- No prompt-injection markers were found in the server instructions, tool names or descriptions we captured.Pass
- We read all 12 captured tool definition(s), and no name or description among them implies an irreversible operation.Pass
- An AI judge read all 14 captured unit(s) of tool text and found none that tries to manipulate the model reading it.Pass
Capabilities100
- Implements a supported MCP spec version (2025-11-25); the latest is 2026-07-28.Pass
Every change we have recorded for this component, newest first. Security-relevant changes are always shown. ▲ marks a change for the better, ▼ a change for the worse; unmarked changes are neutral.
- 4 Nov 26 +1
No change was recorded against any check on this day. Stability & Change Management went from 90 to 93. That category is still filling its 30-day observation window: 27 days of observed history at the previous scan, 28 at this one. The score rises as the window fills, whether or not the server changes.
- 3 Nov 26 −2
- Stability: pass → 0.90 functional
- 24 Oct 26 +26
- Malware scan: unverified → pass ▲ security
- Known CVEs: unverified → pass ▲ security
- Dependency health: unverified → 0.86 ▲ functional
- 23 Oct 26 −26
- Known CVEs: pass → unverified ▼ security
- Malware scan: pass → unverified ▼ security
- Dependency health: 0.85 → unverified ▼ functional
- Schema quality: 303 → 253 ▲ functional
- Schema quality: excellent → good functional
- Package version: 0.14.0 → 0.16.1 functional
- Package version: 0.14.0 → 0.15.0 functional
- 17 Oct 26 0
- Stability: 0.97 → pass security
- 16 Oct 26 +1
- Stability: 0.93 → unverified ▼ security
- Tool safety: pass → unverified ▼ security
- Capabilities: pass → unverified ▼ functional
- Tool coverage: 100 → unverified ▼ functional
- Schema quality: 100 → unverified ▼ functional
- Package version: 0.13.0 → 0.14.0 functional
- 14 Oct 26 +45
- Injection markers: unverified → pass ▲ security
- Tool coverage: unverified → 100 ▲ functional
- Schema quality: unverified → 100 ▲ functional
- MCP protocol: unverified → pass ▲ functional
- Stability: unverified → 0.90 ▲ functional
- 12 Oct 26 −43
- Stability: 0.80 → unverified ▼ security
- Tool safety: pass → unverified ▼ security
- Capabilities: pass → unverified ▼ functional
- Tool coverage: 100 → unverified ▼ functional
- Schema quality: 100 → unverified ▼ functional
- Security disclosure: unverified → pass ▲ functional
- Package version: 0.12.1 → 0.13.0 functional
Diagnostic detail from the automated scan of this channel: what the scanner observed at each step, so you can see exactly where a check passed or failed. It is informational only and never changes the trust score.
Captured 5 Nov 2026 · Analysed npm/ai-usage-mcp@0.16.1
Provenance Verified
A signed build attestation was found and verified, binding this exact artifact to the source repository it claims to come from.
| Result | Verified |
|---|---|
| Ecosystem | npm |
| Reason | Verified |
| Discovered via | Registry attestation endpoint |
| Source repo | MohitBansal321/ai-usage-mcp |
| Certificate issuer | https://token.actions.githubusercontent.com |
| Certificate SAN | https://github.com/MohitBansal321/ai-usage-mcp/.github/workflows/release.yml@refs/tags/v0.16.1 |
| Rekor log index | 3415688778 |
| Predicate type | SLSA build provenance https://slsa.dev/provenance/v1 |
| Subject digest | sha512:708605ca1404d6f780bade697a57f4208514429f40f9b259d94e79b841df263d37fd173bf777006f5db776e2b444ecf6765931aee0beb2dd7e726f525 |
Background: How many MCP packages publish verified provenance →
Dependencies 94 packages
| Packages resolved | 94 |
|---|---|
| Stale | 30 |
| Tree resolution | Complete |
Background: SBOMs and build attestations, explained →
The tools this component advertises to a client, with an estimated token cost for each. Expand a tool to see its parameters and schema. The per-tool counts are indicative and are not scored directly; the schema's total context footprint is one signal in Schema Quality & AI Usability. A tool's description is untrusted text the model reads on every call, which is what makes this list a security surface and not just an inventory: how tool poisoning works →
cache_health Cache Health ~252
Finds cache breaks in a session -- turns where the prompt-cache prefix was not reused, so the context was re-written at cache-write prices instead of read back cheaply. A break is a spike in cache writes AND a drop in cache reads; a write spike alone (e.g. reading one large file) is not one. Each break lists the turn, token counts, likely cause (model or speed switch, idle past the 5-minute TTL, or an early-context change such as an edited CLAUDE.md), and its API-equivalent write premium from the pricing table. Also returns the overall cache hit rate and reads-per-write.
| Name | Type | Req | Description |
|---|---|---|---|
| baselineWindow | integer | – | Number of previous turns to average for the baseline. |
| includeSubagents | boolean | – | Also analyze subagent/sidechain turns, baselined separately from main turns since they keep their own cache. Defaults to false. |
| minCacheWrites | integer | – | Minimum absolute cache writes on a turn to consider (filters noise). |
| sessionId | string | yes | Session ID (full or unambiguous prefix) to analyze. |
| spikeThreshold | number | – | Minimum spike ratio (current writes / rolling average) to flag as a break. |
No output schema declared.
No examples provided.
client_usage Usage by client ~295
Token usage and cost per coding agent (Claude Code, OpenCode, Codex). Note that the two cost figures are not comparable as a single number: OpenCode reports actual charged cost, while the Claude Code and Codex figures are API-equivalent estimates (a subscription has $0 marginal cost per request).
| Name | Type | Req | Description |
|---|---|---|---|
| days | integer | – | Look back this many days, counted from local midnight. Omit for all time. |
| includeSubagents | boolean | – | Include subagent turns. Default true: they are real spend. |
| limit | integer | – | Rows to return. |
| models | array | – | Restrict to these model ids, as recorded (see model_usage). |
| offset | integer | – | Rows to skip; pass `nextOffset` from the previous result. |
| projectPath | string | – | Deprecated: use projectPaths. |
| projectPaths | array | – | Restrict to these projects: absolute working directories, matched exactly (see project_usage). A path matching nothing is reported, not answered as empty. |
| since | string | – | ISO 8601 start of the period (inclusive). |
| sort | string | – | Descending order. Reported and estimated cost are never summed, so there is no plain "cost": pick the basis you mean. |
| today | boolean | – | Restrict to today, in local time. |
| until | string | – | ISO 8601 end of the period (exclusive). |
No output schema declared.
No examples provided.
counterfactual_cost Cost on another model ~482
What the tokens from a period would have cost at another model’s list rates, alongside what they actually cost. Use this for "would Sonnet have been cheaper than Opus for this". It re-prices the exact token counts that were recorded, grouped by client, model and speed so the fast-mode premium and the two different reasoning-token conventions are handled correctly. Also reports what the same tokens would have cost with NO prompt caching at all, per model -- which is the figure that says whether caching is paying for itself. IMPORTANT: the model scenarios are a counterfactual, not a saving — the same task on a different model generally takes a different number of turns with a different context on each, and nothing on disk can say what that would have been. Report it as such, keep every scenario labelled an estimate, and never subtract a scenario from the reported cost to claim a number.
| Name | Type | Req | Description |
|---|---|---|---|
| client | – | – | Restrict to these clients (a single id also works). |
| days | integer | – | Look back this many days, counted from local midnight. Omit for all time. |
| filterModels | array | – | Restrict which turns are included, by model id -- the same scope filter other tools spell `models`. Named apart here because `models` already meant "price against these" on this tool. Use both togeth… |
| includeSubagents | boolean | – | Include subagent turns. Default true: they are real spend. |
| models | array | – | Deprecated spelling of targetModels. Still honoured. |
| projectPath | string | – | Deprecated: use projectPaths. |
| projectPaths | array | – | Restrict to these projects: absolute working directories, matched exactly (see project_usage). A path matching nothing is reported, not answered as empty. |
| since | string | – | ISO 8601 start of the period (inclusive). |
| targetModels | array | – | Models to price the selected tokens AGAINST. Not a filter on which turns are included -- that is `filterModels`. Omit to compare every model the pricing table knows. A model with no price is omitted… |
| today | boolean | – | Restrict to today, in local time. |
| until | string | – | ISO 8601 end of the period (exclusive). |
No output schema declared.
No examples provided.
daily_usage Usage by day ~343
Token usage and cost bucketed on the time axis, newest first. Use this for "how much did I use yesterday", for a trend over a period, or -- with grain "hour-of-day" -- for "when during the day do I burn tokens". Buckets with NO activity are included and flagged `zeroFilled`, because omitting them hides the gaps and makes an ordinary bucket look like a spike beside one weeks earlier. All buckets are local time, so they agree with the period filter rather than drifting by a timezone offset. Cost is labelled reported vs estimated per bucket.
| Name | Type | Req | Description |
|---|---|---|---|
| client | – | – | Restrict to these clients (a single id also works). |
| days | integer | – | Look back this many days, counted from local midnight. Omit for all time. |
| grain | string | – | Time bucket, local time (default day). "hour-of-day" folds every day onto one 24-slot clock: "when during the day do I burn tokens". |
| includeSubagents | boolean | – | Include subagent turns. Default true: they are real spend. |
| models | array | – | Restrict to these model ids, as recorded (see model_usage). |
| projectPath | string | – | Deprecated: use projectPaths. |
| projectPaths | array | – | Restrict to these projects: absolute working directories, matched exactly (see project_usage). A path matching nothing is reported, not answered as empty. |
| since | string | – | ISO 8601 start of the period (inclusive). |
| today | boolean | – | Restrict to today, in local time. |
| until | string | – | ISO 8601 end of the period (exclusive). |
No output schema declared.
No examples provided.
model_usage Usage by model ~282
Per-model token usage and cost, highest token count first. Use this to answer "which model consumed the most tokens". Cost is labelled reported vs estimated per model.
| Name | Type | Req | Description |
|---|---|---|---|
| client | – | – | Restrict to these clients (a single id also works). |
| days | integer | – | Look back this many days, counted from local midnight. Omit for all time. |
| includeSubagents | boolean | – | Include subagent turns. Default true: they are real spend. |
| limit | integer | – | Rows to return. |
| models | array | – | Restrict to these model ids, as recorded (see model_usage). |
| offset | integer | – | Rows to skip; pass `nextOffset` from the previous result. |
| projectPath | string | – | Deprecated: use projectPaths. |
| projectPaths | array | – | Restrict to these projects: absolute working directories, matched exactly (see project_usage). A path matching nothing is reported, not answered as empty. |
| since | string | – | ISO 8601 start of the period (inclusive). |
| sort | string | – | Descending order. Reported and estimated cost are never summed, so there is no plain "cost": pick the basis you mean. |
| today | boolean | – | Restrict to today, in local time. |
| until | string | – | ISO 8601 end of the period (exclusive). |
No output schema declared.
No examples provided.
plan_usage Plan Usage ~178
How much of the Claude Pro/Max 5-hour and weekly usage limits is used, as Claude Code itself last reported it, with when each window resets. Also the average pace within the window and the time it would reach 100% at that pace (a projection, labelled as one), and the tokens and API-equivalent cost of this machine's Claude Code turns since the window began. The percentages are recorded only while `ai-usage statusline` is configured as the Claude Code status line; without it they are reported as unavailable, never as 0%. Answers "how close am I to my limit" and "will I run out before it resets".
| Name | Type | Req | Description |
|---|---|---|---|
| includeSubagents | boolean | – | Count subagent turns in this machine's token figures. Defaults to true. Does not affect the percentages, which are Claude Code's own. |
No output schema declared.
No examples provided.
project_usage Usage by project ~312
Per-project token usage and cost, highest token count first. A project is the working directory a turn ran in. Use this to answer "which repository is my spend going to". Turns whose project could not be resolved are grouped as (unknown) rather than dropped, and cost is labelled reported vs estimated per project.
| Name | Type | Req | Description |
|---|---|---|---|
| client | – | – | Restrict to these clients (a single id also works). |
| days | integer | – | Look back this many days, counted from local midnight. Omit for all time. |
| includeSubagents | boolean | – | Include subagent turns. Default true: they are real spend. |
| limit | integer | – | Rows to return. |
| models | array | – | Restrict to these model ids, as recorded (see model_usage). |
| offset | integer | – | Rows to skip; pass `nextOffset` from the previous result. |
| projectPath | string | – | Deprecated: use projectPaths. |
| projectPaths | array | – | Restrict to these projects: absolute working directories, matched exactly (see project_usage). A path matching nothing is reported, not answered as empty. |
| since | string | – | ISO 8601 start of the period (inclusive). |
| sort | string | – | Descending order. Reported and estimated cost are never summed, so there is no plain "cost": pick the basis you mean. |
| today | boolean | – | Restrict to today, in local time. |
| until | string | – | ISO 8601 end of the period (exclusive). |
No output schema declared.
No examples provided.
recent_sessions Recent sessions ~280
Most recently active sessions with project path, client, model(s), duration, token breakdown and cost. Use the returned session id with session_usage for detail.
| Name | Type | Req | Description |
|---|---|---|---|
| client | – | – | Restrict to these clients (a single id also works). |
| days | integer | – | Look back this many days, counted from local midnight. Omit for all time. |
| includeSubagents | boolean | – | Include subagent turns. Default true: they are real spend. |
| limit | integer | – | Rows to return. |
| models | array | – | Restrict to these model ids, as recorded (see model_usage). |
| offset | integer | – | Rows to skip; pass `nextOffset` from the previous result. |
| projectPath | string | – | Deprecated: use projectPaths. |
| projectPaths | array | – | Restrict to these projects: absolute working directories, matched exactly (see project_usage). A path matching nothing is reported, not answered as empty. |
| since | string | – | ISO 8601 start of the period (inclusive). |
| sort | string | – | Descending order. Reported and estimated cost are never summed, so there is no plain "cost": pick the basis you mean. |
| today | boolean | – | Restrict to today, in local time. |
| until | string | – | ISO 8601 end of the period (exclusive). |
No output schema declared.
No examples provided.
session_usage Session usage ~90
Usage for one session: client, model(s), duration, token breakdown and cost. Accepts a full session id or an unambiguous fragment of one. Subagent turns are reported separately from main-thread turns.
| Name | Type | Req | Description |
|---|---|---|---|
| includeSubagents | boolean | – | Include subagent turns in the totals. Defaults to true. |
| sessionId | string | yes | Session id, or an unambiguous part of one. |
No output schema declared.
No examples provided.
usage_breakdown Usage broken down by two dimensions ~422
Token usage and cost cut by two or more dimensions at once -- project x day, model x day, client x day -- as one tidy row set. Use this for "which of my projects is getting more expensive", which the single-axis tools cannot answer: project_usage gives a total with no trend, and daily_usage narrowed to one project gives one series, so answering it otherwise means enumerating projects and issuing one call each. Combinations with no activity are absent rather than returned as zero rows. Cost stays labelled reported vs estimated per row and the two are never summed.
| Name | Type | Req | Description |
|---|---|---|---|
| axes | array | yes | Dimensions to cross, in output order: client, model, provider, project, session, day, hour, hour-of-day. At most 3, and each at most once. The time axes bucket in local time, identically to daily_usa… |
| client | – | – | Restrict to these clients (a single id also works). |
| days | integer | – | Look back this many days, counted from local midnight. Omit for all time. |
| includeSubagents | boolean | – | Include subagent turns. Default true: they are real spend. |
| limit | integer | – | Rows to return. |
| models | array | – | Restrict to these model ids, as recorded (see model_usage). |
| offset | integer | – | Rows to skip; pass `nextOffset` from the previous result. |
| projectPath | string | – | Deprecated: use projectPaths. |
| projectPaths | array | – | Restrict to these projects: absolute working directories, matched exactly (see project_usage). A path matching nothing is reported, not answered as empty. |
| since | string | – | ISO 8601 start of the period (inclusive). |
| sort | string | – | Descending order. Reported and estimated cost are never summed, so there is no plain "cost": pick the basis you mean. |
| today | boolean | – | Restrict to today, in local time. |
| until | string | – | ISO 8601 end of the period (exclusive). |
No output schema declared.
No examples provided.
usage_report Usage report ~312
Where a period of usage went, how much of it did no new work, and what to change -- the first thing to run for "where are my tokens going" or "why do I hit my limit". Gives a verdict, the share of usage spent re-reading large contexts (every message re-sends the whole conversation) and rebuilding a lost prompt cache, the heaviest sessions by their own titles and git branches, usage per branch, and plain-language fixes. Shares are weighted by API-equivalent list price as a relative measure; on a subscription that figure is not money spent. Defaults to the last 7 days.
| Name | Type | Req | Description |
|---|---|---|---|
| client | – | – | Restrict to these clients (a single id also works). |
| days | integer | – | Look back this many days, counted from local midnight. Omit for all time. |
| includeSubagents | boolean | – | Include subagent turns. Default true: they are real spend. |
| models | array | – | Restrict to these model ids, as recorded (see model_usage). |
| projectPath | string | – | Deprecated: use projectPaths. |
| projectPaths | array | – | Restrict to these projects: absolute working directories, matched exactly (see project_usage). A path matching nothing is reported, not answered as empty. |
| since | string | – | ISO 8601 start of the period (inclusive). |
| today | boolean | – | Restrict to today, in local time. |
| until | string | – | ISO 8601 end of the period (exclusive). |
No output schema declared.
No examples provided.
usage_summary Usage summary ~346
Total token usage and cost for a period, split by client (Claude Code, OpenCode, Codex). Tokens are broken out into input / output / cache-read / cache-write / reasoning, because cache tokens typically dwarf input and a single blended total is misleading. Reported cost (from OpenCode) and estimated cost (computed for Claude Code and Codex, which record none) are always listed separately and must not be summed. Also reports the cache hit rate and reads-per-write, which are what say whether the cache is paying for itself -- the raw cache counts alone cannot.
| Name | Type | Req | Description |
|---|---|---|---|
| client | – | – | Restrict to these clients (a single id also works). |
| compare | string | – | Also report the equally long window just before this one, with the delta. Needs a fixed-length period (days, today, or since AND until); an open-ended one is rejected. |
| days | integer | – | Look back this many days, counted from local midnight. Omit for all time. |
| includeSubagents | boolean | – | Include subagent turns. Default true: they are real spend. |
| models | array | – | Restrict to these model ids, as recorded (see model_usage). |
| projectPath | string | – | Deprecated: use projectPaths. |
| projectPaths | array | – | Restrict to these projects: absolute working directories, matched exactly (see project_usage). A path matching nothing is reported, not answered as empty. |
| since | string | – | ISO 8601 start of the period (inclusive). |
| today | boolean | – | Restrict to today, in local time. |
| until | string | – | ISO 8601 end of the period (exclusive). |
No output schema declared.
No examples provided.
How do I install the AI Usage MCP server?
AI Usage runs locally as an npm package, launched with npx -y ai-usage-mcp. Ready-made configuration for Claude, Cursor, VS Code, Codex and 5 more is on this page, copied from each client's own documentation.
npm · ai-usage-mcp
claude mcp add mohitbansal321-ai-usage-mcp -- npx -y ai-usage-mcp
What is the AI Usage MCP server?
AI Usage is an MCP server listed in the public MCP registry as io.github.MohitBansal321/ai-usage-mcp. Reports real token usage and cost from Claude Code and OpenCode data. Nothing leaves your machine. This page covers its npm package (ai-usage-mcp).
Is the AI Usage MCP server safe to use?
AI Usage scores 94 out of 100 on VerifyMCP. We found no known CVEs affecting it as of 5 November 2026. It declares no install or post-install scripts. Its build provenance is signed and verified. That is a record of what we were able to check automatically, not an endorsement. The category breakdown on this page shows every signal behind the number, including the ones we could not confirm.
What tools does the AI Usage MCP server expose?
AI Usage exposes 12 tools: usage_summary, session_usage, model_usage, client_usage, project_usage, and 7 more. Their descriptions and schemas cost roughly 3,594 tokens of context every time the server is loaded.
Is the AI Usage MCP server still maintained?
AI Usage is still listed as active in the MCP registry. We last reached this channel on 5 November 2026. Those dates come from our own scans of the registry and the channel itself, not from anything the publisher announced.
What licence is the AI Usage MCP server under?
AI Usage declares the MIT licence, which is OSI-approved. That covers the source only, and says nothing about the cost of any service it calls.