scan_ai_spend
Discover provider and configuration signals inside one caller-supplied absolute path and persist local discovery state.
The local aibill MCP server lets a compatible AI client inspect evidence on your machine over stdio. It needs no Workspace account. Hosted Workspace MCP has its own setup and access requirements.
Updated October 3, 2026
01 · Install
For hosted team reports, use the Workspace MCP guide. The tools on this page read or sync local aibill state and do not grant Workspace access.
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 local MCP tool can approve or start an improvement test, apply a change, or record human approval — 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