MCPay.fun
MCPay.fun: Pay-per-use APIs! Leveraging x402 and MCP for a new payment web.
Problem Statement
MCPay is a new payment layer for the internet, built for humans and autonomous agents (LLMs, bots, scripts). It enables pay-per-use API access without API keys, OAuth, or subscriptions — using only standard HTTP + crypto payments.At the heart of MCPay is the long-dormant HTTP 402 Payment Required status code. We bring it to life with x402, a spec that lets servers respond with pricing metadata. When a client (human or AI) gets a 402, they pay in stablecoins (like USDC or EUROe) and instantly retry the request. No account creation. No web forms. No checkout.Plus MCPs! We are bringing payments rails for MCP servers.
Solution
MCPay.funsimplifies and modernizes API monetization by replacing traditional subscriptions with straightforward pay-per-use. It breathes life into the long-dormantHTTP 402 Payment Requiredstatus using the emergingx402 protocol, enabling seamless, machine-readable payments—perfect for LLMs, scripts, or any client that can speak HTTP.Core Philosophy — HTTP 402 for Native Web PaymentsRespond with 402, not OAuthAn API simply replies withHTTP 402plus pricing details rather than forcing a Stripe checkout or token exchange.Instant, on-the-fly settlementThe client pays (typically in a stablecoin such asUSDC) and transparently retries the request.Optimized for microtransactions & M2MZero‐UX, machine-friendly flow lets services bill fractions of a cent without friction.The x402 Flow (Step-by-Step)Client request→ APIAPI (orMCPay Proxy) replies402 Payment Requiredwith{ price, currency, destination }.js-sdkintercepts the 402, signs & broadcasts payment (e.g., send 0.01 USDC onBase).On-chainconfirmation→js-sdkretriesoriginal request, adding proof (tx hash / signed msg).Proxy/APIverifiespayment → processes request → returns data.Usage & revenue events stream to dashboards/analytics (optional).Partner Tech & Why It Mattersx402 Protocol– open, vendor-neutral spec for native web payments.Layer-2 networks (e.g., Base)– low fees make micropayments practical.Stablecoins (USDC)– stable unit of account; shields users from crypto volatility.Viem– modern TypeScript EVM library powering wallet & transaction logic in the SDK.Notable “Hacks”Reanimating HTTP 402– repurposes a forgotten status code to solve API billing elegantly.CLI Proxy Adapter– one-command wrapper adds pay-per-use toanyAPI, no code changes.Invisible Payment Loop– SDK auto-handles 402 → pay → retry, so devs integrate once and forget.Architecture HighlightsModular monorepowith shared TypeScript types across frontend, backend, and SDK.Edge-friendly: the CLI proxy can run at the network edge for minimal latency.Developer-centric: straightforward CLI, typed SDK, and real-world examples to copy-paste.
Hackathon
ETHGlobal Prague
2025
Prizes
- 🏆
Big Blockscout Explorer Pool Prize
Blockscout
- 🏆
🏆 ETHGlobal Prague 2025 Finalist
ETHGlobal
Contributors
- microchipgnu
391 contributions
- marcelokunze
85 contributions