Agent Metering

io.github.jdhart81Published by GitHub account jdhart81v0.2.0Updated Nov 2, 2026

Usage metering + SLA accounting for agent services (the meter behind x402 micropayments).

The publisher's own server: Energyai

VerifiedStreamable HTTPWeb executableFinanceData & AnalyticsBusiness & Commerce

Overview

AI-generated overview

Remote MCP service for usage metering and SLA accounting between agent services, with priced meters, usage events, invoices and hash-chain verification.

What you can do
  • Create and list usage meters with a unit and a price in minor currency units
  • Record idempotent usage events with outcome, consumer class and channel, and read them back with filters and pagination
  • Report totals and time series per meter, bucketed by hour or day with per-bucket breakdowns
  • Produce SLA reports comparing success rate to a target, and verify the tamper-evident event hash chain
  • Close a period into an immutable invoice, and flag or unflag meters as test/synthetic (admin)
When to use it
Use it when an assistant or agent platform needs to bill or account for agent-to-agent usage: counting calls or tokens, tracking success rates against an SLA, and freezing a period into an invoice. It suits teams building paid agent services rather than general-purpose tasks.
Requirements
A remote MCP endpoint over streamable HTTP; no package install. The hosted service is the default, and the README says the cores can also be self-hosted from the repository. The admin flagging tool requires the server's VIRIDIS_ADMIN_TOKEN. The hosted tier has a free tier of 10 calls per day per service, with paid plans for payments, seats and SLA.
Before you install
Recording usage and closing periods create billing records, and a closed invoice is immutable and is meant to be settled by an escrow agent, so mistakes can have financial consequences. The admin flag tool needs VIRIDIS_ADMIN_TOKEN, a privileged credential. The hosted service layer, including payment, settlement and customer data, is proprietary and not in the repository.

Installation

In SourceWeft

  1. Open Agent Metering in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Web executable via Streamable HTTP. Remote servers run from the web runtime once configured in a workspace.

Use with an agent

Paste this prompt into Claude Code, Codex, Cursor or another agent — or into SourceWeft chat. The agent reads this server's install guide, shows you its publisher, endpoint and sign-in, and adds it to your client once you agree. Keys never go into a command.

Read https://sourceweft.com/mcp/io.github.jdhart81%2Fagent-metering/install.md and connect the MCP server it describes to my client. Before changing any config, show me its publisher, endpoint and sign-in method and wait for my OK. Never put an API key in a command or in a file I would commit; ask me where it should come from.

Read the install guide the agent follows

Other MCP clients

Add this to your client's mcpServers config.

{
  "mcpServers": {
    "agent-metering": {
      "type": "http",
      "url": "https://mcp.viridisconservation.com/metering/mcp"
    }
  }
}

README

Viridis Agent Fleet: open-source agents for the agent economy

Deterministic, auditable MCP agents: trust and settlement rails (identity, trust, escrow, metering, arbitration, notary, surety, provenance, covenant, offsets, compute-ledger) and priced-grade services (tax credits, GHG accounting, construction takeoff, measurement, compliance). Every core is pure Python with no LLM in the serving path, and every result is content-addressed so anyone can re-verify it.

Licensed Apache-2.0. Run any agent yourself, fork it, embed it.

Run an agent locally (free, forever)

bash
pip install -r requirements-dev.txtpython3 agent-escrow-agent/adapters/mcp_server.py          # stdio MCPpython3 run_fleet_tests.py                                 # every agent's invariant tests

Or use the hosted fleet

https://mcp.viridisconservation.com runs all agents as one managed MCP service:

Self-hosted (this repo)Hosted by Viridis
Agent logic & verification✅ identical✅ identical
Viridis-signed receipts & notary chain–✅
Shared trust/reputation network data–✅
Maintained rule packs (tax, GHG factors, regs)snapshot✅ kept current
Payments (x402, card), seats, SLA–✅

Free tier: 10 calls/day per service; the rails (identity, escrow, metering…) are free forever. Verification is always free.

For agents

