scan_ai_spend
Discover provider and configuration signals inside one caller-supplied absolute path and persist local discovery state.
Documentation
Published · npm latest v0.9.7
Gemini CLI · experimental, fixture-verified, financial-only
aibill documentation
The aibill MCP server exposes the same evidence contract as structured, explicit tools. It is local stdio—not an always-on prompt, proxy, or cloud service.
Updated August 27, 2026
01 · Install
codex mcp add aibill -- npx --yes --package @agent-finops/mcp@latest ai-spend-mcp
codex mcp listclaude mcp add --scope user aibill -- npx --yes --package @agent-finops/mcp@latest ai-spend-mcp
claude mcp list{
"mcpServers": {
"aibill": {
"command": "npx",
"args": ["--yes", "--package", "@agent-finops/mcp@latest", "ai-spend-mcp"]
}
}
}Use ~/.cursor/mcp.json for all Cursor projects or .cursor/mcp.json for one project. Other clients use the same command and arguments at their documented local stdio configuration path.
02 · Tools
Discover provider and configuration signals inside one caller-supplied absolute path and persist local discovery state.
Read supported local coding-agent financial metadata and persist a local report.
Read provider billing or usage through an env-reference credential.
Return the read-only Claude Code/Codex Glance contract.
Return canonical hook-aware Context Health.
Read-only: revalidate the bounded local token-reduction experiment and return its matched-session, quality-gated result from the canonical core evaluator.
Read-only: validate drafted plan sentences and compose the one paste-safe improve --draft command. It writes nothing and authorizes nothing.
Show approved sources and separate status axes.
Return the current local, provider, or explicitly labeled sample report.
Legacy compatibility name for evidence-constrained candidate inspection.
Each scan/sync tool may write local aibill state; sync_provider_spend also contacts the selected provider API. The get, list, draft, and recommendation tools are read-only, and no MCP tool can approve, start, apply, or record anything — approval exists only as the word APPROVE typed by the human in their own terminal. recommend_cuts can return an evidence gap or observed exposure instead of a cut; the name remains for compatibility.
03 · Recommended flow
Use aibill to sync my local coding-agent evidence for this project.
Then show the spend report, source status, Context Health, and one
evidence-constrained next action. Keep billed cost, API-equivalent value,
subscription context, and missing evidence separate.sync_local_agent_spend with a specific absolute project path.get_spend_report and list_sources.get_context_health or get_usage_glance only when that decision surface helps.draft_improve_command, then run the composed npx aibill improve --draft … yourself — approval and the quality-gated result stay in your terminal.With no synced state, get_spend_report returns no_state, zero rows, a null financial headline, and exact next steps. Sample rows appear only after an explicit scan_ai_spend(sample=true) request.
04 · Safety
env:NAME reference.05 · Troubleshooting