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.

概覽

AI 產生的概覽

讓助理在 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 錢包和網路存取。
安裝前請注意
涉及兩個密鑰名稱:ARISPAY_API_KEY 與 PAYAGENT_PRIVATE_KEY。本機模式下私鑰直接簽署付款,唯一限制是錢包餘額,建議使用專用的低餘額錢包。pay 與 check_payment_signal 會花費真實資金(check_payment_signal 每次未快取呼叫花費 1 美分);pay 必須提供 idempotencyKey。憑證會持久化到本機設定檔,並與 payagent CLI 共用。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 X402 Payagent Mcp,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

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_KEY to a funded EOA key. pay signs 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):

ToolWhat it doesMoney
setupCreate or recover an account + payer wallet in one call (delegated mode)moves none
discoverSearch the paid-API catalog by intent + budgetread-only
inspectRead a URL's price and payment requirements without payingread-only
payThe complete machine path: request → 402 → select variant → validate policy → pay → structured receipt. Requires an idempotencyKey; a repeated key returns the cached receipt without paying againspends real money
balanceActive identity, deposit address, on-chain USDC balance, mandate limitsread-only
historyRecent payments — server feed (delegated) or local receipts (self-custody)read-only
check_payment_signalBuy ArisPay Signal: recent signed probe evidence about an x402 resource (did a real paid probe settle and deliver?). A still-valid cached artifact returns without spending; an unknown resource is answered freespends 1¢ per uncached call

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

AssetNetworkLocal key (self-custody)Delegated (managed mandate)
USDCBase (default)✅✅
USDCEthereum, Polygon✅✅
USDCBase Sepolia (testnet)✅✅
USDC (SPL)Solana, Solana devnet❌ (EVM signing only)✅ (live on api.arispay.app since 2026-08-25)
USD1BNB Chain✅✅

Notes:

  • All prices are quoted by sellers in the 402 challenge; pay prefers 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 returns X-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:

json
{  "mcpServers": {    "arispay": {      "command": "npx",      "args": ["-y", "@arispay/payagent-mcp"]    }  }}

For the zero-signup mode, add the key to the env block:

json
      "env": { "PAYAGENT_PRIVATE_KEY": "0x..." }

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 as PAYAGENT_PRIVATE_KEY, send USDC on Base to the printed address. balance shows the deposit address; pay pays.
  • Managed: ask the agent to run setup({ email: "[email protected]" }) — it returns the wallet address and mandate. Fund the wallet with USDC, confirm with balance, then pay. Credentials persist to ~/.payagent/config.json and are shared with the payagent CLI.

Environment variables (all optional)

VariableDescription
PAYAGENT_PRIVATE_KEYFunded EOA key for local self-custody signing (zero-signup mode).
ARISPAY_API_KEYDeveloper key — usually unneeded; setup self-provisions one.
ARISPAY_URLArisPay API base URL. Default https://api.arispay.app.
PAYAGENT_MCP_PROFILEadmin additionally loads the four wallet-administration tools. Default: core (seven tools).
ARISPAY_AGENT_KEY / PAYAGENT_WALLETLegacy single-agent pair for v2.0.x hosts.

Migrating from v3

v4 is a breaking release: the surface collapsed to one x402/USDC product.

v3 toolv4
create_usersetup
pay_apipay (now requires idempotencyKey, returns a structured receipt)
discover_paid_apidiscover
inspect_paid_apiinspect
check_wallet, get_balance_agentbalance
—history (new)
create_agent, fund_agent, list_agents, rename_agentunchanged, behind PAYAGENT_MCP_PROFILE=admin
create_wallet, list_wallets, fund_wallet, get_balance, pay_merchant, create_enduser, attach_card_for_user, set_user_limits, get_user_statusremoved — the fiat funding and platform (end-user) surfaces left the public MCP

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

  1. The agent calls pay with a URL and an idempotencyKey; the seller answers HTTP 402 with its price.
  2. With PAYAGENT_PRIVATE_KEY set, payagent signs the EIP-3009 authorization locally. Otherwise ArisPay validates the request against the agent's mandate and signs via Coinbase CDP.
  3. payagent retries with the signed payment header; the seller's facilitator settles USDC on-chain.
  4. 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

bash
npm install @arispay/payagent-mcp

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

License

MIT

來源:README.md,提交 ba86a72

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v4.1.0最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

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

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分