open-index/open-npm huggingface dataset:
npm package: @stackspend/mcp-server
Description: MCP server for StackSpend — query cloud and AI costs in Claude Code
Latest version: 0.1.0

# @stackspend/mcp-server

MCP (Model Context Protocol) server for StackSpend. Exposes cloud and AI cost data to Claude Code, Claude Desktop, and other MCP clients.

## Install

```bash
npx -y @stackspend/mcp-server
```

Or add to your MCP config—no global install required; npx runs it on demand.

## Requirements

- **STACKSPEND_API_KEY** (required) — Create at StackSpend Dashboard → Settings → API Keys
- **STACKSPEND_API_BASE_URL** (optional) — Default: `https://stackspend-api.up.railway.app`
- Node.js 18+
- StackSpend Business plan (API access)

## Claude Code setup

1. Create an API key in StackSpend (scopes: `line_items:read`, `rollups:read`, `anomalies:read`)
2. Add to your MCP config:

```json
{
  "mcpServers": {
    "stackspend": {
      "command": "npx",
      "args": ["-y", "@stackspend/mcp-server"],
      "env": {
        "STACKSPEND_API_KEY": "sk_your_key_here"
      }
    }
  }
}
```

3. Restart Claude Code and ask: "What were my cloud costs last week?"

## Tools

| Tool | Description |
|------|-------------|
| `get_line_items` | Cost line items by date range. Filter by provider, service, or category. |
| `get_daily_rollups` | Pre-aggregated daily costs grouped by provider, service, or category. |
| `get_anomalies` | Anomaly alerts for unexpected cost spikes. |

## Full guide

[StackSpend Claude Code MCP guide](https://www.stackspend.app/resources/guides/claude-code-mcp) — detailed setup, troubleshooting, and example prompts.

## License

Proprietary. Use with StackSpend account.