Skip to main content

Prerequisites

  • A CostHawk account (join the waitlist if you don’t have one)
  • Claude Code or Claude Desktop installed

Step 1: Get Your Access Token

  1. Log into your CostHawk dashboard
  2. Navigate to Settings → Developer
  3. Click Create Token
  4. Copy the token (you’ll only see it once)
Keep your access token secret. Never commit it to version control or share it publicly.

Step 2: Add to Claude Code

The fastest way to get started is with the one-liner command:
claude mcp add -s user -e COSTHAWK_API_KEY=YOUR_TOKEN_HERE costhawk -- npx -y costhawk
Replace YOUR_TOKEN_HERE with your access token from Step 1.

Step 3: Restart Claude Code

After adding the MCP server, restart Claude Code to load the new tools.

Step 4: Start Using CostHawk

You can now ask Claude about your API costs:
  • “What’s my AI API usage this month?”
  • “Show me costs broken down by provider”
  • “How many tokens have I used today?”
  • “Am I saving money with Claude Max?”
  • “Show my savings vs retail pricing”
  • “Break down my savings by model”
  • “Are there any cost anomalies I should know about?”
  • “List my unread alerts”
  • “Create a Slack webhook for budget alerts”

Alternative: Manual Configuration

If you prefer to configure manually, add this to your MCP config file:
Edit ~/.claude/.mcp.json:
{
  "mcpServers": {
    "costhawk": {
      "command": "npx",
      "args": ["-y", "costhawk"],
      "env": {
        "COSTHAWK_API_KEY": "YOUR_TOKEN_HERE"
      }
    }
  }
}

Next Steps