PipRail
io.github.piprail/mcp · 10 stars · TypeScript · MIT
MCP server Budget-bound x402 payment wallet for AI agents — pays HTTP 402 URLs, capped locally. No backend.
Install
The repo has no one-line install. Follow its README.
Published as
- npm
@piprail/mcpstdio
From the server's entry in the official MCP Registry.
Configuration
| Name | Set as | What it is |
|---|---|---|
PIPRAIL_PRIVATE_KEYOptional · Secret | Env var | Your wallet's private key/seed for the chosen chain. Optional: omit it to run read-only (discover/quote/register/budget/guide); set it to let the agent pay. Stays on your machine; the spend policy caps every payment. |
PIPRAIL_CHAINOptional | Env var | Chain to pay on (default: base). |
PIPRAIL_CHAINSOptional | Env var | Pay across several chains (instead of PIPRAIL_CHAIN): a comma-separated list, e.g. base,polygon,solana. Give each its own PIPRAIL_<CHAIN>_KEY (+ optional PIPRAIL_<CHAIN>_RPC_URL). The agent pays whichever chain a 402 asks for — the first listed that can settle — under one shared budget. |
PIPRAIL_MAX_AMOUNTOptional | Env var | Max spend per single payment, in token units (default: 0.10). |
PIPRAIL_MAX_TOTALOptional | Env var | Lifetime spend cap per token, in token units (default: 10.00). |
PIPRAIL_MAX_TOTAL_DENOMOptional | Env var | Cross-token GRAND TOTAL: one spend cap per denomination across every stablecoin and chain, e.g. USD:20.00,EUR:5.00. Not a price oracle — sums tokens of the same unit, each counted 1:1. Native coins are excluded. |
PIPRAIL_MAX_PAYMENTSOptional | Env var | Lifetime cap on the NUMBER of payments, across every chain + token (e.g. 100). |
PIPRAIL_MAX_PAYMENTS_PER_WINDOWOptional | Env var | Cap on the number of payments within PIPRAIL_WINDOW_SECONDS (a rolling rate limit; set PIPRAIL_WINDOW_SECONDS too). |
PIPRAIL_WARN_AT_FRACTIONOptional | Env var | Emit an early-warning event when spend crosses this fraction of any cap, e.g. 0.8 (80%). Needs PIPRAIL_EVENT_LOG to be visible. |
PIPRAIL_SPEND_LOGOptional | Env var | Path to a local append-only spend log. When set, the budget (lifetime, grand total, counts) SURVIVES a restart — hydrated from this file. No backend; you own the file. |
PIPRAIL_EVENT_LOGOptional | Env var | Mirror payment events (settled / declined / budget-threshold) as one-line JSON to 'stderr' or a file path — the operator's notification stream. Default: off. |
PIPRAIL_TOKENSOptional | Env var | Comma-separated allowed token symbols, plus the alias 'native' for the chain's coin (default: USDC). |
PIPRAIL_SCHEMESOptional | Env var | Comma-separated payment schemes to settle (default: onchain-proof). Add 'exact' (onchain-proof,exact) to also pay standard x402 servers GASLESS on EVM + Solana (method auto-selected). Add 'upto' to also pay metered x402 servers on EVM (Permit2): sign a MAX, the server settles the actual <= max. |
Files
@piprail/mcp
Hand any AI agent a budget-bound payment wallet. An MCP server wrapping @piprail/sdk so any MCP client — Claude Desktop, Cursor, Claude Code, Windsurf, VS Code, Cline, OpenClaw, Hermes — can pay x402 URLs on its own, capped by a spend policy the model cannot exceed. Runs locally with your wallet and your limits — no backend, no custody, no facilitator.
npx -y @piprail/mcp # speaks MCP over stdio
📖 Full documentation → docs.piprail.com/mcp
The docs are the single source of truth — every client's config, the complete env-var reference, the modes, per-chain setup, and the tools reference. This README is just the front door.
Add it to your client
Two things: your wallet private key and (optionally) a budget. The defaults are deliberately small and safe (0.10 per payment, 10.00 lifetime per token, USDC on Base).
{ "mcpServers": { "piprail": {
"command": "npx", "args": ["-y", "@piprail/mcp"],
"env": { "PIPRAIL_PRIVATE_KEY": "0xYOUR_KEY", "PIPRAIL_CHAIN": "base", "PIPRAIL_MAX_AMOUNT": "0.10" }
} } }
Restart the client and the PipRail tools appear (VS Code uses servers, not mcpServers). Never commit your key — keep it in the client's env block. → Per-client setup · Configuration
8 tools — piprail_discover · piprail_quote_payment · piprail_plan_payment · piprail_pay_request · piprail_register · piprail_budget · piprail_guide · piprail_verify_receipt. Only piprail_pay_request moves money; piprail_register writes a listing to an external index; the other six are read-only. → Tools reference
14 tools in sovereign mode. PIPRAIL_MODE=sovereign appends the swap tools, the seller tools (piprail_sell · piprail_collect · piprail_earnings) and piprail_wallet (what it holds, and the address it gets paid at), so the agent owns both halves of its wallet: it can be paid, not only pay. It appends rather than replaces, so the default above is untouched. → Modes
No key? It still runs. Without PIPRAIL_PRIVATE_KEY the server boots in read-only mode — discover, quote, register, budget, and guide all work; only piprail_pay_request (and piprail_plan_payment) ask for a wallet. Add a key when you're ready to actually pay.
Pay across chains? List several chains and give each its own key — the tools then pay whichever chain a 402 asks for (one server, one budget):
"env": {
"PIPRAIL_CHAINS": "base,polygon,solana",
"PIPRAIL_BASE_KEY": "0x…", "PIPRAIL_POLYGON_KEY": "0x…", "PIPRAIL_SOLANA_KEY": "<base58-secret>",
"PIPRAIL_MAX_AMOUNT": "1.00"
}
One EVM key works on every EVM chain; non-EVM families each need their own key (and that family's peer libs). A chain with no key is read-only. → Configuration
Listed in the official MCP registry as io.github.piprail/mcp.
What it will not do by default
There is no swap tool in the default set, and that is deliberate: the spend policy does not govern swaps. Every budget cap here governs paying a merchant, while a swap moves your own funds between denominations, so an agent able to swap could drain a wallet through fees and slippage without tripping a single budget check.
That is a reason to bound the capability, not to pretend it does not exist. PIPRAIL_MODE=sovereign
unlocks it for an operator who says the agent owns this wallet, and requires PIPRAIL_MAX_PER_SWAP
before the server will start, because the payment caps cannot bound a swap. A model can never set
its own mode.
Sovereign also unlocks selling, which needs no ceiling: it takes money rather than spending it, and the receiving side holds no private key at all.
Documentation
| Overview · Getting started | What it is · first run |
| Client setup · Configuration | Per-client config · every env var |
| Tools · Modes | The 8 default tools (14 in sovereign) · headless vs supervised |
| Security · Chains | Why it's safe · per-chain setup |
| Use as a library · FAQ | Embed it · common questions |
Spread the word
Free, open-source, self-custodial — no backend to sell you. If PipRail gave your agent a wallet it can trust, help others find it:
⭐ Star on GitHub · 𝕏 Follow @piprailhq · 🌐 piprail.com · 📖 docs.piprail.com
Docs · PipRail · @piprail/sdk · x402 · Model Context Protocol
MIT · no backend, no fee, ever.
Facts
- Kind
- MCP server
- Repo
- piprail/piprail
- Group
- Uncategorized
- Stars
- 10
- License
- MIT
- Language
- TypeScript
- Last push
- 2026-09-10
- Forks
- 3
- MCP Registry
- io.github.piprail/mcp
- Homepage
- piprail.com
- Topics
- agent-payments, ai-agents, crypto-payments, evm, payments, sdk, solana, stablecoin, typescript, usdc, web3, x402, micropayments, usdt, agentic-commerce, mcp, model-context-protocol, api-monetization, blockchain, pay-per-call
Next on this shelf
- 6509osc-bridgeio.github.roomi-fields/osc-bridgeOSC ↔ MIDI bridge for synthesizers and DAWs, with the SynthHub catalogue. A MIDI MCP and OSC MCP.10
- 6510Semlithio.github.semlith/semlithLocal search over your code and documents for AI agents.10
- 6511iLangai.ilang/mcpiLang runtime for any AI: load the protocol, validate iLang text, look up verbs, SOUL, Source Book.10
- 6512diglinedev.digline/digline-mcpRead, measure and explain LLM eval runs of a digline suite. Cannot promote a baseline.10
- 6513NYC Charter, Laws and Rulesio.github.BetaNYC/nyc-charter-laws-rulesSearch and read the NYC Charter, Administrative Code and Rules of the City of New York10
- 6514io.github.ClawCall-Dev/clawcallio.github.ClawCall-Dev/clawcallReal US phone calls for AI agents: navigates phone menus, waits on hold, returns transcripts.10