Agents & MCP
Let agents read their own telemetry#
Your coding agent has no memory of yesterday. It cannot tell you what it worked on last week, whether it has hit this error before, what its last attempt at this migration cost, or that it is currently repeating a session that already failed.
ClawMetry has all of that. The MCP server hands it over.
claude mcp add clawmetry -- clawmetry mcpNow the agent can ask.
You: Before you start, check clawmetry — have I tried this migration before?
Claude: I found two sessions touching
migrations/0042. The one on the 2nd ran 38 tool calls and ended with the sameIntegrityErroryou are describing; the one on the 4th cost $6.10 and was stopped after a repeated tool failure onalembic upgrade. In both, the failure follows apsql -c "\d users"that returned an empty result. Let me check the schema first this time.
That is not a summary of the conversation you are in. It is your own telemetry, read by the agent, before it starts spending money repeating itself.
Why this is different from a dashboard#
A dashboard answers questions you thought to ask. An agent with access to its own history answers questions in the middle of doing the work, when the answer changes what it does next:
- "Have I seen this error?" — asked before debugging, not after.
- "Am I looping?" — an agent that can count its own repeated tool calls can
stop itself.
- "What did the last attempt cost?" — the difference between trying a
cheaper approach and burning the same $40 again.
- "Which of my runtimes is the expensive one?" — a question about your
fleet, answered inside the tool you are already in.
- "What changed since the last successful run?" — the transcript of the run
that worked is right there.
What it exposes#
Five tools, over stdio, locally:
| Tool | Question |
|---|---|
list_sessions | What have I been running? |
get_cost_summary | What did it cost over this window? |
get_session_trace | What happened inside one session? |
list_events | Raw events, filtered by session, type or time |
get_health | Is ClawMetry itself healthy? |
Those five cover a surprising amount, because list_events takes an event-type
filter and get_session_trace returns the full tool stream. "Show me every
tool_result with an error in the last day" is one call.
It reads across runtimes#
This is the part people miss. The MCP server does not read Claude Code's transcripts — it reads ClawMetry's store, which holds every runtime on the machine.
So Claude Code can answer questions about your Cursor sessions. Codex can look at what the OpenClaw agent did overnight. A local agent can compare its own cost per task against the hosted one.
Safety and shape#
- Local only. The transport is stdio; the data path is a loopback HTTP call
to the daemon with a token from a file only your user can read. Nothing about MCP opens a network surface.
- Read only. There is no tool here that writes, deletes, or controls an
agent. An agent with this server attached cannot pause another agent, change a policy, or modify your store.
- Honest when empty. With no daemon running, tools return an explicit
"daemon is not running" error rather than an empty list — because an empty list reads as "you did nothing this week" and an agent will believe it.
- It sees your transcripts. That is the point, and it is worth being
deliberate about: an agent with this attached can read the content of past sessions, including any secrets that ended up in them. See Hardening for redaction.
Getting started#
- Connect the MCP server to your client
- Try the self-diagnosis recipes
- Turn the good ones into skills and prompts