Get paid by AI agents.
Open-source payment infrastructure for the MCP ecosystem. Declare a price on any tool, agents pay in USDC over x402, settles on Solana in ~1.5 seconds. No Stripe. No accounts. No API keys.
Live demo
Real Claude Opus agent decides which paid tools to use, pays autonomously over x402, gets results, answers the user.
$ pnpm --filter @agenticpay/two-agent-demo agent
Task: Reverse 'agenticpay rocks' and tell me how many words are in
'The quick brown fox jumps over the lazy dog'.
[turn 1] tool_use: reverse_string → paying $0.001 USDC ...
✓ paid + got result in 1596ms: {"result":"skcor yaptnega"}
[turn 1] tool_use: word_count → paying $0.0005 USDC ...
✓ paid + got result in 1286ms: {"count":9}
=== payments summary ===
reverse_string $0.0010 USDC 1596ms
word_count $0.0005 USDC 1286ms
TOTAL $0.0015 USDC 2 calls
On-chain proof: EsqzTG8id…Bnku (devnet)
What's in the box
- packages/sdk - USDC + wallet primitives
- packages/cli - `agenticpay` command
- packages/mcp-server - HTTP server with x402 paywall middleware. Each tool has a price.
- packages/mcp-bridge - the other side: turns x402-paywalled endpoints into native MCP tools. Drop it into Claude Desktop or Cursor and paid APIs show up as ordinary tools. Holds the wallet, signs each payment, enforces the spend caps below.
- packages/facilitator - self-hosted x402 facilitator. Verify + settle on Solana, pays SOL fees on behalf of the agent. Run your own instead of trusting someone else's with your settlement path.
- examples/two-agent-demo - Claude Opus agent paying for tool calls
The agent pays. You set the ceiling.
An agent holding a wallet and signing its own payments is the whole point, and also the obvious thing to be nervous about. So the bridge takes two limits, and refuses anything above them before a signature is ever produced.
// claude_desktop_config.json
"agenticpay": {
"command": "npx",
"args": ["-y", "@agenticpay/mcp-bridge"],
"env": {
"AGENTICPAY_BRIDGE_MAX_PER_CALL": "5000", // max 0.005 USDC per call
"AGENTICPAY_BRIDGE_SESSION_BUDGET": "100000" // max 0.10 USDC per session
}
}
Amounts are in base units of the payment asset (USDC has 6 decimals). A refused payment comes back to the agent as an ordinary tool error and the wallet is never touched. Session budget is counted when a payment is signed rather than when it settles, so a peer that fails settlement cannot drain you by retrying.
Both caps are opt-in. Leave them unset and the bridge behaves as before, which is fine on devnet and a bad idea with real money.
Or just point at our hosted one
Skip self-hosting for testing. We run a free devnet facilitator:
FACILITATOR_URL=https://agentpay-facilitator-e9b20a5fee6a.herokuapp.com
Devnet only. Mainnet support and hosted commercial tier coming.
Why this exists
The current AI agent stack assumes humans hold the credit card. That breaks the moment agents act on their own initiative - calling APIs, hiring sub-agents, paying for compute. You can't OAuth your way through it.
Stablecoin micropayments over HTTP fix it. agenticpay packages the missing ergonomics for the MCP ecosystem specifically: any tool can declare a price, any agent can pay it, the whole pipeline including the facilitator that submits the on-chain settlement is open source and self-hostable.