agent-receipts
The agent-receipts server creates, manages, and verifies cryptographically signed receipts for AI agent actions, providing an immutable audit trail of what an agent did, with what inputs and outputs.
Core Receipt Operations
track_action— Record a completed action with automatic SHA-256 hashing of input/output, capturing model, cost, latency, token usage, confidence, tags, tool calls, and custom metadatacreate_receipt— Create a receipt with pre-computed hashescomplete_receipt— Finalize a pending receipt with execution results (status, output hash, cost, latency, errors)get_receipt/list_receipts— Fetch a single receipt by ID or browse all receipts with filtering (agent, status, chain, action, tag, environment, type) and pagination/sorting
Cryptographic Verification
verify_receipt— Confirm a receipt's Ed25519 signature is valid and untamperedget_public_key— Export the signing public key for offline third-party verification
Chaining & Lineage
get_chain— Retrieve all receipts in a multi-step pipeline, ordered chronologically
AI Judge / Quality Evaluation
judge_receipt— Evaluate a receipt against a custom rubric with weighted criteria and passing thresholdscomplete_judgment— Record evaluation results (verdict, per-criterion scores, reasoning, confidence)get_judgments— Retrieve all judgments for a specific receipt
Constraints & Compliance
Attach constraints (e.g.,
max_latency_ms,max_cost_usd,min_confidence) when tracking actions to automatically flag pass/fail results
Maintenance & Billing
cleanup— Delete expired receipts past their TTL, with optional dry-run previewgenerate_invoice— Produce invoices from completed receipts within a date range, with grouping (by agent, action, or day) and output formats (JSON, CSV, Markdown)
Onboarding
get_started— Display usage examples and documentation for all tools
Agent Receipts
Logs tell you something happened. Receipts prove it.
{
"mcpServers": {
"agent-receipts": {
"command": "npx",
"args": ["@agent-receipts/mcp-server"]
}
}
}Real World Example
I built ModQuote — a multi-tenant SaaS for automotive shops. During development, I used Claude Code extensively for auditing and fixing the codebase.
The problem: when something went wrong, I had no way to prove what input Claude received, what it changed, or whether the output matched what was expected.
With Agent Receipts, every Claude Code session now generates signed receipts:
Input hash proves exactly what code Claude saw
Output hash proves exactly what it produced
Constraints catch when latency spikes or costs exceed budget
Chains show the full sequence of a multi-step audit session
When a fix didn't work as expected, I could pull the receipt, verify the signature, and see the exact input/output hashes — no guessing, no "Claude must have misunderstood."
That's the difference between logs and receipts. Logs tell you something happened. Receipts prove it.
Quick Start: MCP Server
Add the Agent Receipts MCP server to your AI tool's config and every action gets a cryptographic receipt automatically.
Platform support: macOS, Windows, and Linux — requires Node.js 18+
Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"agent-receipts": {
"command": "npx",
"args": ["@agent-receipts/mcp-server"]
}
}
}Claude Code
Add to .mcp.json in your project root:
{
"mcpServers": {
"agent-receipts": {
"command": "npx",
"args": ["@agent-receipts/mcp-server"]
}
}
}Cursor
Add to .cursor/mcp.json in your project root:
{
"mcpServers": {
"agent-receipts": {
"command": "npx",
"args": ["@agent-receipts/mcp-server"]
}
}
}Quick Start: SDK
npm install @agent-receipts/sdkimport { AgentReceipts } from '@agent-receipts/sdk'
const ar = new AgentReceipts()
const receipt = await ar.track({
action: 'generate_report',
input: { query: 'Q4 revenue' },
output: { total: 142000 },
})
console.log(receipt.receipt_id) // rcpt_8f3k2j4n...
console.log(receipt.signature) // ed25519 signatureQuick Start: CLI
npx @agent-receipts/cli init # Generate signing keys
npx @agent-receipts/cli keys # Show public key
npx @agent-receipts/cli list # List all receipts
npx @agent-receipts/cli verify <id> # Verify a receipt signatureHow It Works
Agent performs an action — API call, code generation, data lookup
Input/output are SHA-256 hashed — raw data never leaves your machine
Receipt is created — action, hashes, timestamp, agent ID, metadata
Receipt is Ed25519-signed — with a locally generated private key
Anyone can verify — share your public key; recipients verify independently
MCP Tools Reference
The MCP server exposes 14 tools that AI agents can call directly:
Tool | Description | Key Parameters |
| Track an agent action with automatic hashing |
|
| Create a receipt with pre-computed hashes |
|
| Complete a pending receipt with results |
|
| Verify the cryptographic signature of a receipt |
|
| Retrieve a receipt by ID |
|
| List receipts with optional filtering |
|
| Get all receipts in a chain ordered by timestamp |
|
| Export the Ed25519 public key for verification | — |
| Start AI Judge evaluation of a receipt |
|
| Complete a pending judgment with results |
|
| Get all judgments for a receipt |
|
| Delete expired receipts (TTL) |
|
| Generate an invoice from receipts in a date range |
|
| Show a getting-started guide with usage examples | — |
SDK API Reference
new AgentReceipts(config?)
const ar = new AgentReceipts({
dataDir: '~/.agent-receipts', // optional, defaults to ~/.agent-receipts
})ar.track(params) — Track a completed action
const receipt = await ar.track({
action: 'analyze_data',
input: { dataset: 'sales_2024' },
output: { summary: 'Revenue up 12%' },
agent_id: 'analyst-v2',
chain_id: 'chain_abc', // optional, auto-generated if omitted
parent_receipt_id: 'rcpt_prev', // optional, links to parent receipt
})ar.start(params) — Start a pending receipt
const receipt = await ar.start({
action: 'long_running_task',
input: { job_id: '12345' },
})ar.complete(receiptId, params) — Complete a pending receipt
const completed = await ar.complete(receipt.receipt_id, {
output: { result: 'done' },
status: 'completed',
})ar.verify(receiptId) — Verify a receipt signature
const { verified, receipt } = await ar.verify('rcpt_8f3k2j4n')
// verified: true | falsear.get(receiptId) — Get a receipt by ID
const receipt = await ar.get('rcpt_8f3k2j4n')ar.list(filter?) — List receipts
const result = await ar.list({ agent_id: 'my-agent', status: 'completed' })
// result.data: ActionReceipt[]
// result.pagination: { page, limit, total, total_pages, has_next, has_prev }ar.getPublicKey() — Get the signing public key
const publicKey = await ar.getPublicKey()
// 64-char hex string (Ed25519 public key)ar.track() with Constraints
const receipt = await ar.track({
action: 'generate_summary',
input: { document_id: 'doc-q4-2024' },
output: { summary: 'Revenue grew 12% YoY...' },
latency_ms: 1200,
cost_usd: 0.005,
constraints: [
{ type: 'max_latency_ms', value: 5000 },
{ type: 'max_cost_usd', value: 0.01 },
{ type: 'min_confidence', value: 0.8 },
],
})
// receipt.constraint_result.passed → true/falsear.getJudgments(receiptId) — Get judgments
const judgments = await ar.getJudgments('rcpt_8f3k2j4n')ar.cleanup() — Delete expired receipts
const { deleted, remaining } = await ar.cleanup()ar.generateInvoice(params) — Generate invoice from receipts
const invoice = await ar.generateInvoice({
from: '2026-01-01',
to: '2026-01-31',
agent_id: 'my-agent', // optional filter
group_by: 'agent', // optional: agent | action | day
})CLI Reference
Command | Description |
| Create data directory and generate signing keys |
| Display the public key |
| Export public key as JSON |
| Import a private key (64 hex chars) |
| Pretty-print a receipt |
| Verify a receipt signature |
| Verify with an external public key |
| List receipts (default: 50) |
| Filter by agent or status |
| Output as JSON |
| Show all receipts in a chain |
| Show chain as visual tree |
| Show aggregate receipt statistics |
| List judgments for a receipt |
| Delete expired receipts |
| Preview what would be deleted |
| Export a single receipt as JSON |
| Export all receipts as compact JSON |
| Export all receipts as formatted JSON |
| Generate invoice from receipts in date range |
| Output as json, csv, md, or html |
| Seed demo data for testing |
| Seed a custom number of demo receipts |
| Delete all receipts before seeding |
| Watch for new receipts in real-time |
| Watch filtered by agent, action, or status |
Receipt Format
{
"receipt_id": "rcpt_8f3k2j4n",
"chain_id": "chain_x9f2k",
"parent_receipt_id": null,
"receipt_type": "action",
"agent_id": "my-agent",
"org_id": "my-org",
"action": "generate_report",
"status": "completed",
"input_hash": "sha256:abc123...",
"output_hash": "sha256:def456...",
"output_summary": "Generated Q4 report",
"model": "claude-sonnet-4-20250514",
"timestamp": "2026-02-07T14:32:01.442Z",
"completed_at": "2026-02-07T14:32:02.100Z",
"latency_ms": 658,
"cost_usd": 0.003,
"signature": "ed25519:<hex>"
}Input and output are hashed client-side with SHA-256. Raw data never leaves your environment. Only hashes are stored in the receipt.
Verification
Share your public key with anyone who needs to verify your receipts:
# Export your public key
npx @agent-receipts/cli keys --export
# Verify a receipt with an external public key
npx @agent-receipts/cli verify receipt.json --key <public-key-hex>Verification re-computes the Ed25519 signature over the receipt's deterministic fields and confirms it matches the stored signature. No network requests — fully offline.
Configuration
Environment Variable | Description | Default |
| Data directory path |
|
| Default agent ID |
|
| Organization ID |
|
| Environment label ( |
|
| Ed25519 private key (hex) | Auto-generated |
Storage
All data is stored locally in the data directory:
~/.agent-receipts/
├── keys/
│ ├── private.key # Ed25519 private key (mode 0600)
│ └── public.key # Ed25519 public key
├── receipts/
│ └── *.json # Legacy JSON files (auto-migrated)
├── receipts.db # SQLite database (primary storage)
└── config.json # Agent and org configurationAs of v0.2.7, receipts are stored in SQLite with indexed queries for fast filtering and pagination. Existing JSON receipt files are automatically migrated on first startup.
Architecture
┌─────────────────────────────────────────────┐
│ CLI │
│ @agent-receipts/cli │
├─────────────────────────────────────────────┤
│ SDK │ MCP Server │
│ @agent-receipts/sdk │ @agent-receipts/ │
│ │ mcp-server │
├──────────────────────────┴──────────────────┤
│ Crypto + Schema │
│ @agent-receipts/crypto @agent-receipts/ │
│ schema │
└─────────────────────────────────────────────┘schema — Zod schemas, TypeScript types, JSON Schema for the Action Receipt Protocol
crypto — Ed25519 key generation, signing, verification, canonical serialization
mcp-server — MCP protocol server with receipt engine, storage, and key management
sdk — High-level Node.js SDK wrapping the engine
cli — Command-line tool for inspecting, verifying, and managing receipts
dashboard — Mission Control web UI for visualizing and managing receipts
Dashboard (Mission Control)
Visualize every receipt, chain, agent, constraint, and judgment in your system.
npx @agent-receipts/dashboardOpens Mission Control at http://localhost:3274 — visualize, verify, and manage all receipts.
Features: real-time receipt feed, chain visualization, constraint health monitoring, judgment scores, signature verification, invoice generation, dark mode, global search.
13 pages: Overview, Receipts, Receipt Detail, Chains, Chain Detail, Agents, Agent Detail, Constraints, Judgments, Invoices, Verify, Settings, How It Works.
Examples
Example | Description |
Simple action tracking with verification | |
Multi-step pipeline with parent/child receipt linking | |
Document analysis pipeline with chained receipts | |
Constraint verification with pass/fail rules | |
AI Judge evaluation with rubrics | |
Receipt TTL and cleanup |
Packages
Package | Description |
| Zod schemas and TypeScript types for the Action Receipt Protocol |
| Ed25519 signing, verification, and key management |
| MCP protocol server with receipt engine and storage |
| High-level Node.js SDK for tracking and verifying receipts |
| Command-line tool for managing receipts |
| Mission Control web UI — |
Roadmap
Local-first receipt storage (SQLite with indexed queries)
Ed25519 signing and verification
MCP server with 14 tools
Node.js SDK
CLI with full command set
Constraint verification (6 built-in types)
AI Judge with rubric-based evaluation
Output schema validation (JSON Schema)
Receipt TTL and cleanup
Invoice generation (JSON, CSV, Markdown, HTML)
Mission Control dashboard (13 pages, dark mode, search)
Dashboard npm package —
npx @agent-receipts/dashboardLive demo at agent-receipts-web.vercel.app
Receipt anchoring to blockchain/timestamping services
Multi-agent receipt sharing protocol
Receipt compression and archival
Hosted tier with cloud database
Development
pnpm install
pnpm build
pnpm test
pnpm devLicense
MIT — see LICENSE
Latest Blog Posts
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/webaesbyamin/agent-receipts'
If you have feedback or need assistance with the MCP directory API, please join our Discord server