Skip to main content

402-mcp enables x402 payments in MCP

By Steven Van ·

Vercel's x402-mcp lets MCP servers charge AI agents per tool call, with payments confirming in under 200ms for fees under a cent.

MCP servers can now require payment before running a tool. Vercel's new x402-mcp library plugs the x402 payment protocol into the AI SDK, letting AI agents discover and pay for Model Context Protocol tools without registering accounts, exchanging API keys, or setting up separate billing.

On the server, developers define a paidTool with a price using createPaidMcpHandler; the tool only runs once payment is confirmed. On the client, wrapping an existing AI SDK MCP client with withPayment adds the tools an agent needs to authorize those payments, without changing how it otherwise calls tools. Vercel says payments confirm in roughly 100 to 200 milliseconds, with fees under $0.01 and support for minimums under $0.001, currently settled as one-time USDC payments on the Base blockchain.

The library ships alongside an x402 AI Starter Kit combining Next.js, the AI SDK, AI Elements, and AI Gateway with a paid MCP server, a payment-enabled MCP client, and Coinbase-managed wallets, deployable to Vercel with one click.

Vercel
Vercel
The platform for frontend developers — deploy, preview, and scale web apps and AI agents with zero config.
View Vercel →

Original source

Read 402-mcp enables x402 payments in MCP on Creators Toolbox