Micropagamentos HTTP-native da Coinbase. USDC na Base e Solana. Pagamentos máquina-a-máquina com HTTP 402.
O x402 dá ao seu agente 10 tools que ele chama direto — escolha as que precisar, no Claude, Cursor ou qualquer cliente MCP.
pay_request — Pay for a 402-protected resource. Sends USDC payment via x402 protocol and returns the resource content. The agent automatically handles the 402 handshake.verify_payment — Verify if a x402 payment was received and settled on-chaincreate_paywall — Create a x402 paywall configuration for an endpoint. When requests hit this endpoint, they receive HTTP 402 with payment instructions.// Your agent calls a tool directly — no glue code.
// CodeSpar's managed tier handles OAuth2, token rotation and rate limits.
const result = await session.call("pay_request", { /* ... */ });$ npm install @codespar/mcp-x402Adicione esta entrada ao seu claude_desktop_config.json (ou a config de qualquer cliente compatível com MCP).
{
"mcpServers": {
"x402": {
"command": "npx",
"args": [
"-y",
"@codespar/mcp-x402"
],
"env": {
"X402_API_KEY": "<your_x402_api_key>"
}
}
}
}Depois de reiniciar, seu agente pode chamar qualquer uma das 10 ferramentas abaixo — teste pay_request primeiro.
Necessárias pra autenticar o server. Armazenadas criptografadas ao usar a hospedagem gerenciada da CodeSpar.
X402_API_KEYAPI key for x402
Cada ferramenta é independente — seu agente carrega só o que precisa pra reduzir contexto e tempo de resposta.
pay_requestverify_paymentcreate_paywallget_paywalllist_paywallsdelete_paywallget_balancelist_paymentsMCP é um protocolo — qualquer framework que o fale pode montar este server.