
x402 Seller
io.github.entreprisedaney33-rgb由 GitHub 帳號 entreprisedaney33-rgb 發布v0.1.1更新於 Oct 25, 2026
Pay-per-call MCP tools (crypto/DeFi data, web reading, AI tasks) in USDC over x402 on Base.
概覽
一個 MCP 伺服器,把遠端 x402 按次付費 API(加密/DeFi 資料、網頁讀取、AI 任務)暴露為工具,以 Base 上的 USDC 付款或僅說明付款要求。
- 可以做什麼
- 將相容 x402 來源站的付費端點當作工具呼叫,工具在啟動時依其探索文件產生,每個端點一個工具(例如 gas 價格或網頁讀取)。在僅說明模式下,回傳對 402 付款要求的白話說明(價格、網路、如何啟用付款),而不回傳資料。設定錢包後,每次呼叫自動以 Base 上的 USDC 付款,並回傳真實結果與結算收據(付款地址、交易雜湊)。可將伺服器指向其他相容 x402 的來源站。
- 適用情境
- 當你希望助理存取按次付費的 x402 API,取得加密/DeFi 資料、鏈上讀取、網頁讀取或 AI 文字任務,且願意按次支付少量 USDC 費用時使用。僅說明模式適合先安全地檢視可用端點與價格。
- 執行需求
- 透過 npx 以 stdio 在本機執行(需要 Node.js)。需要能連線至 x402 來源站的網路。選用 BUYER_PRIVATE_KEY(EVM 私鑰)以啟用自動付款;未設定則為僅說明模式。選用 X402_ORIGIN 指定要暴露的 x402 相容伺服器(預設為提供者託管的來源站)。付費呼叫需要 Base 上有 USDC 餘額。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 x402 Seller,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
x402-seller-mcp
An MCP server that turns every paid endpoint of x402-seller — crypto prices, DeFi data, on-chain reads, web reading, Claude-powered text tasks — into a tool your agent (Claude Desktop, Cursor, or any MCP client) can call.
Tools are generated at startup from the server's own
/.well-known/x402.json
discovery document — not hand-listed — so the tool list always matches what's actually
live on the origin.
Two modes
- No wallet configured (default) — calling a tool fetches the endpoint, gets back
the real
402 Payment Requiredchallenge, and returns a plain-language explanation (price, network, how to enable payment) instead of the actual data. Safe to try with zero setup. - Wallet configured (
BUYER_PRIVATE_KEYset) — calls are paid automatically over x402 (via@x402/fetch) and return the real result plus the settlement receipt (payer address, transaction hash).
Install
That's the whole install — nothing to clone, build, or configure to try it in explain-only mode.
Claude Desktop
Add this to your claude_desktop_config.json (Settings → Developer → Edit Config):
To enable automatic payments, add an env block (see Enabling payments below):
Restart Claude Desktop after editing the config.
Cursor
Cursor uses the same mcpServers shape — add the same block to ~/.cursor/mcp.json
(or your project's .cursor/mcp.json), then reload the MCP servers from
Settings → MCP.
Enabling payments
⚠️ Use a throwaway wallet, never a wallet holding significant funds. The private key you set here can sign USDC transfers on Base up to whatever price each tool call costs (all endpoints on this server are priced at $0.005–$0.02 per call) — but any process with the key in its environment can, in principle, use it. Generate a fresh wallet dedicated to this MCP server and fund it with a few dollars of USDC on Base, nothing more.
- Generate a wallet (any EVM wallet works — e.g. with viem:
node -e "const {generatePrivateKey,privateKeyToAccount}=require('viem/accounts');const k=generatePrivateKey();console.log(k, privateKeyToAccount(k).address)", or MetaMask/any wallet app export). - Send a small amount of USDC on Base (the network this server settles on) to that wallet's address — a few dollars covers hundreds of calls at these prices.
- Set
BUYER_PRIVATE_KEYto that wallet's private key (the0x...-prefixed hex string) in your MCP client's config (see examples above) or in your shell environment if running the server directly. - Restart the MCP server (or your MCP client). Tool calls will now pay automatically and return real results.
Configuration
Tools
One tool per paid resource in the origin's discovery document, named
<method>_<path> (e.g. get_api_gas_base, post_api_web_read). Run the server and
call tools/list, or browse
/.well-known/x402.json
directly, for the current full list and per-tool input schemas — deliberately not
duplicated here, since it would drift from the live origin.
Related
For a general-purpose agent that just wants a small set of everyday tools
(fact verification, market data, gas price, quick AI tasks) instead of one
tool per endpoint, see
@dm2233/agent-data-mcp
(npm) — it wraps this same 33-endpoint catalog as 5 grouped tools.
Development
test/manual-test.mjs is a standalone harness that spawns the server exactly like an
MCP client would (via StdioClientTransport) and drives it with the official
Client class — listTools(), then callTool() in both modes. Run it directly with
node test/manual-test.mjs after npm install (it reads BUYER_PRIVATE_KEY from the
parent repo's .env if present, to exercise the paid path too).
License
MIT
來源:mcp/README.md,提交 3754b3d
工具
0版本歷史
1- v0.1.1最新Sep 16, 2026
評分
已滿足適用檢查項的 40%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分
請在儲存庫或註冊中心條目中宣告授權條款。