agent-cost-lens-mcp
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@agent-cost-lens-mcpPreview my upload metadata before sending to server."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
name: agent-cost-lens-mcp description: See where your agent token money goes — and the caching fixes that recover it. Local sweep, local scrub, metadata-only upload — audit it yourself with preview_upload before anything is sent. capabilities: [cost-analysis, cache-waste-detection, caching-advice, spend-reporting]
Agent Cost Lens — MCP client
Two tools:
preview_upload — shows exactly what would be sent (scrubbed usage metadata: token counts, model IDs, dates, pseudonymous tags). Sends nothing. Works with zero configuration.
analyze_costs — sends that metadata to your Agent Cost Lens server and returns your spend, cache-hit rate, and what proper caching recovers (figures are simulated upper bounds, labeled as such).
Related MCP server: Azure FinOps MCP Server
It names the fix
On API-log runs the report goes past measurement: a pattern catalog names your
specific cache-waste — uncached history (missing cache_control on a stable
prefix), cache churn (write premium with little read-back), volatile prefixes
(something early in the prompt changing per request). Where the arithmetic
supports a figure, it prices what fixing that pattern recovers, computed from
your own usage and labeled (simulated); where it does not — two of the four
patterns carry no dollar figure, volatile prefixes and one-shot workloads — the
report says so in as many words rather than inventing one. When a workload has
nothing left to recover, no pattern fires and the report names none — it shows
you the measurement and stops, instead of manufacturing a fix. The one case it
calls out by name is the one-shot workload: "caching can't help one-shot
workloads." An empty catalog is a first-class result, not a failure state.
Export to a file (no server, no upload)
When you want the same scrubbed records on disk — for a script of your own to read — ask for them explicitly:
python3 -m acl_mcp.export --out records.jsonl [--since YYYY-MM-DD] [--until YYYY-MM-DD] [--project FOLDER]One apilog-v1 record per line, built by the same code and the same salt as an
upload, so exported and uploaded rows carry the same pseudonyms. --project
narrows the sweep to one folder under ~/.claude/projects/. The export path
imports nothing that can reach a network.
What it puts on your disk, all of it. Two files, not one:
the file you name — the only output, and replaced atomically. While the write is in flight a transient
<out>.<rand>.partsits beside it; that gets renamed over your file and is gone before the command returns.~/.config/agent-cost-lens/salt— 32 random bytes, created on the first run of a machine that has none, and only then; after that it is read, never rewritten. The salt is a file rather than a fresh random per run because that is what keeps a pseudonym stable: the same repo hashes to the same tag on your next run and on the upload path, which is the only reason an exported row and an uploaded row can be matched up. It stays on your machine.
Nothing else is written — no record store, no cache, no log.
Privacy
Prompt text and code never leave your machine — the wire format has no field
for them. Repo and session names are HMAC-pseudonymized with a salt that
never leaves ~/.config/agent-cost-lens/salt. Run preview_upload and read
the payload yourself; that output is the whole story.
Setup
{
"mcpServers": {
"agent-cost-lens": {
"command": "acl-mcp",
"env": {
"LENS_SERVER_URL": "https://your-analyzer.example",
"LENS_API_KEY": "acl_..."
}
}
}
}Install
The client is served from the site, not from PyPI — the name
agent-cost-lens-mcp is not registered on PyPI, so a bare
pip install agent-cost-lens-mcp will fail with "No matching distribution
found". Install from the download endpoint:
pip install "agent-cost-lens-mcp @ https://lens.r-lattice.com/download"That endpoint always serves the current client — 1.5.2 as of this review.
It is not pinned, so it will hand you whatever is current at the time you run
it; check pyproject.toml in this repo to see which client version this
snapshot documents. uvx --from <dir> acl-mcp works against a local checkout.
If you installed client 1.5.0, reinstall. 1.5.0 could not start: it
declared mcp>=1.0 with no upper bound, and mcp 2.x renamed the class
acl_mcp/server.py imports, so the install succeeded and acl-mcp then died
with ModuleNotFoundError. The dependency now reads mcp>=1.2,<2 — both
edges load-bearing, because mcp 1.0.0 through 1.1.3 carry no mcp.server.fastmcp
module either. Confirm what you have with:
pip show agent-cost-lens-mcpGet an API key from the operator. preview_upload needs neither a key nor a
server.
Reviewed 26 August 2026 against client 1.5.2. Every claim on this page was
checked against the code in this snapshot, not against an earlier release, and
the two disclosure claims — that preview_upload "shows exactly what would be
sent" and that "that output is the whole story" — were checked by executing it,
at limit=0 as well as at a normal limit.
Said precisely, because this is the one page where precision is the product:
the preview's field line names every leaf path in the records, which is what
_record_fields is computed over. Three payload-level paths sit outside that
line by construction and are disclosed by two other lines instead — schema in
the header, and plan.name / plan.monthly_cost in the "Plan sent as billing
context" line, which print their values rather than their dotted paths.
Measured on a payload exercising every branch of to_record: 16 leaf paths
travel with a plan configured — 13 named by the field line, 3 by the header and
plan lines — and 14 without one, the same 13 plus schema. Nothing travels
unnamed in either case. What is still open is the class, not an instance: a
brand-new top-level payload key would travel unshown, because the field line
cannot see that level. See CHANGELOG.md under 1.8.6.
The 1.5.0 client did not meet the disclosure bar at all; see
releases/v1.8.5.md.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Track, analyze, and act on your streaming and SaaS subscriptions from any AI agent.
See, price, and control every tool call your AI agents make: policy checks, cost, and audit tools.
OpenAI organization usage and cost reporting through an admin API key connected by the user.
AI agent infrastructure: dedup, cost prediction, validation, governance, failure intelligence.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceMCP server that analyzes AI agent session logs to find token waste and optimization opportunities.20MIT
- AlicenseNot gradedqualityDmaintenanceAnalyzes Azure cloud costs, audits for waste, and provides budget insights via natural language through a secure local MCP server.2MIT
- AlicenseAqualityDmaintenanceTracks AI agent token usage and spending in real time, with budget alerts, per-task cost breakdown, and a visual dashboard.61MIT
- FlicenseNot gradedqualityBmaintenanceLocal LLM cost & token forensics proxy with anomaly detection, enabling security teams to scan for cost anomalies and abuse patterns, and expose results via MCP for autonomous agents.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/r-lattice/agent-cost-lens-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server