
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 分
请在仓库或注册中心条目中声明许可证。