Skip to content
项目

关于

The payment and trust layer for agent commerce: agents find, pay for and verify paid calls across x402 and MPP, backed by signed receipts. Open source, self-hostable.

商业与金融

这些数字如何统计

实测星标增长

24小时
0
7天
0
15天
+3
1个月
+5

各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。

README.md

原文

Agent402: the payment and trust layer for agentic commerce

Live at agent402.tools.

A paid call on Agent402: the request, the 402 with its price, the signature, the settlement, the answer and the signed receipt

Agent402 is the payment and trust layer for agentic commerce: agents find, pay for and verify paid calls to Agent402, across x402 and MPP, with signed receipts on successful direct calls.

  • Every rail on one server: x402 across chains with facilitator fallbacks, MPP with Tempo and card, and proof of work for the pure-CPU tools.
  • In the money path: an x402 payment settles after a successful answer and an error cancels it, a hang-up before the answer can be forgiven, a charged failure is booked and repaid against the chain record, and a settled paid answer on the direct routes carries a signed receipt (a streamed one as a final event-stream comment line, or as a trailer when the request sends TE: trailers); a tool bought through a referral link carries none.
  • The outside market too: a crawled index of x402 sellers and a router that buys from the proven ones.
  • Open source and self-hostable, with agent402-tollbooth for sites that charge agents per request and agent402-client, the buyer SDK.

500+ ready tools on the same rails, plus metered models and finished reports, and reports by card too. The applied layer of Agentic Finance. MCP-native.

Operated by Havok Holdings LLC · Live · Why pay here · Receipts · Status · Security · Company

Try it in 30 seconds: npx -y [email protected] init (sets up Claude Code, Codex, Cursor and OpenCode), claude mcp add agent402 -- npx -y [email protected], or paste https://agent402.tools/mcp into any MCP client. The free tier needs no wallet. Verified setup blocks for Cursor, VS Code, Windsurf, Cline, Roo Code, Codex CLI, Gemini CLI, Continue, ElizaOS, Paperclip, HarnessRouter and AgentCore: agent402.tools/guides/agent-hosts (shortlinks agent402.sh/<host>, e.g. agent402.sh/cursor).

Who pays: agents pay per call (from $0.001; models quoted per request, an upto payment settling actual usage plus the per-request fixed part the quote carries); people buy finished reports ($2 to $5) and monitors ($5 a month) by card; sites charge crawlers with the tollbooth.

Live MCP Registry CodeQL Secret scan npm npm npm CI License: AGPL-3.0

Contents: Receipts · What it is · Run it yourself · Pay from a wallet · Reference (wiki) · Independent records · Packages · Legal · Contributing

Receipts and verification

  • Every settled x402 answer carries PAYMENT-RESPONSE (success, transaction, network, payer), and every MPP answer Payment-Receipt (reference). Look the x402 transaction up on its network to see the transfer to the payTo the 402 named.
  • /.well-known/agent402-conformance.json lists, per payment rail, settlement after the answer, idempotent re-sends, the replay guard, refunds of a charged failure and the receipt, computed from the serving code.
  • A server run with a receipt signing key (RECEIPT_SIGNING_KEY) also signs every settled paid answer on the direct routes (a tool bought through a referral link carries none; its transaction on chain is its record): Agent402-Receipt, a compact JWS (EdDSA, Ed25519) over the route, the request, the answer's sha256, the price, the rail, the payer, the address paid and the settlement, checked against /.well-known/agent402-receipt-key.json or with verifyReceipt in agent402-client. A one-piece answer carries it as a header; a streamed answer ends with a : agent402-receipt <receipt> server-sent comment line, which event-stream parsers skip, over every byte streamed before it (and an Agent402-Receipt trailer when the client sends TE: trailers), checked with verifyStreamedReceipt. Every streamed paid answer's head also names X-Agent402-Receipt-Url, where GET /api/receipt/<token> with the token that header names (free, for 30 days) answers the same receipt once the answer finished, so a client that reads neither the comment line nor a trailer still gets it. A prepaid credits call names the key's id and its debit; a card-bought report carries one over the checkout and the report's text, on its page and in its email; the hosted MCP connector passes a paid result's receipt in _meta["tools.agent402/receipt"]. The signedReceipt cell of each conformance row reads true only while that server signs; without the key, the receipt is the settlement's own record.
  • POST /api/attest binds a paid call's response digest to its settlement on Base; POST /api/receipts returns the paying wallet's settled calls with each transaction and digest.
  • /trust#verify walks one call end to end; /api/index?seller=<host> shows an outside seller's crawl history, paywall probe and router verdict.

What Agent402 is

How a paid call flows through Agent402: buyers, the payment gates, the tools, signed receipts and the router, and settlement on chain

