
X402 Payagent Mcp
io.github.stevemilton由 GitHub 帳號 stevemilton 發布v4.1.0更新於 Oct 24, 2026
Pay x402 APIs in USDC on Base, Solana, and BNB Chain with spend mandates, receipts, idempotency.
概覽
讓助理在 Base、Solana 和 BNB Chain 上以 USDC 支付 x402 付費 API,並支援支出限額、收據與冪等性。
- 可以做什麼
- 封裝 payagent SDK 以呼叫 x402 付費 API:discover 依意圖和預算搜尋付費 API 目錄,inspect 在不付款的情況下讀取某個 URL 的價格與付款要求,pay 執行從請求到 402、再到結算的完整流程並回傳結構化收據。balance 與 history 報告目前身分、儲值地址、鏈上 USDC 餘額、限額以及近期付款。check_payment_signal 可購買關於某個 x402 資源的簽章探測證據。僅當設定 PAYAGENT_MCP_PROFILE=admin 時才載入錢包管理工具。
- 適用情境
- 當助理需要呼叫按次收費的 x402 API,並希望獲得支出限額、收據和冪等重試,而不是手動處理付款時使用。它適合需要在購買前查看價格、並保留付款紀錄的代理。它不適用於免費 API,也不適用於 v4 中已移除的法幣儲值和平台終端使用者功能。
- 執行需求
- 透過 npx 或 npm(@arispay/payagent-mcp)以 stdio 在本機執行,僅支援桌面 MCP 用戶端。啟動不需要任何環境變數。可選密鑰:PAYAGENT_PRIVATE_KEY 用於本機自託管簽署,或 ARISPAY_API_KEY(通常由 setup 自行開通)。可選 ARISPAY_URL 與 PAYAGENT_MCP_PROFILE=admin。付款需要已儲值的 USDC 錢包和網路存取。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 X402 Payagent Mcp,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
@arispay/payagent-mcp
One coherent USDC payment product for AI agents: call x402-paid APIs, with spend mandates, receipts, and idempotency. Works with Claude Desktop, Cursor, Windsurf, or any MCP client. A thin wrapper around the payagent SDK.
Two ways to hold the wallet:
- Local key (zero signup). Set
PAYAGENT_PRIVATE_KEYto a funded EOA key.paysigns EIP-3009 locally — no ArisPay account, no email. The only guardrail is the wallet balance; use a dedicated low-balance wallet. - Delegated custody (managed, recommended).
setup({ email })self-provisions an account, a CDP-managed wallet, and a spend mandate in one call. ArisPay enforces per-transaction, daily, and monthly limits server-side before signing; no private key ever lives in this process.
Tools
Seven core tools (the default surface):
Wallet administration (create_agent, fund_agent, list_agents, rename_agent) loads only when the host config sets PAYAGENT_MCP_PROFILE=admin.
Every tool declares MCP safety annotations (readOnlyHint, destructiveHint, idempotentHint, openWorldHint); pay and check_payment_signal are the only destructive tools — both spend real money.
Support matrix
Notes:
- All prices are quoted by sellers in the 402 challenge;
payprefers an EVM variant and falls back to Solana when the seller offers no EVM option. - Delegated mandates are integer cents, validated server-side before any signature exists. Local mode has no server-side cap.
- Settlement is a single on-chain
transferWithAuthorization(EIP-3009): it succeeds or reverts atomically. When the seller returnsX-PAYMENT-RESPONSE, the receipt carries the settlement transaction hash. - ArisPay's own facilitator (
facilitator.arispay.app) charges no facilitator fee; sellers may use any facilitator, and their fee/finality policy applies.
Setup
Add the server to your MCP client config. No environment variables are required — pick a wallet mode later, from inside the chat, or set one of the env options below.
Claude Desktop
Edit ~/Library/Application Support/Claude/claude_desktop_config.json:
For the zero-signup mode, add the key to the env block:
Cursor
Same server block in .cursor/mcp.json. Windsurf: same pattern in ~/.codeium/windsurf/mcp_config.json.
Cold start, from nothing
- Zero signup: generate a key with
npx payagent wallet new, put it in the host config asPAYAGENT_PRIVATE_KEY, send USDC on Base to the printed address.balanceshows the deposit address;paypays. - Managed: ask the agent to run
setup({ email: "[email protected]" })— it returns the wallet address and mandate. Fund the wallet with USDC, confirm withbalance, thenpay. Credentials persist to~/.payagent/config.jsonand are shared with thepayagentCLI.
Environment variables (all optional)
Migrating from v3
v4 is a breaking release: the surface collapsed to one x402/USDC product.
Receipts and idempotency
pay requires a caller-chosen idempotencyKey (min 8 chars — use a UUID). Every completed payment writes a machine-readable receipt (amount, asset, network, wallet, settlement tx, remaining mandate) to ~/.payagent/mcp-receipts.json. Re-calling pay with a key that already paid returns the stored receipt and does not pay again — including when the paid request failed mid-flight. history lists receipts in self-custody mode; delegated mode reads the authoritative server feed.
How it works
- The agent calls
paywith a URL and anidempotencyKey; the seller answers HTTP 402 with its price. - With
PAYAGENT_PRIVATE_KEYset,payagentsigns the EIP-3009 authorization locally. Otherwise ArisPay validates the request against the agent's mandate and signs via Coinbase CDP. payagentretries with the signed payment header; the seller's facilitator settles USDC on-chain.- The tool returns the paid response plus a structured receipt.
In delegated mode, no private key lives in this process and payments that breach the mandate are rejected before any on-chain action. In local mode, the key is yours and stays in your process.
Install
Or invoke directly via npx @arispay/payagent-mcp from an MCP client config — no pre-install required. npx buyforme-mcp is the same server under the consumer brand.
Related
- payagent — the SDK + CLI for programmatic use
- facilitator.arispay.app — ArisPay's open x402 facilitator, where paid 402s settle
- x402 protocol — HTTP 402 payment standard
License
MIT
來源:README.md,提交 ba86a72
工具
0版本歷史
1- v4.1.0最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分