Monetize any MCP server: x402 paywall, pay-per-call billing in USDC on Base, agent marketplace.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
Monetization gateway for Model Context Protocol servers. Put any MCP server behind a pay-per-call toll that AI agents can settle autonomously β no signup, no API keys, no human in the loop.
Live endpoint: https://paygate-mcp.rendercriativo.workers.dev/mcp
An agent calls a tool. If the tool is monetized, PayGate answers with an x402 v2 payment challenge instead of the result. The agent signs a USDC transfer authorization, retries, and gets its answer. Settlement happens on Base; the developer never touches payment code.
Payment is verified before the tool runs and settled after it returns. If the tool fails or returns an error, nothing is charged.
Discovery is free. Ask PayGate what is for sale:
Calling a monetized tool without payment returns a spec-compliant challenge β a tool result with isError: true whose structuredContent holds the PaymentRequired object:
Sign an EIP-3009 TransferWithAuthorization using exactly the domain in extra, then retry the call with the payment attached under params._meta["x402/payment"]. The settlement receipt comes back in _meta["x402/payment-response"].
The USDC EIP-712 domain name is
"USD Coin"on Base mainnet and"USDC"on Base Sepolia. Using the wrong one makes every signature fail verification.
A working reference client is in scripts/pay-test.mjs:
The paying wallet needs USDC on Base β but no ETH: gas is covered by the facilitator.
Both x402 transports are supported. HTTP clients can use the base64 PAYMENT-REQUIRED / PAYMENT-SIGNATURE / PAYMENT-RESPONSE headers instead of the MCP _meta binding.
The whole seller lifecycle is exposed as MCP tools, so an agent can run it end to end β tell your assistant to monetize your server and it can do everything below on its own:
| Tool | What it does |
|---|---|
register_server | Lists your server. Its tools are imported automatically; you get a proxy URL and a secret api_key. |
verify_ownership | Serve the token from registration at /.well-known/paygate-verify on your domain and call this to earn a verified badge. Buyers can filter for verified sellers. |
set_tool_price | Reprice a tool or take it off the market. |
get_earnings / get_my_listing | Revenue report and current listing. |
Buyers pay your wallet directly on-chain. PayGate never holds your funds β there is no payout to wait for, no balance to withdraw, and no commission on direct payments. Your server is never modified: PayGate forwards initialize, tools/list, resources/list and prompts/list for free and charges only on tools/call.
The same operations exist as REST (POST /api/register, PUT /api/me/tools, GET /api/me/earnings) if you prefer curl:
GET /health/x402 reports whether the payment rail is actually able to charge:
Runtime values live in wrangler.jsonc (vars) and Cloudflare secrets.
| Variable | Purpose |
|---|---|
X402_NETWORK | CAIP-2 network. eip155:8453 (Base mainnet, default) or eip155:84532 (Sepolia). |
X402_FACILITATOR_URL | Facilitator base URL, no /verify suffix. Defaults per network. |
PAYGATE_WALLET_ADDRESS | Wallet that receives payments. |
CONTACT_EMAIL | Optional; omitted from the UCP manifest when empty. |
CDP_API_KEY_ID / CDP_API_KEY_SECRET | Coinbase CDP credentials. Required for mainnet β it is the only facilitator that settles on Base. |
UPSTREAM_AUTH_TOKEN | Token forwarded to the developer's MCP server. |
STRIPE_SECRET_KEY | Optional, for the Stripe path on tools priced β₯ $0.50. |
Base Sepolia needs no credentials: the public facilitator at https://x402.org/facilitator settles testnet USDC for free β the cheapest way to try the whole flow.
Built on Cloudflare Workers, Hono, and D1.
MIT
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/paygate-mcp-monetization-gateway-for-ai-agents)<a href="https://allmcps.com/mcp/paygate-mcp-monetization-gateway-for-ai-agents"><img src="https://allmcps.com/api/badge/paygate-mcp-monetization-gateway-for-ai-agents?style=directory" alt="PayGate MCP β Monetization Gateway for AI Agents on AllMCPs" /></a>