x402receipts

Record x402 agent purchases as reconciled, auditable receipts; verify any receipt on the ledger.

OtherTypeScriptv1.0.0

x402receipts

Accounting infrastructure for autonomous spending. Every x402 purchase an agent makes becomes a receipt, reconciled against the on-chain transaction, with missing or unmatched payments flagged, monthly statements for finance, and evidence anyone can verify.

Use it

In code — one wrapper around the fetch your agent already pays with (npm i x402receipts-sdk):

import { wrapFetchWithPayment } from "@x402/fetch";
import { withRegister } from "x402receipts-sdk";

const register = withRegister(fetch, { endpoint: "https://app.x402receipts.com", payWith: () => pay });
const pay = wrapFetchWithPayment(register, wallet);

As an MCP server (npx -y x402receipts-mcp): record_receipts, verify_receipt, service_info. See packages/mcp.

Over HTTP: POST https://app.x402receipts.com/api/v1/receipts — answers 402 with the x402 challenge; any x402 client pays it.

With an AI coding tool: paste the integration prompt into Claude Code or Cursor.

The format is an open standard

The record, its fingerprint, the Merkle batching, the anchor record and the verification algorithm are published as ARR-1 — Agent Receipt Record, released into the public domain (CC0). JSON Schemas are in spec/arr-1/. Implement it yourself, or check our implementation against it.

In this repo

PathWhat
spec/arr-1/the ARR-1 specification and its JSON Schemas (CC0)
sdk/the x402receipts-sdk npm package (single file, no dependencies)
packages/mcp/the x402receipts-mcp MCP server
examples/plain Node, Vercel AI SDK, LangChain, OpenAI Agents
integrations/agentkit/Coinbase AgentKit action provider
integrations/x402-ecosystem/x402.org ecosystem entry

How it works

  1. Capture — the SDK records each paid call: resource, amount, counterparty, transaction reference, request/response fingerprints, delivery status, and the seller's signed receipt when it issues one (x402 offer-receipt).
  2. Reconcile — the connected wallets are read on Base and Solana; every outgoing USDC payment is matched to a receipt. What doesn't match is an exception, not an average.
  3. Prove — each night, each account's receipts form a group; the group's Merkle root is written to the Hedera Consensus Service with a link to the group page. Every receipt has a public verification page that redoes the maths in the browser.
  4. Report — the owner signs in with the wallet: spend by supplier, the register, CSV and signed JSON export.

Guide: https://x402receipts.com/guide.html · Status: https://app.x402receipts.com/status · Contact: hello@x402receipts.com

MIT licensed.

Installation

Source-derived launch command. Check the maintainer’s required arguments and credentials before running:

bash
npx -y x402receipts-mcp

Set up in your AI client

Merge this template into ~/Library/Application Support/Claude/claude_desktop_config.json. Keep existing servers. Add any arguments, credentials, and permissions required by the maintainer; this template has not been install-tested.

json
{
  "mcpServers": {
    "com-x402receipts-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "x402receipts-mcp"
      ]
    }
  }
}

Restart Claude Desktop completely for changes to take effect. Confirm the server appears connected in the client’s tool list, then try a read-only example from its documentation.

Claude Desktop setup reference

Package

x402receipts-mcpnpm

Compatible MCP Clients

x402receipts works with any MCP-compatible client. Copy the config snippet from the Configuration section above and add it to the file shown for your client, then restart the application.

  • Claude Desktop~/Library/Application Support/Claude/claude_desktop_config.jsonRestart Claude Desktop completely for changes to take effect.
  • Cursor~/.cursor/mcp.jsonRestart Cursor for changes to take effect.
  • VS Code.vscode/mcp.jsonReload VS Code window for changes to take effect.
  • Windsurf~/.codeium/windsurf/mcp_config.jsonRestart Windsurf for changes to take effect.
  • Claude Code.mcp.jsonSave at the project root, then start Claude Code in that project and review the MCP server approval prompt. Keep real credentials out of shared files.

Learn More