consumpai-mcp
v0.1.0
Published
ConsumpAI MCP server — let AI agents query their own AI spend, benchmarks and optimizations
Maintainers
Readme
@consumpai/mcp-server
Let any MCP-capable agent (Claude Code, Cursor, Windsurf, …) query its own AI spend — and act on it. This is Moat Layer 4 of ConsumpAI: the integration ecosystem.
Install & configure
export CONSUMPAI_API_KEY=ck_live_...
export CONSUMPAI_BASE_URL=https://app.consumpai.com # optionalRegister the server with Claude Code / Cursor:
{
"mcpServers": {
"consumpai": {
"command": "npx",
"args": ["-y", "@consumpai/mcp-server"],
"env": { "CONSUMPAI_API_KEY": "ck_live_..." }
}
}
}Tools
| Tool | Description |
|:---|:---|
| get_usage | Aggregated cost, tokens, forecast and anomalies for 7d/30d/90d. |
| list_projects | Every tracked project ranked by spend, with ids. |
| get_benchmark | Anonymous industry percentile, rank and peer recommendations. |
| get_learning_recommendations | Optimizations proven on profile-similar projects. |
| run_optimization | Run the engine, persist opportunities, return ranked savings. |
Design notes
- Zero dependencies — JSON-RPC 2.0 over newline-delimited stdio using only the Node.js standard library, so the package is tiny and auditable.
- Least privilege — only the API key you provide is used;
run_optimizationrequireswritescope. - Fail-safe — transport/parse errors return JSON-RPC errors; tool failures return
isError: truewithout crashing the server.
Development
npm install
npm run build # bundle to dist/
npm run check:types # tsc --noEmit