Cloudflare Agents SDK (x402)
Charge per MCP tool call on Workers with paidTool
- Rank
- 4 of 14
- Composite score
- 8.3 / 10
- Schemes
- x402
- Role
- Pays 402 challenges; Charges with 402
- Kind
- sdk
- Maturity
- unstated
- Protocol / rail
- x402 (USDC on Base)
- Assets
- USDC
- Networks
- base
- Custody model
- Self-custodial (payments go to your own address)
- Node management
- Not required
- MCP native
- Yes
- License
- MIT
- Last verified
- 2026-10-15
Overview
Cloudflare's Agents SDK supports x402 natively. On an McpAgent, paidTool is a drop-in replacement for tool that attaches a USD price, so free and paid tools coexist on one server; withX402 gates ordinary HTTP content the same way. The documented configuration pays a recipient address you supply, through the x402.org facilitator, on Base or Base Sepolia. It is the most direct path to charging for MCP tools if you already deploy on Workers.
Key advantages
- paidTool is a drop-in replacement for tool — free and paid tools coexist on one MCP server
- Runs on Cloudflare Workers through McpAgent
- withX402 gates ordinary HTTP endpoints the same way
Trade-offs
- Documented networks are Base and Base Sepolia
- Tied to Cloudflare Workers and the Agents SDK
Evaluation matrix
- Custody & Sovereignty8.0
Self-custodial with exit guarantees vs. centralized/custodial risk. A 10 means the holder keeps their own keys and can unilaterally exit to the base chain; a custodial platform scores around 4.
- Operational Friction8.5
Infrastructure burden. Zero nodes, channels or liquidity to manage scores a 10; running and maintaining your own Lightning node scores around 4–5.
- Agent Native Support9.5
Out-of-the-box MCP server integration, typed tool calls and LLM-friendly setup. A first-party MCP server scores 9–10; a library or CLI an agent can drive scores 6–8.
- Payment Rails & Assets7.0
Breadth of settlement rails and assets: Lightning for true micropayments, stablecoins for a stable unit of account, cards for mainstream reach. A single asset on a single network scores around 7.
- Settlement Speed & Fees8.0
Instant sub-second settlement with near-zero overhead scores a 10. Block-bound settlement scores around 8; card-network settlement and fees score lower.
- Developer DX9.0
SDK quality, documentation, maintenance and copy-paste integration speed. Alpha-stage API churn, stale releases or inconsistent docs lower the score.
Why these scores. Custody 8: payments to your own address. Friction 8.5: deploy on Workers, uses a facilitator. Agent 9.5: MCP-native paid tools. Rails 7: USDC on Base. Settlement 8: Base. DX 9: a drop-in API.
Integration
npm install agentsthis.server.paidTool(
"square",
"Squares a number",
0.01, // USD
{ number: z.number() },
{},
async ({ number }) => { /* ... */ },
);Best for
Developers on Cloudflare Workers who want to charge per call for MCP tools.
Sources
Every claim on this page was checked against these sources on 2026-10-15. Maturity “unstated” means: the vendor does not state a maturity level.
Machine-readable
curl "https://402mcp.org/api/v1/solutions?id=cloudflare-agents-x402&view=full"curl -H 'Accept: text/markdown' https://402mcp.org/solutions/cloudflare-agents-x402Other indexed solutions
- Lightning Labs WavelengthL402 / Lightning / Ark · rank 1 · 9.4
- x402 ProtocolEVM / Base / Solana (USDC) · rank 2 · 8.6
- Alby MCP ServerBitcoin / Lightning (NWC, L402) · rank 3 · 8.3
- Coinbase Payments MCPx402 (USDC on Base) · rank 5 · 8.3
- Machine Payments Protocol (MPP)Multi-method: Tempo, Stripe, Lightning, EVM, Solana and more · rank 6 · 8.3
- thirdweb x402x402 on 170+ EVM chains · rank 7 · 8.1
- PayAI Networkx402 on Solana and EVM networks · rank 8 · 8.0
- x402-mcp (Vercel)x402 (USDC on Base) for MCP servers · rank 9 · 7.8
- Crossmint Agent WalletsEVM (USDC on Base) · rank 10 · 7.8
- Stripe Machine PaymentsMPP (cards, stablecoins) and x402 (USDC) · rank 11 · 7.7
- lngetBitcoin / Lightning (L402) · rank 12 · 7.5
- ApertureBitcoin / Lightning (L402, MPP) · rank 13 · 7.1
- FewsatsBitcoin / Lightning (L402) · rank 14 · 7.1
Compare all 14 on the leaderboard, or read the scoring methodology.