MCP.so
Sign In

Piprail

@piprail

About Piprail

Hand any AI agent a budget-capped wallet to pay, discover & register x402 payment-gated URLs across every chain. Local, self-custodial, no backend, no fee.

Config

Add this server to your MCP-compatible client using the configuration below.

{
  "mcpServers": {
    "piprail": {
      "command": "npx",
      "args": [
        "-y",
        "@piprail/mcp"
      ],
      "env": {
        "PIPRAIL_PRIVATE_KEY": "<YOUR_WALLET_KEY>",
        "PIPRAIL_CHAIN": "base",
        "PIPRAIL_MAX_AMOUNT": "0.10",
        "PIPRAIL_MAX_TOTAL": "10.00",
        "PIPRAIL_TOKENS": "USDC"
      }
    }
  }
}

Tools

8

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.

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.

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.

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.

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 an `exact` rail (and set the gate's `discovery` option, required for x402scan) to be usefully discoverable AND payable.

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.

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.

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 lower bound. Pass `rpcUrl` for a chain outside the common presets.

Overview

What is Piprail?

Piprail is an MCP server that provides any AI agent (Claude Desktop, Cursor, Claude Code, Windsurf, VS Code, Cline) with a budget-capped wallet to autonomously pay x402 ("402 Payment Required") payment-gated URLs. It runs locally with your wallet and a spend policy the model cannot exceed — no backend, no custody, no facilitator, no fee.

How to use Piprail?

Run npx -y @piprail/mcp, add the config block (set your wallet key and spend caps via environment variables like PIPRAIL_MAX_AMOUNT, PIPRAIL_MAX_TOTAL, PIPRAIL_TOKENS, PIPRAIL_HOSTS, and PIPRAIL_CHAIN), then restart your client. The server exposes five tools for discovering, quoting, planning, paying, and registering x402 endpoints.

Key features of Piprail

  • Five tools for the full x402 payment lifecycle.
  • Budget-capped wallet enforced before any on-chain send.
  • Supports every major EVM chain plus Solana, TON, Tron, NEAR, Sui, Aptos, Algorand, Stellar, and XRP Ledger.
  • Works with USDC, USDT, and native coin across chains.
  • Wallet key never leaves your machine — no back end or custody.
  • Runs locally with no facilitator and no additional fee.

Use cases of Piprail

  • AI agents autonomously paying for APIs within a strict budget.
  • Discovering which x402-enabled endpoints are available (

Comments

More Other MCP servers