anthropic-billing — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited anthropic-billing (MCP Server) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
An MCP (Model Context Protocol) server for retrieving Anthropic billing and cost report data.
claude mcp add (Recommended)# Add the MCP server from GitHub
claude mcp add anthropic-billing https://github.com/your-username/anthropic-billing-mcp
# Set your API key
claude mcp env anthropic-billing ANTHROPIC_API_KEY=your_api_key_heregit clone https://github.com/your-username/anthropic-billing-mcp
cd anthropic-billing-mcp
npm install
npm run buildclaude mcp add, set the environment variable: claude mcp env anthropic-billing ANTHROPIC_API_KEY=your_api_key_here export ANTHROPIC_API_KEY=your_api_key_hereclaude mcp addAfter installation, the server will be automatically configured and available in Claude Desktop.
Add to your MCP configuration (e.g., in Claude Desktop config):
{
"mcpServers": {
"anthropic-billing": {
"command": "node",
"args": ["/path/to/anthropic-billing-mcp/dist/index.js"],
"env": {
"ANTHROPIC_API_KEY": "your_api_key_here"
}
}
}
}#### get_cost_report
Retrieve raw cost report data from Anthropic's API.
Parameters:
starting_at (required): RFC 3339 timestamp for start of time rangeending_at (optional): RFC 3339 timestamp for end of time rangebucket_width (optional): Time granularity ("1d" only)group_by (optional): Array of grouping options ["workspace_id", "description"]limit (optional): Maximum number of time buckets to returnpage (optional): Page token for paginationbeta_headers (optional): Array of beta feature headersExample:
{
"starting_at": "2024-01-01T00:00:00Z",
"ending_at": "2024-01-31T23:59:59Z",
"group_by": ["description"],
"beta_headers": ["fast-mode-2026-02-01"]
}#### get_daily_costs_summary
Get a formatted summary of daily costs with USD conversion.
Parameters:
start_date (required): Start date in YYYY-MM-DD formatend_date (optional): End date in YYYY-MM-DD format (defaults to today)group_by_workspace (optional): Whether to group by workspace (default: false)group_by_description (optional): Whether to group by description (default: false)beta_headers (optional): Array of beta feature headersExample:
{
"start_date": "2024-01-01",
"end_date": "2024-01-31",
"group_by_description": true
}This MCP server enables powerful budget management and cost analysis workflows. Here's a real-world example of using it to create a comprehensive burn down analysis.
A trader made $1,000 profit in March 2026 and wanted to track their Anthropic API costs against this budget to ensure profitable AI-assisted trading decisions.
#### Live Cost Analysis (March 7, 2026)
Using the MCP server's get_cost_report tool, we retrieved actual spending data:
📊 Executive Summary
- Trading Profit This Month: $1,000.00
- Current API Costs: $91.05
- Remaining Budget: $908.95
- Days Elapsed: 7 of 31 (22.6%)
- Budget Utilization: 9.1%
📈 Key Performance Metrics
- Daily Average Cost: $13.01 ($91.05 ÷ 7 days)
- Projected Monthly Cost: $403.31 (at current rate)
- Target Daily Budget: $32.26 (1000 ÷ 31 days)
- API ROI: 1,098% ($1000 profit vs $91.05 cost)#### Budget Burn Rate Visualization
Week 1 [███████████████████████████▓▓▓▓▓] $91.05 (28% of weekly target)
Week 2 [█████████████████████████████████] $91.05 (projected)
Week 3 [█████████████████████████████████] $91.05 (projected)
Week 4 [█████████████████████████████████] $91.05 (projected)
Week 5 [█████████████▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] $39.11 (projected)#### Risk Assessment & Strategic Insights
🟢 Current Status: LOW-MODERATE Risk
#### 1. Real-Time Budget Monitoring
# Get current month costs instantly
get_daily_costs_summary start_date=2026-03-01#### 2. Automated Burn Rate Calculations The MCP server enables programmatic cost analysis without manual API calls:
#### 3. Multi-Scenario Planning
# Scenario 1: Current pace → $403.31 monthly (40.3% of budget)
# Scenario 2: 25% increase → $504.14 monthly (50.4% of budget)
# Scenario 3: 50% increase → $604.97 monthly (60.5% of budget)#### 4. Integration with Business Logic The MCP server allows seamless integration with:
# Pseudo-code showing typical workflow
def optimize_trading_strategy():
# Get real-time costs via MCP
current_costs = get_daily_costs_summary()
daily_avg = current_costs.total / days_elapsed
# Calculate remaining budget runway
remaining_budget = trading_profit - current_costs.total
safe_daily_spend = remaining_budget / days_remaining
# Adjust API usage based on cost efficiency
if daily_avg < safe_daily_spend * 0.8:
return "SCALE_UP" # Opportunity to use more AI
elif daily_avg > safe_daily_spend * 1.2:
return "SCALE_DOWN" # Risk of budget overrun
else:
return "MAINTAIN" # Optimal paceThis real-world example demonstrates how the MCP server transforms basic billing data into actionable business intelligence, enabling data-driven decisions about AI investment and usage optimization.
📋 Full Analysis Available: See examples/trading-budget-burndown.md for the complete burn down analysis with weekly projections, risk assessments, and KPI tracking.
Each cost item includes:
amount: Cost in cents as decimal stringcurrency: Currency code (always "USD")description: Description of the cost itemmodel: Model name usedcost_type: Type of cost ("tokens", "web_search", "code_execution")token_type: Token type for token costsservice_tier: Service tier ("standard", "batch")context_window: Input context window usedworkspace_id: Associated workspace IDinference_geo: Inference geography usedspeed: Speed tier (with beta header){
"summary": [
{
"date": "2024-01-01",
"total_cost_cents": 1234,
"total_cost_usd": "12.34",
"items": [...]
}
],
"total_cost_cents": 50000,
"total_cost_usd": "500.00",
"period": {
"start": "2024-01-01",
"end": "2024-01-31"
},
"has_more": false,
"next_page": null
}npm run buildnpm run devnpm testANTHROPIC_API_KEY: Your Anthropic Admin API key from platform.claude.com/settings/admin-keys (required)The server includes comprehensive error handling for:
All errors are returned with descriptive messages to help with debugging.
MIT
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.