Agents and LLM tools can start from llms.txt, a generated index of every agent, and AGENTS.md, the rules for using and changing the fleet.

Part of the Viridis open-source commons

Building agents for conservation or energy work? VergeCommon and EnergyAI MCP also expose MCP tools, and ViridisOS serves its decision functions to agents over MCP.

This project is one of a connected set of open tools from Viridis. Each stands on its own; together they run from field evidence to checked decisions.

Conservation commons

Verifiable science

  • Viridis Canon: machine-checked Lean 4 mathematics for ecological decisions, with a DOI for every result
  • ViridisOS: open reference runtime for DOI-backed decision modules and recomputable results
  • Viridis Research: the nightly public research record, each claim labeled by what a verifier actually checked
  • ProofLens: see what a Lean statement means before reading the proof

Agent tools

  • Viridis Agent Fleet (this repository): open-source MCP agents with deterministic, auditable cores
  • EnergyAI MCP: energy-planning estimates and incentive sources for AI agents

Browse every project on the Viridis profile. If this one is useful to you, a star helps other people find it.

Boundary

This repo contains agent cores, MCP adapters, tests, standards and self-host tooling. The hosted service layer (gateway, payment and settlement, seats, signing authority, operations, telemetry and customer data) is proprietary and is not in this repo. Please don't open PRs that add it.

"Viridis", "Viridis Conservation" and the Viridis marks are trademarks of Viridis LLC; see TRADEMARKS.md.

Source: README.md at commit 350712c

Tools

11

create_meter

Create a usage meter between a provider and a consumer agent. unit: what is being counted (call, token, kwh, ...). Price is in minor currency units (cents) per unit. Returns the meter_id.

Parametersunitrequiredconsumerrequiredcurrencyproviderrequiredsla_targetprice_minor_per_unitrequired

record_usage

Record a usage event. Idempotent on event_id (safe to retry — never double-billed). outcome is 'ok' or 'error' and feeds the SLA report.

Parametersoutcomeevent_idrequiredmetadatameter_idrequiredquantityrequired

usage_summary

Totals for a meter: event count, total quantity, accrued minor units.

Parametersmeter_idrequired

sla_report

Pure SLA report: success_rate vs sla_target, breach flag. No mutation.

Parametersmeter_idrequired

close_period

Freeze all open events into an immutable invoice (exactly-once). The invoice amount is what agent-escrow-agent should settle.

Parametersmeter_idrequired

verify_chain

Verify the tamper-evident event hash chain for a meter.

Parametersmeter_idrequired

list_meters

List all meters with event/invoice counts.

Takes no parameters.

list_events

Read usage events (paginated, read-only). Filter by meter, provider, consumer_class (internal|external|unknown), channel, outcome (ok|error), and ISO date range [since, until). Test-flagged events are excluded unless include_test=true. Returns events + next_cursor.

Parameterslimitsinceuntilcursorchanneloutcomemeter_idproviderinclude_testconsumer_class

usage_timeseries

Usage time series bucketed on each event's recorded_at (UTC; bucket=day|hour), grouped across meters by provider — a real time-series primitive, independent of meter creation times. Includes per-bucket breakdowns by consumer_class / channel / provider. est_accrued_minor is an estimate; authoritative billing stays with usage_summary.

Parameterssinceuntilbucketchannelmeter_idproviderinclude_testconsumer_class

flag_meter

Admin: flag/unflag a meter as test/synthetic so its events are excluded from usage statistics by default. Touches meter metadata only — never events, never the hash chain, never billing accruals. Requires the server's VIRIDIS_ADMIN_TOKEN.

Parametersnoteis_testrequiredmeter_idrequiredadmin_tokenrequired

describe_agent

Fleet-standard self-description.

Takes no parameters.

Version history

1
  1. v0.2.0LatestSep 16, 2026

Score

100% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 daysRequired25 pts
  • Auth declaredRequired10 pts
  • Tools listedRequired15 pts
  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts
  • License10 pts

Other Energyaisolution integrations