Agentic Finance is software agents paying and getting paid on their own: discovering a service, paying per request from a wallet over open protocols (x402, MPP), receiving a verifiable receipt, and earning per request in return. Agent402 is its applied layer - explainer: agent402.tools/agentic-finance · glossary.

Selling an x402 API? List it on the index for free at /sell (POST /api/index/register: self-serve, no signup, 0% take). The router sends buyers to a seller once its routes show settled payments from several independent buyers; calls priced at $0.05 or less on Base (up to $0.25 a day per seller and $5.00 a day in all) or $0.01 or less on Solana can be tried before that, marked unproven on the buyer's receipt. Charging crawlers on your own site instead? agent402-tollbooth puts a 402 gate in front of it.

What makes it different: Agent402 is open-source and self-hostable - and a single integration gives a buyer three free primitives over the whole x402 ecosystem:

  • Find - /api/find?q={task} resolves a task description to the best-matching tools (route, price, schema, ready example).
  • Route - POST /api/route is the neutral Smart Order Router: rank tools across every x402 seller crawled (auto-discovered from the x402 Bazaar on the Coinbase Developer Platform), health-aware, with include=external to exclude us. The response returns the top N and carries matched for how many scored.
  • Leaderboard - GET /api/leaderboard is the public on-chain ranking of x402 sellers by Base USDC settled volume - calls served, totalUsd, unique buyers per seller. It returns the top N, never the whole board (25 by default, 50 the ceiling; totalSellers carries the full count). Pipeline: Bazaar → eth_getLogs → per-call ceiling → aggregate by payTo. The snapshot refreshes every 12 hours.

Plus the catalog - 500+ strong: search/answer as the MCP front door, then 500+ tools and curated skill packs (multi-tool workflows callable as MCP prompts) - all runnable yourself, plus agent402-tollbooth - an open pay-per-crawl gate for the other side of x402.

Two doors, two price lists. Agents pay per call in USDC (x402 / MPP) or free via proof-of-work, and a finished report costs $0.60 to $2.00 that way ($0.05 for the IPO digest). People pay by card: the same reports at agent402.tools/reports (company dossier, 13F fund report, insider flow, market brief, deep research, FDA recall, domain audit) are $2 to $5, monitors that re-run on change at /monitors are $5 a month, and a prepaid credits key pays per successful call on Agent402's own services (Authorization: Bearer a402_…; /credits says whether packs are on sale). The card price includes payment processing. An agent paying per call pays the lower tool price for the same report.

