PayGate MCP — Monetization Gateway for AI Agents

io.github.geoacpfilho由 GitHub 帳號 geoacpfilho 發布v0.3.1更新於 Oct 24, 2026

Monetize any MCP server: x402 paywall, pay-per-call billing in USDC on Base, agent marketplace.

已驗證Streamable HTTP可網頁執行金融開發者工具商業與電商

概覽

AI 產生的概覽

遠端 MCP 閘道,讓助理探索付費工具、註冊並定價自己的 MCP 伺服器,並查看 Base 上 USDC 按次付費的收益

可以做什麼
免費瀏覽市場上的付費工具與 API,包含每次呼叫價格和呼叫端點。註冊要販售的 MCP 伺服器,自動匯入其工具並回傳代理 URL 和私密 api_key。調整或下架工具價格,檢視目前上架資訊、收款地址和佣金比例。依工具回報付費呼叫次數、總收入、佣金和淨收入。在網域指定路徑發布權杖以驗證伺服器所有權。
適用情境
當助理缺少某項能力且使用者願意按次以 USDC 付費時使用;或當使用者想販售、調價、查看自己 MCP 伺服器的收入而不想撰寫付款程式碼時使用。
執行需求
遠端 streamable HTTP 端點,無需本機安裝。買家需要持有 Base 上 USDC 的錢包(無需 ETH 付 gas),並簽署 EIP-3009 轉帳授權。賣家在定價、上架和收益工具中需要 register_server 回傳的 api_key,並需一個網域託管驗證權杖。
安裝前請注意
呼叫付費工具會在 Base 主網花費真實 USDC 並鏈上結算,工具執行前先驗證付款。註冊回傳的 api_key 是控制定價和上架資訊的機密。註冊會暴露代理 URL 和收款錢包地址,驗證需在使用者網域上發布權杖。README 的參考用戶端要求 PRIVATE_KEY 環境變數,等於授予該錢包的花費權限。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 PayGate MCP — Monetization Gateway for AI Agents,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。

交給代理程式安裝

把這段提示詞貼上到 Claude Code、Codex、Cursor 等代理程式,或 SourceWeft 對話中。代理程式會讀取該伺服器的安裝指南,先向你展示發布者、端點和登入方式,經你同意後再把它新增到你的客戶端。金鑰不會寫進任何命令。

閱讀 https://sourceweft.com/mcp/io.github.geoacpfilho%2Fpaygate-monetize-monetization-x402/install.md,並按其中說明把這個 MCP 伺服器接入我的客戶端。修改任何設定之前,先告訴我它的發布者、端點和登入方式,等我確認。不要把 API 金鑰寫進命令或我會提交的檔案;問我金鑰應從哪裡取得。

檢視代理程式所依據的安裝指南

其他 MCP 客戶端

把它新增到你客戶端的 mcpServers 設定中。

{
  "mcpServers": {
    "paygate-monetization-gateway-for-ai-agen": {
      "type": "http",
      "url": "https://paygate-mcp.rendercriativo.workers.dev/mcp"
    }
  }
}

README

PayGate MCP

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

[x402] [network] [license]

What it does

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.

agent ──tools/call──▶ PayGate ──▶ 402 challenge (price, asset, payTo)agent ──signed payload──▶ PayGate ──verify──▶ facilitator                          PayGate ──▶ developer's MCP server ──▶ result                          PayGate ──settle──▶ facilitator ──▶ USDC on Baseagent ◀── result + settlement receipt

Payment is verified before the tool runs and settled after it returns. If the tool fails or returns an error, nothing is charged.

For agents

Discovery is free. Ask PayGate what is for sale:

bash
curl -X POST https://paygate-mcp.rendercriativo.workers.dev/mcp \  -H 'Content-Type: application/json' \  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call",       "params":{"name":"list_registered_servers","arguments":{}}}'

Calling a monetized tool without payment returns a spec-compliant challenge — a tool result with isError: true whose structuredContent holds the PaymentRequired object:

jsonc
{  "x402Version": 2,  "error": "Payment required: calculate_fator_r custa $0.02 USDC.",  "resource": { "url": "mcp://tool/calculate_fator_r", "mimeType": "application/json" },  "accepts": [{    "scheme": "exact",    "network": "eip155:8453",    "amount": "20000",                                     // 6-decimal USDC units    "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",    "payTo": "0x82e3...999e",    "maxTimeoutSeconds": 120,    "extra": { "name": "USD Coin", "version": "2" }        // EIP-712 domain  }]}

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:

bash
PRIVATE_KEY=0x... node 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.

For sellers

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:

ToolWhat it does
register_serverLists your server. Its tools are imported automatically; you get a proxy URL and a secret api_key.
verify_ownershipServe 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_priceReprice a tool or take it off the market.
get_earnings / get_my_listingRevenue 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:

bash
curl -X POST https://paygate-mcp.rendercriativo.workers.dev/api/register \  -H 'Content-Type: application/json' \  -d '{"name":"Your Service",       "target_server_url":"https://your-mcp-server.example.com/mcp",       "wallet_address":"0xYourWallet"}'

Health and diagnostics

GET /health/x402 reports whether the payment rail is actually able to charge:

json
{  "network": "eip155:8453",  "facilitator": { "url": "...", "reachable": true, "authenticated": true },  "ready_to_charge": true,  "diagnosis": "Pronto para cobrar."}

Configuration

Runtime values live in wrangler.jsonc (vars) and Cloudflare secrets.

VariablePurpose
X402_NETWORKCAIP-2 network. eip155:8453 (Base mainnet, default) or eip155:84532 (Sepolia).
X402_FACILITATOR_URLFacilitator base URL, no /verify suffix. Defaults per network.
PAYGATE_WALLET_ADDRESSWallet that receives payments.
CONTACT_EMAILOptional; omitted from the UCP manifest when empty.
CDP_API_KEY_ID / CDP_API_KEY_SECRETCoinbase CDP credentials. Required for mainnet — it is the only facilitator that settles on Base.
UPSTREAM_AUTH_TOKENToken forwarded to the developer's MCP server.
STRIPE_SECRET_KEYOptional, 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.

Layout

src/├── index.ts                 routes, health, discovery documents├── x402/│   ├── config.ts            network registry (CAIP-2, USDC assets, EIP-712 domains)│   ├── protocol.ts          v2 structures, MCP + HTTP transport bindings│   └── facilitator.ts       /verify and /settle, CDP JWT auth (EdDSA and ES256)├── api/│   ├── proxy.ts             the paid path: challenge → verify → execute → settle│   ├── mcp-server.ts        PayGate's own MCP server│   ├── paygate-tools.ts     marketplace tools: register, verify, price, earnings│   ├── llms-txt.ts          /llms.txt for AI systems arriving over the web│   ├── register.ts          developer onboarding│   ├── dev-management.ts    profile, pricing, earnings│   └── discovery.ts         server card and UCP manifest└── db/schema.ts             developers, tools, transactions, payment proofs

Development

bash
npm installnpx wrangler dev      # localnpx wrangler deploy   # production

Built on Cloudflare Workers, Hono, and D1.

License

MIT

來源:README.md,提交 67333b0

工具

6

list_registered_servers

Find a paid tool that does something you cannot do yourself. Use when the user needs a capability you lack and is willing to pay per use, or asks what paid tools, APIs or data sources are available. Returns every tool on the market with its price per call in USD and the endpoint to call it. Browsing is free and needs no key.

輸入參數searchmax_price_usdverified_only

register_server

Start charging for an MCP server the user owns. Use when they want to monetize, sell, charge for, get paid for, put a price on, or make money from a server, API or tool. Buyers pay their wallet DIRECTLY on-chain — PayGate never holds the money, so there is no payout to wait for, no balance to withdraw and no commission taken. Their server is never modified and needs no payment code. Tools are imported automatically, so it must be publicly reachable over HTTPS and answer tools/list. Returns a proxy URL and a secret api_key shown only once; save it, every other seller tool needs it.

輸入參數name必填emailwallet_addressdefault_price_usdstripe_account_idtarget_server_url必填

set_tool_price

Reprice or unlist something the user already sells. Use when they want to raise, lower or change a price, make a tool free, pause selling it, or take it off the market. Requires the api_key from register_server.

輸入參數api_keyis_activeprice_usdtool_name必填

get_earnings

Report how much the user has earned selling their tools. Use when they ask about sales, revenue, income, how much they made, how many calls were paid, or which tool sells best. Returns paid calls, gross revenue, commission and net revenue, broken down per tool. Requires the api_key from register_server.

輸入參數api_key

get_my_listing

Review what the user currently has for sale. Use when they ask what they are selling, what their prices are, where their money goes, or want to check their listing before changing it. Returns the proxy URL, payout destination, commission rate and every listed tool with its price. Requires the api_key from register_server.

輸入參數api_key

verify_ownership

Prove the user owns the server they listed, earning a trusted badge in the marketplace. Use after they have published their verification token at /.well-known/paygate-verify on the server's domain. PayGate fetches that URL and confirms the token matches. Verified sellers can be filtered for by buyers, so this directly increases how often their tools get chosen. Requires the api_key from register_server.

輸入參數api_key

版本歷史

1
  1. v0.3.1最新Sep 16, 2026

評分

已滿足適用檢查項的 100%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通必需25 分
  • 已宣告認證方式必需10 分
  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分