my_claude_usage

JongSeok-327/my_claude_usage

3.2

If you are the rightful owner of my_claude_usage and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

The Claude Usage Analyzer MCP Server is designed to analyze token usage and costs for Claude Code, providing insights through a conversational interface.

Tools
4
Resources
0
Prompts
0

Claude Usage Analyzer MCP Server 📊

MCP server for analyzing Claude Code token usage and costs. Built on top of ccusage to provide a conversational interface for usage analytics.

Features

  • Daily Usage Analysis: View token usage and costs by date
  • Monthly Aggregation: Monthly statistics with averages
  • Session-based Usage: Usage by conversation session
  • Billing Blocks Analysis: 5-hour billing window analysis

Prerequisites

  • Python 3.8+
  • Node.js (for npx and ccusage)
  • Claude Code installed with usage history

Installation

Install ccusage globally:

npm install -g ccusage

Deployment

This server is designed to run on FastMCP Cloud with HTTP transport (streamable).

Dependencies are automatically installed from requirements.txt when deployed.

Usage

Ask Claude in natural language:

Daily Usage

Show me today's token usage
Show me September usage
Daily usage from 20250901 to 20250930

Parameters:

  • since: Start date (YYYYMMDD format)
  • until: End date (YYYYMMDD format)
  • project: Filter by project name (optional)

Monthly Usage

Show this month's stats
Monthly usage for 2025

Parameters:

  • since: Start date (YYYYMMDD format)
  • until: End date (YYYYMMDD format)

Session Usage

Show usage by session

Parameters:

  • since: Start date
  • until: End date
  • project: Project filter

Billing Blocks

Show usage by billing blocks

Parameters:

  • since: Start date
  • until: End date

Output Example

Daily Usage Report

## 📈 Daily Usage Report

**Period:** 20250901 → 20250930

### 💰 Summary
- **Total Days:** 30
- **Total Cost:** $45.67
- **Total Tokens:** 1,234,567
- **Average Daily Cost:** $1.52
- **Average Daily Tokens:** 41,152

### 📊 Daily Details

| Date | Input | Output | Cache Read | Total | Cost |
| --- | --- | --- | --- | --- | --- |
| 20250901 | 25,000 | 8,500 | 12,000 | 45,500 | $1.23 |
| 20250902 | 30,000 | 10,200 | 15,000 | 55,200 | $1.48 |
...

Available Tools

ToolDescriptionParameters
get_daily_usageDaily token usage and costssince, until, project
get_monthly_usageMonthly aggregated reportsince, until
get_session_usageSession-based usagesince, until, project
get_blocks_usage5-hour billing blocks analysissince, until

Date Format

All dates use YYYYMMDD format:

  • 20250901 (September 1, 2025)
  • 2025-09-01
  • 09/01/2025

Troubleshooting

MCP Server Not Connecting

  1. Verify Python virtual environment path
  2. Verify my_usage_server.py file path
  3. Completely restart Claude Desktop
  4. Check Claude Desktop logs (~/Library/Logs/Claude/)

ccusage Command Errors

# Check Node.js installation
node --version

# Test ccusage execution
npx ccusage daily

No Data Available

  • Ensure you have Claude Code usage history
  • Check date range
  • Try removing project filter

License

MIT License

Dependencies

This project uses ccusage (MIT License) for retrieving Claude Code usage data.

Contributing

Issues and PRs are always welcome!