
X402 Mcp Server
io.github.Jannis-E由 GitHub 账号 Jannis-E 发布v1.0.5更新于 Oct 24, 2026
Pay-per-call x402 tools on Base: web extract/render, burn-once secret vault, chart, GeoTIFF
概览
一个本地 MCP 服务器,为助手提供 Base 主网上按次付费的工具,每次调用都从你提供的钱包以 USDC 结算。
- 可以做什么
- 抓取公开网址并返回简洁的 Markdown,或在无头 Chromium 中渲染 JavaScript 密集型单页应用并序列化为适合大模型的 Markdown。创建一次性秘密保险库,生成只能领取一次的链接,并附签名证明。根据带标签的标量数据生成确定性的 SVG 柱状图。将 GeoTIFF/COG 影像转码为 PNG 或 WebP,并返回地理参考元数据与源数据统计。
- 适用场景
- 适合希望在助手内完成网页提取、单页应用渲染、一次性秘密分享、图表生成或 GeoTIFF 转换,又不想注册 API 密钥,并愿意从 Base 钱包按次支付少量 USDC 的场景。
- 运行要求
- 通过 npx 在本地运行,需要 Node.js 18 或更高版本。需要一个 Base 主网 EVM 钱包并充值少量真实 USDC,其私钥通过环境变量 BASE_PRIVATE_KEY 设置。需要能访问工具端点和支付结算服务的网络。
安装
在 SourceWeft 中
- 打开 控制台中的 X402 Mcp Server,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
x402-mcp-server
A small, growing catalog of x402-paywalled HTTP tools on Base Mainnet via x402 micro-payments — no API keys, no signup, pay per call in USDC.
This MCP server exposes that catalog as native MCP tools. Every tool call pays for itself automatically: the server POSTs the request, catches the real x402 v2 402 PAYMENT-REQUIRED challenge, signs an EIP-3009 TransferWithAuthorization with viem using a local wallet, and resubmits with the PAYMENT-SIGNATURE header. No human signature prompt at call time — the agent just calls the tool.
Tools
All tools run on Base Mainnet (eip155:8453). Settlement happens server-side through an ordered facilitator chain — Coinbase CDP, then PayAI, then Primer as fallbacks — which changes nothing on your side: you sign the same EIP-3009 authorization either way, and every tool is also listed in the CDP and PayAI x402 Bazaar discovery catalogs. Exact request-body fields for each tool are also discoverable at runtime via <tool-url>/openapi.json.
Quickstart
Add this to your claude_desktop_config.json:
⚠️ Funding warning:
BASE_PRIVATE_KEYmust be a Base Mainnet wallet private key funded with a small amount of real USDC (e.g. $0.50 is enough for dozens of calls at these prices). Every tool call spends real money from this wallet. Do not use a key that holds funds you're not prepared to spend through this server, and never commit this key to source control.
Once configured, restart Claude Desktop and the tools listed above become available to the assistant automatically — no further setup, no dashboard, no API key registration.
How payment works
BASE_PRIVATE_KEY is your own wallet — whoever installs this server sets their own key and pays for their own calls. Each call settles straight to the tool provider's wallet; your key never touches anyone else's funds and no one else's key ever touches yours. To set it up:
- Use (or create) a Base Mainnet EVM wallet you're OK spending small amounts from.
- Fund it with a bit of USDC on Base (e.g. $0.50).
- Export its private key and set it as
BASE_PRIVATE_KEYin your MCP client config, as shown above.
Security
BASE_PRIVATE_KEYnever leaves your machine. It is read once from the local environment and used only to sign EIP-712 typed-data (EIP-3009TransferWithAuthorization) payment authorizations locally withviem.- No raw private key, seed phrase, or signature is ever sent over the network — only the resulting signed authorization, exactly as the x402 protocol requires to settle payment for the specific request being made.
- Payment terms (recipient, amount, network, asset contract, expiry) are read fresh from each live
402challenge returned by the resource server, never trusted from a local cache, so a stale or tampered local catalog can't redirect funds. - Spending ceiling: the live
402challenge is trusted for signing mechanics (domain, nonce window, asset) but never for the amount. Every call checks the challenge's requested amount against this catalog's known price for that tool and refuses to sign anything higher — a hijacked, compromised, or buggy endpoint can't get a blank-check signature just by asking for more. - This package does not phone home, collect telemetry, or store your key anywhere on disk.
Requirements
- Node.js 18+
- A Base Mainnet EVM wallet, funded with a small amount of USDC, whose private key you control
License
MIT
Links
来源:README.md,提交 034ab3a
工具
0版本历史
2- v1.0.5最新Sep 23, 2026
- v1.0.4Sep 22, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分