runmeter
Click on "Deploy 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., "@runmeter show me cost summary for last 7 days grouped by model"
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.
runmeter
An MCP server that gives any LLM or agent workflow cost and reliability observability for free.
Record one row per model call (model, tokens, cost, latency, finish reason, tags), then query and aggregate that telemetry through MCP tools. Cost is computed automatically from a built-in, overridable pricing table when you do not pass an explicit figure. Storage is a local SQLite file. No external service, no credentials, no network calls.
Built with FastMCP. Works with any MCP client (Claude Code, Claude Desktop, or your own agent) over stdio.
Companion project: a-agentic-delivery-pipeline is an AI-native, skills-driven delivery pipeline that emits its per-stage telemetry to runmeter.
Why
Most agent stacks can tell you what an agent did, but not what it cost or how often it failed. Teams end up bolting on a spreadsheet or a bespoke logging table per project. runmeter makes per-run cost and reliability a first-class, queryable signal that every agent on the machine writes to the same way. It is the "cost-per-task economics" and "evaluation and performance" discipline that production agent work needs, packaged as a drop-in MCP server.
Related MCP server: ai-usage-metrics-mcp
Tools
Tool | Purpose | Hint |
| Record one model/agent run; auto-computes cost when the model is priced | write |
| Fetch a single run by id | read-only |
| List runs newest-first with filters (model, agent, tag, status, since) and paging | read-only |
| Roll up cost, tokens, avg latency, and error rate grouped by model / agent / finish_reason / day / tag | read-only |
| Export raw runs as JSON or CSV for external analysis | read-only |
| Delete one run by id; requires | destructive |
Every tool returns both a human-readable note and structured content.
Install
git clone https://github.com/Aptica-Solutions/a-mcp-runmeter.git
cd a-mcp-runmeter
python3 -m venv .venv && source .venv/bin/activate
pip install -r requirements.txtRun
python3 server.pyConnect from an MCP client
Point your client at server.py over stdio. Example (claude_mcp_config.json):
{
"mcpServers": {
"runmeter": {
"command": "python3",
"args": ["/absolute/path/to/a-mcp-runmeter/server.py"],
"env": { "RUNMETER_DB_PATH": "~/.runmeter/runmeter.db" }
}
}
}Configuration
All optional. runmeter runs with zero configuration.
Variable | Default | Purpose |
|
| SQLite telemetry store location |
| built-in table | JSON file overriding/extending per-model pricing |
Pricing override file shape (USD per 1,000,000 tokens):
{
"my-fine-tuned-model": { "input": 3.0, "output": 15.0 }
}The built-in table ships sensible list-price defaults for common Claude, GPT, and Gemini models. They are convenience defaults, not a billing source of truth; override them for anything you meter seriously.
Example flow
An agent records each call as it goes:
// runmeter_record
{ "run": { "model": "claude-sonnet-4", "input_tokens": 8200, "output_tokens": 640,
"latency_ms": 1830, "finish_reason": "stop", "agent": "discharge-summarizer",
"tags": ["prod", "east"] } }
// -> cost auto-computed at $3/M in + $15/M out = $0.034200Then you ask for a rollup:
// runmeter_summary { "group_by": "model", "since": "7d" }
// -> per-model run count, tokens, total cost, avg latency, and error rate,
// sorted by cost descending, with grand totals.since accepts an ISO timestamp or a relative window: 30m, 24h, 7d, 2w.
Development
pip install -e ".[dev]"
pytest -qThe test suite points RUNMETER_DB_PATH at a throwaway file per test, so it never touches a real store.
Design notes
Tools use consistent
runmeter_prefixes for discoverability.Read tools carry
readOnlyHint; the single delete tool carriesdestructiveHintand refuses to run without an explicitconfirm, so it cannot wipe the store by accident.Aggregation runs in Python so multi-tag rows and per-day buckets are handled uniformly, keeping the SQL simple and portable.
No ORM and one dependency beyond the MCP SDK and Pydantic, by design: low total cost of ownership and easy to audit.
License
MIT. See LICENSE.
Built by Aptica Solutions.
Continuous collection
The optional runmeter-collect command imports local assistant usage idempotently and exports metadata-only aggregates. See COLLECTION.md for configuration and coverage limits.
Available Tools
6 toolsrunmeter_deleteADestructiveIdempotent
Delete a single run by id. Requires confirm=true to actually remove it.
This is the only destructive tool. It scopes to one id and refuses to run without an explicit confirm, so it cannot wipe the store by accident.
Inputs: run_id (required), confirm. Returns: object
runmeter_exportARead-onlyIdempotent
Export raw runs as a JSON array or CSV string for external analysis.
fmt is 'json' or 'csv'. Optional since limits the window. Newest-first,
capped at limit rows (max 10000).
Inputs: fmt, limit, since. Returns: object
runmeter_getARead-onlyIdempotent
Return the full stored row for a single run id.
Inputs: run_id (required). Returns: object
runmeter_listARead-onlyIdempotent
List runs newest-first with optional filters.
Filters: model, agent, status ('ok'/'error'), tag (matches any run carrying
that tag), and since (ISO timestamp or relative window like '24h', '7d').
Use limit/offset to page. Returns up to limit rows plus the total count
matching the filters so you know whether to page further.
Inputs: tag, agent, limit, model, +3 more. Returns: object
runmeter_recordA
Record a single LLM/agent run and return the stored row.
Cost is taken from cost_usd when provided; otherwise it is computed from
the built-in pricing table (USD per 1M tokens) when the model is known. If
the model is unpriced and no cost is given, cost is stored as null and the
response notes that the model is unpriced so you can extend the table.
Inputs: run (required). Returns: object
runmeter_summaryARead-onlyIdempotent
Aggregate telemetry into cost and reliability rollups.
group_by is one of: 'model', 'agent', 'finish_reason', 'day', or 'tag'.
Optional since limits the window (ISO timestamp or relative like '30d').
Each group reports run count, total input/output tokens, total cost,
average latency, and error rate. Groups are sorted by total cost descending.
Inputs: since, group_by. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Each tool targets a distinct operation: recording, retrieving a single run, listing with filters, aggregating summaries, exporting, and deleting. There is no overlap in purpose, making tool selection unambiguous.
All tool names follow the pattern 'runmeter_' + verb (get, summary, record, list, export, delete). The consistent prefix and verb-based naming make the toolset predictable and easy to navigate.
Six tools is well within the ideal 3-15 range and perfectly scoped for a telemetry server. Each tool earns its place, covering core operations without unnecessary bloat.
The toolset covers the full lifecycle of LLM/agent run telemetry: record, retrieve, list, analyze, export, and delete. There are no obvious missing operations for the domain, and the single-run delete with confirmation prevents accidental data loss.
Related MCP Connectors
MCP server for building and testing AI agents with multi-model experimentation and insights.
Hosted MCP server for LLM cost estimation, model comparison, and budget-aware routing.
MCP server providing access to the Scorecard API to evaluate and optimize LLM systems.
MCP server for your apps' tools and custom tools, plus hosted AI agents and approval-gated workflows
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol (MCP) server for comprehensive monitoring and observability of systems using Langfuse.1MIT
- AlicenseAqualityDmaintenanceA MCP server for tracking AI usage metrics and structured logs across applications. Monitor model calls, analyze usage patterns, track costs, and debug AI interactions.58 npmMIT
- AlicenseNot gradedqualityCmaintenanceAn MCP server that gives AI agents observability over their own tool calls, enabling auditing, cost tracking, latency analysis, and alerting.MIT
- AlicenseAqualityDmaintenanceMCP server for AI agent observability, providing trace and span logging, search, latency/tokens/cost metrics, and anomaly detection using an in-memory buffer.6MIT