Two payment wires, one URL. Every paid endpoint accepts x402 (PAYMENT-SIGNATURE, USDC on 13 chains or USDG on Robinhood Chain) and MPP (Machine Payments Protocol, the IETF-track Payment HTTP auth scheme co-authored by Tempo and Stripe): the same 402 carries both, an mppx client pays out of the box, and MPP settles on Base and Celo (USDC), natively on Tempo (in a dollar token the 402 names, via Tempo's relay), or by card over MPP (Stripe stripe/charge, offered on routes priced $0.50 and up when the operator configures it). The MPP marketplace lists every MPP seller we can verify live. Details: MPP on Agent402 · live MPP settlements.

Framework adapters (drop-in tools for the major agent stacks - auto-payment underneath): npm npm npm npm npm npm npm npm npm

500+ strong - live web search and cited answers as the MCP front door, then ready-to-use web tools and multi-tool skill packs for your AI agent, from one server. Every one priced per call and settled on-chain. Browser rendering, web search, PDFs, images, OCR, live financial/crypto/macro data, SEC EDGAR, deterministic stats, forecasting, and options/bond pricing (Black-Scholes, YTM), compression, and 150+ pure-CPU utilities. Run it yourself for free in 30 seconds (MCP or plain HTTP, no API keys, no signup - the free tier and x402/MPP payments never need a key; only a prepaid credits key is a bearer key), connect it to Claude/ChatGPT/any MCP client, and add your own tools in a few lines. No language model writes a utility tool's answer, and every tool CI can run without a third-party key is re-tested against its own example before every release. The model-backed surfaces are explicit and priced as such: the /v1 gateway (metered under a quoted ceiling, or flat tiers) and the finished report products (/v1/research, /v1/dossier, ... under Reference).

Optionally, the same server can charge per call over the x402 protocol (USDC on Base, Solana, Polygon, Arbitrum One, Monad, Celo, Avalanche C-Chain, Sei, OP Mainnet, Arc, Ink, Stellar & Algorand, plus USDG on Robinhood Chain - 14 chains) - so the instance you self-host for free can also be a hosted, monetized one. Free mode is one setting (FREE_MODE=true); a paid instance needs a payout wallet.

🟢 Hosted demo: agent402.tools · 📖 Wiki · 📦 npm · 🔌 MCP Registry · 🧩 Hosted MCP connector (https://agent402.tools/mcp)

Run it yourself in 30 seconds

Pick whichever fits. They are all free and need no wallet:

1. Zero install - add the hosted connector to Claude (claude.ai → Customize → Connectors → Add → Add custom connector):

https://agent402.tools/mcp

Codex: codex mcp add agent402 --url https://agent402.tools/mcp. OpenCode: { "mcp": { "agent402": { "type": "remote", "url": "https://agent402.tools/mcp", "enabled": true } } } in ~/.config/opencode/opencode.json.

The pure-CPU tools run free there. A wallet-only tool is payable in the same call over x402 or MPP, from an MCP client that holds a wallet (MCP Connector).

2. One command - run the MCP server locally (the pure-CPU tools work with no key; it pays the tiny proof-of-work for you):

npx -y [email protected] init   # sets up Claude Code, Codex, Cursor and OpenCode, then makes one free check call

init shows each config change before it makes it (--yes skips the questions), backs up any file it edits, and makes a new spending wallet on your computer only with --wallet or when you answer yes at the terminal. Or add it by hand:

# Claude Code
claude mcp add agent402 -- npx -y [email protected]
# Codex
codex mcp add agent402 -- npx -y [email protected]

OpenCode, in ~/.config/opencode/opencode.json:

{ "mcp": { "agent402": { "type": "local", "command": ["npx", "-y", "[email protected]"], "enabled": true } } }

3. Clone and host the whole thing (all 500+ tools as an HTTP API + MCP, free mode, no payments; Node.js 24.15.0 or later, the engines field in package.json):

git clone https://github.com/MikeyPetrillo/Agent402 && cd Agent402
npm install
FREE_MODE=true npm start          # → http://localhost:3000  (HTTP API + /mcp)
# try a tool over HTTP - no auth in free mode
curl -s -X POST localhost:3000/api/hash -H 'content-type: application/json' \
  -d '{"text":"hello world","algo":"sha256"}'

4. Deploy to Railway (full self-hosted instance, built from the repo's Dockerfile):

Deploy on Railway

The button creates the service from this repository; it adds no database or cache. Set FREE_MODE=true to serve every tool free, or the paid-mode variables in Self-Hosting: without one or the other the server exits at boot. The seller index crawls on a production boot (the image sets NODE_ENV=production; a FREE_MODE boot needs X402_INDEX_CRAWL=on). Redis and Postgres are optional and you add them yourself: REDIS_URL enables the upstream response cache (X-Cache: hit|miss), and DATABASE_URL enables the public /api/analytics dashboard.

Every environment variable the server reads, with its purpose and default, is in the generated configuration reference; .env.example is a commented starting file.

Pay per call from a wallet

Every paid route answers 402 with both an x402 offer and MPP challenges, so either client pays it. No API key, no signup: the wallet is the account.

MPP (a dollar token on Tempo, listed first in the 402, or USDC on Base or Celo) with mppx:

import { Mppx, tempo, evm } from "mppx/client";
import { privateKeyToAccount } from "viem/accounts";
const account = privateKeyToAccount(process.env.AGENT_KEY);
// The evm method signs for the tokens you list: USDC on Base and on Celo.
const methods = [tempo.charge({ account }), evm.charge({ account, currencies: [evm.assets.base.USDC, evm.assets.celo.USDC] })];
const res = await Mppx.create({ methods }).fetch("https://agent402.tools/api/uuid");

x402 (USDC on Base and other chains) with @x402/fetch:

import { wrapFetchWithPayment } from "@x402/fetch"; import { x402Client } from "@x402/core/client"; import { registerExactEvmScheme } from "@x402/evm/exact/client";
const client = new x402Client(); registerExactEvmScheme(client, { signer: (await import("viem/accounts")).privateKeyToAccount(process.env.AGENT_KEY) });
const res = await wrapFetchWithPayment(fetch, client)("https://agent402.tools/api/uuid");

On Base, an x402 exact payment is a signature (EIP-3009): the facilitator submits it and pays the gas, so the paying wallet needs only USDC, no ETH.

More: Paying with MPP · Paying with x402.

Reference

The long reference lives in the wiki, one page per subject:

  • Catalog: every tool category with example slugs, the proof-of-work tier and the catalog endpoints: wiki/Tool-Catalog.
  • LLM gateway (/v1): The gateway is an Agent402 service: it prices each call before it runs (a flat tier price, or a quote from the request on the metered routes), routes auto chat calls to a model chosen for the task, falls back to the next model on a chat tier when one fails, and signs a receipt for each settled paid answer. Every route and price: wiki/LLM-Gateway.
  • Reports and monitors: reports and recurring monitors sold by card: wiki/Reports-and-Monitors.
  • Decide: describe a job, get a priced plan, run it: wiki/Decide.
  • Skill packs: multi-tool workflows callable as one request or an MCP prompt: wiki/Skill-Packs.
  • Index and router: Find, Route and the seller leaderboard over the whole x402 ecosystem: wiki/x402-Index-and-Router.
  • Live payments view: the services/live settlement visualizer: wiki/Architecture.
  • Adapters: drop-in tools for the major agent frameworks: wiki/Adapters.
  • Add a tool: a tool definition in about 15 lines: wiki/Contributing.
  • Charge per call (self-hosting): turning a self-hosted instance into a paid one: wiki/Self-Hosting.
  • Why pay here: seven differences, each linked to the surface that proves it: wiki/Why-Pay-Here.
  • Why it's solid: testing, hardening, determinism and on-chain auditability: wiki/Security-Model.
  • Ecosystem and tollbooth: where Agent402 sits in the ecosystem, and the tollbooth for site owners: wiki/Payments-and-x402.
  • Repository map: what lives where in the source tree: wiki/Architecture.

Independent records

Grades, listings and purchase records kept by other services. Each runs its own checks, and we do not control what they show. A listing or grade is not an endorsement by that service.

vet402 record for agent402.tools mcp.market Wellknown MCP Queen operational grade HOL Registry agent402-mcp on Glama

Official packages and endpoints

These are the official Agent402.tools packages and endpoints, published by Havok Holdings LLC (formerly CardHavok LLC).

The same list is shown at agent402.tools/company#official and served as data in /.well-known/x402 (field official).

Ownership and licensing

  • Havok Holdings LLC (formerly CardHavok LLC) owns the code in this repository except a small number of trivial lines (seed URLs, a badge line, punctuation) contributed earlier under AGPL-3.0 or MIT, whose authors keep their copyright (see NOTICE).
  • The server is AGPL-3.0-or-later and every published package is MIT (details under Legal below). For a commercial license to the code, write to [email protected] or see agent402.tools/company.
  • Outside contributions carry a DCO sign-off on every commit and the contributor license agreement in CLA.md, which covers new and earlier contributions; see CONTRIBUTING.md.
  • NOTICE records ownership, contributions and AI-assisted development; THIRD_PARTY_NOTICES.txt lists bundled dependencies and their licenses; SECURITY.md covers reporting a vulnerability.

Legal

  • The hosted instance at agent402.tools is provided under its Terms of Service (acceptable-use policy included - using the service, including programmatically, constitutes acceptance) and Privacy Policy.
  • AI-gateway traffic (/v1 chat, embeddings, images, speech) is additionally subject to the upstream model providers' usage policies. Wallets used for prohibited content are blocked before settlement (WALLET_BLOCKLIST).
  • The server code is AGPL-3.0-licensed and provided as-is; every published npm package is MIT with its own LICENSE file in its directory: agent402-mcp (mcp/), agent402-client (client/), agent402-tollbooth (tollbooth/), agent402-model-provider (openclaw/), agent402-receipt-verify (receipt-verify/), the framework adapters under adapters/ (agent402-function-calling, agent402-messages-tools, agent402-stream-tools, agent402-structured-tools, agent402-function-tools, agent402-agent-loop-tools, agent402-dev-kit-tools, agent402-runner-tools, agent402-action-provider, agent402-actions-plugin, agent402-worker-functions) and the facilitator (facilitator/); the Python adapters on PyPI (adapters/langchain-py/, adapters/virtuals-game-py/) are MIT the same way. GitHub's repository-level license badge reports the server's AGPL; a package's license field and its directory's LICENSE are what apply to that package. Provided as-is, without warranty (see LICENSE and NOTICE). "Agent402" and the logo are trademarks of Havok Holdings LLC (formerly CardHavok LLC) - the license covers the code, not the name; forks must rename (see TRADEMARKS.md). If you self-host, you are the operator: your deployment, your terms, your compliance - Havok Holdings LLC operates only the hosted instance and is not responsible for third-party deployments.
  • All other product and company names are trademarks of their respective owners. Naming them describes compatibility or a data source and does not imply affiliation with, or endorsement by, them (agent402.tools/terms#trademarks).

Contact

Contributing

PRs that add useful tools, fix bugs, or improve docs are very welcome - see CONTRIBUTING.md (DCO sign-off and the CLA). Server AGPL-3.0, every published package MIT (see Legal above). Maintained by Havok Holdings LLC.

探索相关项目

加载中…