
X402 Payagent Mcp
io.github.stevemiltonPublished by GitHub account stevemiltonv4.1.0Updated Oct 24, 2026
Pay x402 APIs in USDC on Base, Solana, and BNB Chain with spend mandates, receipts, idempotency.
Overview
Lets an assistant pay x402-paid APIs in USDC on Base, Solana, and BNB Chain, with spend mandates, receipts, and idempotency.
- What you can do
- Wraps the payagent SDK to call x402-paid APIs: discover searches the paid-API catalog by intent and budget, inspect reads a URL's price and payment requirements without paying, and pay runs the full request-to-402-to-settlement path and returns a structured receipt. balance and history report the active identity, deposit address, on-chain USDC balance, mandate limits, and recent payments. check_payment_signal buys signed probe evidence about an x402 resource. Admin wallet tools load only when PAYAGENT_MCP_PROFILE=admin.
- When to use it
- Use it when an assistant needs to call APIs that charge per request over the x402 protocol and you want spending limits, receipts, and idempotent retries rather than manual payment handling. It suits agents that must inspect prices before buying or keep a record of what was paid. It is not for free APIs or for fiat funding and platform end-user surfaces, which were removed in v4.
- Requirements
- Runs locally over stdio via npx or npm (@arispay/payagent-mcp); desktop MCP clients only. No environment variables are required to start. Optional secrets: PAYAGENT_PRIVATE_KEY for local self-custody signing, or ARISPAY_API_KEY (usually self-provisioned by setup). Optional ARISPAY_URL and PAYAGENT_MCP_PROFILE=admin. A funded USDC wallet and network access are needed to pay.
Installation
In SourceWeft
- Open X402 Payagent Mcp in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
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
Source: README.md at commit ba86a72
Tools
0Version history
1- v4.1.0LatestSep 16, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts