Claude Code Cost Analysis

Use StackSpend cost data in Claude Code via MCP. Query line items, daily rollups, and anomaly alerts in natural language. Ask "What were my cloud costs last week?"

StackSpend provides an MCP (Model Context Protocol) server for Claude Code. Connect with an API key, and Claude can fetch line items, daily rollups, and anomaly alerts. Ask questions like "What were my cloud costs last week?" or "Show anomalies from the past 7 days."

The problem

Cost data is in dashboards and APIs. You have to log in or run curl to get answers. Natural language queries would be faster.

Developers and analysts need quick cost insights without switching contexts. "How much did we spend on OpenAI this month?" should be one question.

Integrating cost data into workflows requires custom scripting. No out-of-the-box way to ask an AI assistant.

The solution

StackSpend MCP server exposes get_line_items, get_daily_rollups, and get_anomalies as MCP tools. Claude Code can call them when you ask cost questions.

Add MCP config with your API key. Restart Claude Code. Ask in natural language—Claude uses the tools and returns formatted answers.

Same API key you use for REST. Scoped to line_items:read, rollups:read, anomalies:read. No additional setup beyond MCP config.

What we track

  • npm package @stackspend/mcp-server
  • MCP tools (line items, daily rollups, anomalies)
  • Natural language cost queries
  • Same API as REST
  • Claude Code and MCP-compatible clients

Get visibility into your cloud and AI spend

Connect in 5 minutes. See 90 days of history. Know where you stand today.

Start free trial

14-day free trial. No credit card required.