x402-payagent-mcp

v4.1.0
io.github.stevemilton/x402-payagent-mcp Checked 1 day ago Published 3 months ago

Pay x402 APIs in USDC on Base, Solana, and BNB Chain with spend mandates, receipts, idempotency.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

setup

Creates or recovers an ArisPay account for delegated custody and provisions a USDC payer wallet in one call (side effects: registers the email, creates a Coinbase CDP-managed wallet, writes credentials to ~/.payagent/config.json on this machine). Moves no money — it does NOT spend funds. Idempotent: re-running with the same email recovers the existing account and its wallets. Not needed in self-custody mode: if PAYAGENT_PRIVATE_KEY is set, skip setup entirely — pay works with the local key alone.

ParameterTypeDescription
email *stringEmail to register the account under. It is also the recovery key — use a real address.
namestringHuman name. Falls back to the email local-part.

discover

Searches the ArisPay marketplace for paid APIs by capability or plain-language intent, optionally budget-bounded (integer cents). Read-only — spends no money, needs no API key. Returns ranked candidates with endpoint URL, price in cents, health and verification flags. Select this to FIND an endpoint; then inspect to price a specific URL, then pay to call it.

ParameterTypeDescription
query *stringCapability or plain-language intent, e.g. 'flight search'.
budgetCentsMaxintegerMaximum acceptable price in INTEGER CENTS (500 = $5.00). Free listings always pass.
categorystringOptional category filter (inference, data, media, search, social, infrastructure, trading, other).
limitintegerMax results (default 5, max 20).

inspect

Fetches an x402-protected URL WITHOUT paying and reports its price, asset, network, and payment requirements. Read-only — spends no money, sends no payment header, needs no API key or account. Always safe. Select this before pay to know exactly what a resource costs.

ParameterTypeDescription
url *stringThe URL to inspect. Expected to return HTTP 402 with an x402 challenge.

pay

SPENDS REAL MONEY — on-chain and irreversible. The complete machine payment path: makes the HTTP request, and if the server answers 402, selects the supported asset/network variant (USDC on Base/Ethereum/Polygon; delegated mode also settles Solana and BNB Chain variants), validates policy, pays, retries the request, and returns the response plus a structured machine-readable receipt. Requires an idempotencyKey: re-calling with a key that already paid returns the cached receipt and does NOT pay again. Mode selection: PAYAGENT_PRIVATE_KEY set → signs locally (self-custody; wallet balance is…

ParameterTypeDescription
idempotencyKey *stringCaller-chosen unique key for this payment intent (min 8 chars, e.g. a UUID). Re-calling with a key that already paid returns the cached receipt WITHOUT paying again. Use a fresh key for each new payme…
url *stringThe full URL of the API endpoint to call.
agentstringOptional name of a stored x402 payer agent (delegated mode).
bodystring
headersobject
methodstring

balance

Read-only: shows the active payment identity — the stored ArisPay agent (delegated) or the PAYAGENT_PRIVATE_KEY-derived address (self-custody) — with its USDC deposit address, on-chain balance, and (delegated) spend-mandate limits. Spends no money, never pays. Select this to find where to send USDC, to confirm a deposit landed, or when a payment fails.

ParameterTypeDescription
agentstringOptional name of a locally-stored x402 agent.

history

Read-only: lists recent payments — the server-side activity feed in delegated mode (newest first), or locally recorded receipts in self-custody mode. Spends no money. Select this to reconcile what was paid, retrieve a past receipt, or audit an agent's spending.

ParameterTypeDescription
agentstringOptional stored agent name — limits the feed to that wallet (delegated mode).
limitintegerMax entries (default 10, max 50).

check_payment_signal

SPENDS REAL MONEY — 1¢ (USDC, Base mainnet) per UNCACHED call; a still-valid cached artifact returns WITHOUT spending, and an unknown resource is answered free. Buys ArisPay Signal: recent signed probe evidence about an x402 resource (did a real paid probe settle and deliver?) as an arispay.signal.v1 artifact, verified against the published JWKS. Use it BEFORE a material first payment to an unfamiliar resource, or after cached evidence expires. The decision denominator is CUMULATIVE exposure before the artifact expires — planned spend across all intended calls, or the expected cost of one…

ParameterTypeDescription
resource *stringThe exact absolute HTTPS URL of the x402 resource you are about to pay. Signal evidence is keyed by this exact URL.
agentstringOptional name of a stored x402 payer agent (delegated mode).