claude-usage
Click on "Install 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., "@claude-usageHow much of my Claude plan have I used this week?"
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.
claude-usage
Read your Claude plan usage from the command line, or as an MCP tool.
These are the numbers behind claude.ai's "Current session" and "Weekly" meters. Anthropic publishes no API for them, so this reads them through a browser you are logged into. See How it works.
$ ./usage
{
"status": "ok",
"session_pct": 14.0,
"session_resets_at": "2026-08-07T18:00:00Z",
"weekly_pct": 38.0,
"weekly_resets_at": "2026-08-08T07:00:00Z",
"blocking": [],
"credits_enabled": false,
"credits_spent": 0.0,
"credits_limit": null,
"source": "browser"
}Features
CLI printing JSON, exit 0 on success and 1 on failure
MCP tool, so Claude can check its own remaining usage
Works on Windows, macOS and Linux
Docker optional — needed only on machines without a screen
No API key, no cookie extraction, no browser download
Related MCP server: claudeusage-mcp
Requirements
Python 3.9+
A browser (Chrome, Chromium or Edge), or Docker on a headless machine
A machine that stays on, since the browser has to keep running
One manual login, repeated roughly monthly when the session expires
Install
git clone https://github.com/AlbeeDev/claude-usage.git
cd claude-usageThen follow A if the machine has a screen, or B if it does not.
A. Machine with a screen
python3 -m venv .venv
.venv/bin/pip install -r requirements.txt
./usageWindows:
py -3 -m venv .venv
.venv\Scripts\pip install -r requirements.txt
usageThe first run finds a browser and starts one:
$ ./usage
No browser is running. Starting one...
Started /usr/bin/google-chrome
Log into claude.ai in the window that opened, leave it running,
then run this again.Log in, leave the window open, run ./usage again.
B. Headless machine (Docker)
The container provides the screen you log in through.
docker compose up -dThen forward the port from your own machine and open http://localhost:3000:
ssh -L 3000:localhost:3000 you@your-serverLog into claude.ai there. Back on the server:
python3 -m venv .venv
.venv/bin/pip install -r requirements.txt
./usageThe Chromium image is about 4.6 GB. Check you have the disk.
Anything that can reach port 9222 controls a browser signed into your Claude account — it can read your conversations, act as you on any site that browser is logged into, and take its cookies. There is no authentication on that port; that is how the debug protocol works. All ports bind to
127.0.0.1for this reason. Do not republish them on0.0.0.0, and treat any machine where you do not trust every local user as unsuitable.
Put it on PATH
To call it from anywhere, or from another program:
./usage --add-to-path$ cd /anywhere && claude-usage
{"status": "ok", "session_pct": 15.0, ...}It links into a directory already on your PATH — /usr/local/bin as root,
~/.local/bin otherwise — and prints where it went. On Windows it writes a
small .bat shim instead, since symlinks there need admin rights.
It is a link, not a copy, so updating the repo updates the command, and the venv and browser profile are still found. To remove it, delete the file it names. It will not overwrite a file it did not create.
Usage
./usage # print usage as JSON
./usage --login # open claude.ai in the running browser, to sign in again
./usage --register-mcp # register the MCP server with Claude Code
./usage --add-to-path # install as claude-usage, runnable from anywhereOn Windows, usage instead of ./usage.
MCP
./usage --register-mcpRegisters the server for all projects and prints what it wrote. Start a new
Claude session to pick it up. Claude then gets a claude_usage tool returning
status, session_pct and resets_at.
To register by hand, point command at the Python inside .venv — an MCP
client runs a command, it does not activate anything:
{
"mcpServers": {
"claude-usage": {
"type": "stdio",
"command": "/path/to/claude-usage/.venv/bin/python",
"args": ["/path/to/claude-usage/mcp_server.py"]
}
}
}On Windows the interpreter is .venv\Scripts\python.exe.
The tool reads the browser but never starts one. If none is running it returns
browser_unavailable; start it with ./usage.
Output
Field | Meaning |
|
|
| Percent of the 5-hour window used |
| When that window rolls over |
| Percent of the weekly limit used |
| When the week rolls over |
| Active critical limits, which may name a specific model |
| Whether extra usage credits are on |
| Credit spend, if enabled |
| Always |
blocking can name a model that is exhausted while both percentages still look
healthy.
Failure statuses
All exit 1, with the reason in status and detail in detail.
Status | Meaning | Fix |
| The login expired |
|
| No browser reachable |
|
| Cloudflare did not clear | Usually temporary; retry |
| Endpoint changed, or another error | Read |
A response the digest does not recognise is reported as request_failed, never
as ok with null percentages — a null renders as 0%, which reads as plenty of
headroom and is the opposite of the truth. Treat every reading as best-effort
and show "usage unavailable" rather than zero.
Configuration
Variable | Default | Purpose |
|
| Where the browser is |
USAGE_CDP_URL=http://other-host:9222 ./usageBehaviour
Results are cached for 60 seconds; polling is cheap.
Concurrent callers are serialised with a file lock on macOS and Linux. Windows has no such lock, so the cache is the only guard there.
One claude.ai tab is opened on first use and reused after, so nothing opens, navigates or takes focus while you work.
On Windows the browser starts minimised once a profile exists. The first run stays visible, because that is the run you log in on.
The browser uses its own profile directory, not your everyday one. A browser with debugging enabled can be driven by anything else on the machine.
Closing the browser does not lose the login — it is on disk.
./usagestarts it again.
How it works
Anthropic publishes no API for plan usage. The only source is the endpoint claude.ai's own settings page calls, which needs your session — and Cloudflare rejects any client that is not a real browser.
Cookies alone are not enough, which is worth knowing before trying the obvious shortcut:
An HTTP client with valid cookies gets
403andcf-mitigated: challenge.A freshly minted
__cf_bmdoes not change that.Neither does replaying a complete browser header set.
Chrome's new headless mode is challenged too, while the same browser visible is not.
What is fingerprinted is the client itself. So a browser you are logged into
stays running, and usage.py connects to it and runs the fetch from inside a
claude.ai tab — the same request the settings page makes. No cookie is copied
out and no browser is launched behind your back.
This reads your own account through your own session. No API key, no token, nothing sanctioned, and therefore best-effort. Do not build anything critical on it.
Tests
./test_usage.py # or: pytestCovers the digest and the debugger address. No browser or network needed.
License
MIT — see LICENSE.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- FlicenseAqualityDmaintenanceFetches and tracks Claude.ai usage data including session and weekly limits with automated daily logging and persistent session management. It allows users to monitor their usage history directly through Claude Code integrated tools.3
- AlicenseAquality-maintenanceProvides 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
- Flicense-qualityBmaintenanceEnables Claude Code to control a real browser using AI for web scraping, competitive intelligence, and UX auditing through the MCP protocol.
- FlicenseAqualityCmaintenanceReports 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.23
Related MCP Connectors
Browser MCP for logged-in tasks. Uses your Chrome — credentials stay local. Zero-token replay.
A paid remote MCP for AI agent browser DevTools MCP, built to return verdicts, receipts, usage logs,
A paid remote MCP for AI agent browser MCP session, built to return verdicts, receipts, usage logs,
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/AlbeeDev/claude-usage'
If you have feedback or need assistance with the MCP directory API, please join our Discord server