loading…
Search for a command to run...
loading…
Fetches and tracks Claude.ai usage data including session and weekly limits with automated daily logging and persistent session management. It allows users to m
Fetches 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.
An MCP (Model Context Protocol) server that fetches your Claude usage data from the claude.ai dashboard, with automated daily tracking.
# Clone the repo
git clone https://github.com/mvacaporale/claude-usage-mcp.git
cd claude-usage-mcp
# Install dependencies
uv sync
# Install Playwright browsers
uv run playwright install chromium
Add to your Claude Code MCP settings (~/.claude/settings.json):
{
"mcpServers": {
"claude-usage": {
"command": "uv",
"args": ["run", "--directory", "/path/to/claude-usage-mcp", "python", "server.py"]
}
}
}
claude_login toolThere are multiple ways to fetch your usage:
Simply ask Claude to check your usage, or use the get_claude_usage tool directly.
launchctl start com.claude.usage-fetcher
cd /path/to/claude-usage-mcp
.venv/bin/python fetch_usage.py
A launchd job automatically fetches usage:
Multiple runs in a day update the same record - you'll always have exactly one entry per day.
# Copy the plist to LaunchAgents (if not already there)
cp com.claude.usage-fetcher.plist ~/Library/LaunchAgents/
# Load the job
launchctl load ~/Library/LaunchAgents/com.claude.usage-fetcher.plist
# Check if job is loaded
launchctl list | grep claude
# Trigger manually
launchctl start com.claude.usage-fetcher
# Disable
launchctl unload ~/Library/LaunchAgents/com.claude.usage-fetcher.plist
# Re-enable
launchctl load ~/Library/LaunchAgents/com.claude.usage-fetcher.plist
# View logs
tail -f usage-fetcher.log
| Tool | Description |
|---|---|
get_claude_usage |
Fetch usage data from the Claude dashboard |
claude_login |
Open browser window for authentication |
check_claude_auth |
Check if current session is authenticated |
Usage history is stored in usage-history.json:
[
{
"success": true,
"timestamp": "2026-01-25T23:00:00.000000",
"session_percent": 19,
"session_resets_in": "2 hr 15 min",
"weekly_all_models_percent": 10,
"weekly_resets": "Thu 10:00 AM",
"weekly_sonnet_percent": 0
}
]
browser-data/ directoryCloudflare blocking: Run claude_login to re-authenticate manually.
Browser data locked: If you see lock errors, restart Claude Code (/mcp to reconnect).
Stale session: Delete browser-data/ and browser-data-scheduled/ directories, then run claude_login again.
Добавь это в claude_desktop_config.json и перезапусти Claude Desktop.
{
"mcpServers": {
"claude-usage-mcp-server": {
"command": "npx",
"args": []
}
}
}