usage-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@usage-mcphow much usage do I have left?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
📊 usage-mcp
Let Claude check your Claude usage limits — mid-conversation.
The same 5-hour and weekly percentages that /usage shows, exposed as an MCP tool,
so you can just ask "how much usage do I have left?" and Claude looks it up itself.
✨ Why
/usage is great, but Claude itself can't see it. That means Claude can't pace a long
task, warn you before you hit a wall, or tell you whether there's room for one more big
refactor before the window resets.
With usage-mcp installed, Claude gets a get_usage tool and can answer things like:
You: Do I have enough usage left to run the full test-suite migration?
Claude: (calls
get_usage) You're at 42% of your 5-hour window (resets in 4h 8m) and 15% of your weekly limit. Plenty of room. Starting now.
It works in the VS Code extension too, where the terminal status line isn't rendered.
Related MCP server: claude-usage-mcp
🚀 Install
The easy way: let your agent do it
Clone the repo, open it in Claude Code (or any coding agent), and say:
Follow SETUP.md to install this for me.SETUP.md is written for the agent. It checks your Python, installs
the dependency, registers the MCP server with the right absolute paths for your OS,
and verifies everything end-to-end.
The manual way
Requirements: Python 3.10+ and Claude Code, logged in with a Claude subscription (Pro / Max / Team). API-key-only logins have no usage limits to show.
# 1. Clone
git clone https://github.com/dmytrochygarov/usage-mcp.git
cd usage-mcp
# 2. Install the one dependency
python -m pip install -r requirements.txt
# 3. Sanity check: should print JSON with five_hour / seven_day percentages
python usage_cli.py
# 4. Register with Claude Code (user scope = available in every project)
# Use ABSOLUTE paths for both the Python interpreter and the server script.
claude mcp add usage --scope user -- "$(python -c 'import sys;print(sys.executable)')" "$(pwd)/usage_mcp_server.py"$py = python -c "import sys; print(sys.executable)"
claude mcp add usage --scope user -- $py "$PWD\usage_mcp_server.py"Then run claude mcp list. You should see usage: ... ✔ Connected. Start a fresh
session (or run /mcp to reconnect) and ask Claude about your usage.
🧠 How it works
flowchart LR
C["Claude<br/>(calls get_usage)"] --> S["usage_mcp_server.py<br/>(FastMCP, stdio)"]
S --> R{"cache fresh?<br/>(≤ 120 s)"}
R -- yes --> J[("~/.claude/<br/>usage-live.json")]
R -- no --> T{"throttle allows?<br/>(≤ 1 call / 180 s)"}
T -- yes --> API["GET api.anthropic.com<br/>/api/oauth/usage"]
API --> J
T -- no --> JClaude Code already stores your OAuth login:
~/.claude/.credentials.jsonon Windows/Linux, and the login Keychain on macOS.On a tool call, usage-mcp serves a small local cache if it's fresh. Otherwise it makes one read-only GET to the same usage endpoint
/usageuses.Calls are throttled (max 1 per 180 s, plus a 15-min backoff after any HTTP 429), so bursts of questions never hammer the endpoint.
If anything fails (offline, expired token, throttled), it degrades to the last cached snapshot with a note instead of erroring.
File | Role |
| All the logic. Stdlib only. |
| MCP server: one tool, |
| Same data from the terminal: |
Example output
{
"source": "oauth-api",
"data_age_seconds": 0,
"stale": false,
"five_hour": { "used_percentage": 42.0, "resets_in": "4h 8m" },
"seven_day": { "used_percentage": 15.0, "resets_in": "1d 16h" },
"seven_day_scoped": [
{ "model": "Fable", "used_percentage": 10.0, "resets_in": "6d 22h" }
]
}seven_day_scoped lists per-model weekly caps (what /usage calls "Weekly Fable",
etc.). It's empty when your plan has none active.
🔒 Safety
Read-only. It only ever performs a single
GETon the usage endpoint.Your token never leaves the request. It's used solely for the
Authorizationheader and is never logged, printed, returned to Claude, or written to the cache.No token refresh logic. On a 401 it just serves the cache and lets Claude Code refresh its own login.
Nothing sensitive in the repo. The cache and throttle state live in
~/.claude/.
⚙️ Configuration
All optional, via environment variables (pass them with claude mcp add -e KEY=VALUE):
Variable | Default | Meaning |
|
| Cache older than this triggers a live pull. |
|
| Minimum seconds between live pulls. |
|
| Backoff after an HTTP 429. |
|
| Claude Code's config dir (respected if you've moved it). |
|
| OAuth credentials file. |
|
| macOS Keychain item name. |
|
| Cache / throttle-state files. |
🩺 Troubleshooting
Symptom | Fix |
| Run |
| Your token expired. Use Claude Code normally for a moment; it refreshes itself. |
| Expected. Wait ~3 minutes for fresh numbers. |
| Backed off for 15 min automatically. Nothing to do. |
Tool not showing up in Claude |
|
|
|
⚠️ Disclaimer
This is an unofficial community tool, not affiliated with Anthropic. It relies on an undocumented endpoint that Claude Code itself uses, which may change without notice.
📄 License
MIT © Dmytro Chygarov
This server cannot be deployed
Maintenance
Related MCP Connectors
WHOOP recovery, strain, sleep and workouts in Claude via official WHOOP OAuth. Free, open source.
OpenAI organization usage and cost reporting through an admin API key connected by the user.
Garmin data in Claude & ChatGPT via the Garmin Health API. OAuth sign-in, no password sharing.
Discover Frontier inference capabilities and read sanitized usage through read-only tools.
Related MCP Servers
- AlicenseAqualityNot gradedmaintenanceProvides real-time visibility into Claude Pro and Max subscription usage limits directly within Claude Code by utilizing local OAuth tokens. It enables users to monitor session and weekly usage across different models and receive alerts regarding rate-limiting status.4-
- FlicenseAqualityBmaintenanceReports your Claude subscription usage (5-hour and weekly limits) with a forecast and velocity recommendation, using Claude Code's existing OAuth session without requiring an API key.24-
- AlicenseNot gradedqualityAmaintenanceProvides Claude plan usage data (session and weekly percentages) as an MCP tool by reading through a logged-in browser, enabling Claude to check its own remaining usage.MIT
- AlicenseAqualityCmaintenanceEnables retrieving real Claude subscription usage statistics, including the 5-hour session window, weekly limit, and per-model limits, from the same endpoint Claude Code uses.17 npmMIT