PipRail

v0.10.0
io.github.piprail/mcp Checked 1 day ago Published 2 months ago

Budget-bound x402 payment wallet for AI agents — pays HTTP 402 URLs, capped locally.

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

piprail_discover

Find x402 payment-gated resources on the OPEN indexes (a phone book of payable APIs) WITHOUT paying. Use it to answer "what can I buy?" — search by topic, then quote/plan/pay a chosen one. By default returns only resources payable on your wallet's chain (network='self'); pass 'any' for every chain. Results are cross-scheme: ALWAYS call piprail_quote_payment on a chosen resource (it re-checks the live price) before piprail_pay_request.

ParameterTypeDescription
assetstringKeep only resources paying in this token symbol, e.g. 'USDC'.
categorystringKeep ONLY this category, e.g. 'ai', 'finance', 'data' (strict).
limitnumberMax results to fetch per index (default 20).
maxPricenumberDrop results advertised above this USD price.
minReliabilitynumberDrop results below this health score (0–100); unscored pass.
networkstringCAIP-2 id, 'self' (your chain — default), or 'any' (all chains).
querystringFree-text topic to search for (optional). Multi-word queries are fanned out per word and results are ranked by relevance, so "crypto price feed" finds the best matches even when no single listing cont…
sortstringOrdering. Default 'relevance' with a query, else first-seen.
verifiedbooleanPrefer verified listings (402 Index).

piprail_quote_payment

Get the price of an x402 payment-gated URL WITHOUT paying. Returns the amount, token, chain, recipient, and whether it is within the spend policy. Returns { gated: false } when the URL needs no payment. Call this first to decide whether a resource is worth buying.

ParameterTypeDescription
url *stringFull URL of the gated resource.

piprail_plan_payment

Check whether you CAN pay an x402-gated URL before paying. Reads your wallet balance, native gas, and whether the recipient can receive — across every rail the URL offers on your chain — and returns { gated, payable, best, options, fundingHint }. payable:false means do NOT attempt the payment; fundingHint says exactly what to top up. Call this before piprail_pay_request so you never commit to a payment you cannot finish. Returns { gated: false } when no payment is needed.

ParameterTypeDescription
url *stringFull URL of the gated resource.

piprail_pay_request

Fetch an x402 payment-gated URL, automatically making the required payment if needed (subject to the spend policy + approval hook). Pays whichever rail the client is configured for — PipRail's backendless on-chain rail, or, when enabled, the standard `exact` rail (where the buyer signs and the server settles, so no buyer gas). Returns the HTTP status, the response body, and a payment receipt if one settled. If the payment is refused by policy or the approval hook, returns { declined: true, reason } — no funds moved.

ParameterTypeDescription
url *stringFull URL to fetch.
bodyobject | stringOptional request body for POST/PUT (a JSON object or a string).
methodstringHTTP method, default 'GET'.

piprail_register

List an x402 payment-gated resource YOU run on the open indexes so other agents can discover it. Default target is 402 Index — no auth, no signature, no payment; a self-registered listing is pending review (verify your domain on 402index.io for instant approval). Returns one outcome per index ({ source, ok, detail, visibility, note }); a step the chain can't satisfy comes back ok:false with the reason. Moves no funds; nothing is PipRail-hosted. NOTE: index/agent payers are overwhelmingly standard `exact` clients — a default onchain-proof-only gate gets listed but they cannot pay it, so add…

ParameterTypeDescription
url *stringFull URL of the resource to list.
assetstringPayment asset symbol, e.g. 'USDC' (metadata).
categorystringA category, e.g. 'ai', 'finance', 'data' — the top findability field (most listings have none).
contactEmailstringContact email for the listing.
descriptionstringWhat the resource offers. Pack the words agents will search for INTO this text — index search is literal, so a keyword that isn't in the name/description won't be found.
namestringDisplay name (defaults to the host).
networkstringNetwork slug to advertise, e.g. 'base' (defaults to the paying chain). Set it when registering from a multi-chain wallet so the listing names the right chain.
priceUsdnumberAdvertised price in USD (metadata).
providerstringWho runs the resource (provider/org name).
tagsarrayKeywords; folded into the description so they're searchable.

piprail_budget

Read how much of your spend budget and time leash is left — per (network, asset) remaining, the cross-token GRAND TOTAL per denomination (e.g. how much USD you can still spend across every stablecoin and chain), the payment-count leash, the session time envelope, and your spend so far. Use it in Mode A (headless) to self-check BEFORE paying, so you never discover the leash by hitting a decline. Read-only; moves no funds. NOTE: the time envelope is in-memory for THIS process; the money/count totals persist only if a spend store is configured.

piprail_guide

Read the PipRail agent contract — the quote → plan → pay loop, how to read a refusal (and which declines are TERMINAL), the never-re-pay rule for broadcast-but-unconfirmed payments, and Mode A (headless) vs Mode B (supervised). Read-only; call it once if unsure how to use these tools.

piprail_verify_receipt

Re-verify a PipRail VERIFIABLE RECEIPT against the chain — confirm a payment REALLY settled (the funds provably moved to payTo for AT LEAST the stated amount) WITHOUT trusting whoever handed you the receipt. Read-only and WALLET-FREE: pass the PipRailReceipt JSON (from a prior piprail_pay_request `verifiableReceipt`, or any third party). Returns { ok, onChain:{payTo,asset,amount,payer}, matchesClaims, ageSeconds, error? }: `ok` = the chain confirms the settlement; `onChain.payer` is RE-DERIVED from the tx and `matchesClaims:false` means the receipt forged the payer; `amount` is a verified lo…

ParameterTypeDescription
receipt *objectThe PipRailReceipt JSON ({ piprail, receipt, resource, decimals? }) to re-verify.
rpcUrlstringOptional RPC URL for the receipt's chain (required for chains outside the common presets).