Claude Cost Analysis

Ask cost questions in Claude. Get real answers without switching tabs.

StackSpend provides an MCP server for Claude Code. Connect with your API key and Claude can fetch line items, daily rollups, and anomaly data directly. Ask questions like "What were my cloud costs last week?" or "Show anomalies from the past 7 days" and get structured answers without leaving your coding workflow.

Read-only access·14-day free trial·No credit card required
See it in action

See spend against budget, every day.

The same burn-up view your dashboard shows: cumulative spend against budget, with a forecast tail so you know where the month ends before it does.

The workflow

How it works in practice

1

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.

2

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

3

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

Real scenarios

When this use case fires

Answering "why did cloud spend go up last week?" requires switching tabs and manually filtering

A developer wants cost context while debugging a slow API but has to open a separate dashboard

Cost review slips because nobody wants to context-switch out of the coding workflow

Finance asks for a spend breakdown and the developer has to export CSVs from multiple dashboards

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.

Technical detail

How StackSpend does this

Dashboard tabs and CSV exports is built for different jobs. Here is what StackSpend adds.

Dashboard tabs and CSV exports

  • Context switching to a cost dashboard interrupts the development workflow
  • No natural language interface — every cost question requires manual navigation
  • CSV exports for analysis are manual and require separate tooling
  • Cost data is not available in the IDE where spending decisions are made

StackSpend

  • Ask cost questions in natural language while staying in the Claude Code workflow
  • Claude fetches real cost data via MCP tools — no context switching required
  • Works with your existing StackSpend API key and read-only permissions
  • Line items, rollups, and anomalies available as structured data on demand

What we track

npm package @stackspend/mcp-serverMCP tools (line items, daily rollups, anomalies)Natural language cost queriesSame API as RESTClaude Code and MCP-compatible clients
ICP

Who uses this

Developers who want cost answers inside Claude Code instead of another dashboard tab.

Teams that already use StackSpend data and want natural-language investigation in their coding workflow.

Buyers evaluating whether MCP access is a faster path than building custom internal cost tooling.

Questions

Frequently asked

How do I analyze cloud and AI costs from inside Claude Code?
StackSpend provides an MCP server for Claude Code. Add the MCP config with your StackSpend API key, restart Claude Code, and ask cost questions in plain English — Claude calls the server's tools and returns structured answers without leaving your coding workflow. It exposes get_line_items, get_daily_rollups, and get_anomalies, so "what were our cloud costs last week?" becomes one question instead of a dashboard login.
What is the StackSpend MCP server for Claude Code?
The StackSpend MCP server is an npm package, @stackspend/mcp-server, that exposes your cost data to Claude Code and other MCP-compatible clients as callable tools: get_line_items, get_daily_rollups, and get_anomalies. It lets Claude fetch real, cited cost figures in response to natural-language questions, turning cost analysis into a conversation in the IDE rather than a manual dashboard or curl workflow.
What can I ask the StackSpend MCP server in Claude Code?
You can ask natural-language cost questions like "how much did we spend on OpenAI this month?", "show anomalies from the past 7 days", or "break down last week's cloud costs." Claude maps these to get_line_items, get_daily_rollups, and get_anomalies, then returns formatted, structured answers — so developers and analysts get quick cost insight without context-switching out of Claude Code.
Is the StackSpend MCP server read-only and secure?
Yes. The MCP server uses the same API key as the StackSpend REST API, scoped read-only to line_items:read, rollups:read, and anomalies:read, so Claude can fetch cost data but never write to it or to your provider accounts. There is no setup beyond adding the MCP config with your key, and access is limited to reading the same cost data you already see in StackSpend.

Set it up in 5 minutes. Know by tonight.

Connect your providers with read-only access. Claude Cost Analysis starts from day one — no manual setup, no threshold tuning required.

14-day free trial · No credit card required · Read-only access
Claude Cost Analysis With MCP — StackSpend