Listed from the MCP registry; nobody on Odel publishes it.
x402 payment safety: judge a payment against your policy before signing. Read-only, never signs.
Runs on your machine from its package; the steps are below.
At most: moves money, runs code or commands, deletes data, or sends messages for you.
Odel charges nothing per call. The publisher may charge for its own service.
Runs locally over stdio
This server isn't hosted — your MCP client launches it from a package registry. Use one of the commands below, or drop the config into your client (e.g. Claude Desktop).
Run
npx -y @paystage/x402-guard
MCP client config
{
"mcpServers": {
"paystage-x402-guard-payment-safety-before-the-wallet-signs": {
"command": "npx",
"args": [
"-y",
"@paystage/x402-guard"
]
}
}
}Built for agents that spend on your behalf — Claude Duet, OpenAI Dots, Meta Muse, Grok Bot, and whatever ships next. The agent is the caller and the payer; the person is the operator who sets the policy. Compatibility is by protocol (MCP and x402), not by partnership: nothing here implies we are embedded in those products, and the surfaces we are actually in are graded row by row in the integration table.
The canary date is the day the scheduled release run last published @paystage/mcp@canary — the workflow rewrites badges/canary.json after a successful canary publish,
so a missed or failed run leaves the old date standing rather than a fresh-looking one. It links the scheduled runs
where that publish happened. Sources for every non-static badge: Badge sources.
Your agent's wallet should not sign because a server asked it to.
PayStage sits between an agent and the x402 payment it is about to make, and answers one
question before the signature exists: should this payment happen? Every tool returns
pay, review, or do_not_pay, with the rule that fired and a receipt you can keep.
It is a third party to the transaction: no keys, no funds, no listings, not the wallet, not the facilitator and not the seller. That position is the product — a wallet that pays and judges has the same conflict of interest as a seller that verifies its own delivery — and the rest of this file is what makes the claim checkable rather than a slogan.
The gap it fills is narrow and load-bearing. x402 makes paying trivial and leaves deciding
to the caller: a wallet enforces signatures, not intent. @paystage/x402-guard evaluates the
challenge before the wallet signs, so a wrong payee, an over-cap amount or an unknown asset
never reaches the signing step at all.
The design point is the arrow that is missing. The wallet signs only after the challenge has been judged; a refusal returns the seller's own 402 with a verdict header attached, so there is nothing to revoke afterwards.
sequenceDiagram
autonumber
participant A as Agent
participant S as Seller
participant G as PayStage guardFetch
participant W as Wallet
A->>S: request the paid resource
S-->>A: 402 + payment-required challenge
A->>G: the same request, wrapped
G->>G: decode challenge, evaluatePayment(challenge, policy)
alt do_not_pay, or review with onReview refuse
G-->>A: original 402 + x-paystage-verdict
Note over G,W: nothing is signed
else pay, or review with onReview pay
G->>W: x402-fetch stages the payment
W-->>S: signed payment
S-->>G: 200 + resource
G-->>A: 200 + x-paystage-verdict
end
review is reported as review either way. When onReview: "pay" lets an ambiguous payment
through, the header still says review, because the evaluator's finding and the caller's instruction
to tolerate it are different facts — a caller that cannot tell "clean" from "warned but paid" cannot
audit itself. The rule that fires travels in x-paystage-reason-codes.
Default: if the caller passes no onReview, a review verdict pays — this is the tolerance default
rather than the safe one, retained so the evaluator's finding and the caller's policy choice remain
auditable separately.
%% tight ranks: this is read at a glance, not studied
%%{init: {"flowchart": {"nodeSpacing": 26, "rankSpacing": 30}}}%%
flowchart TD
C[402 challenge] --> E["evaluatePayment<br/>guards: agent budget, time window,<br/>x402Version 2, accepts present"]
E --> P{any accept judged pay?}
P -- yes --> PAY[pay, cheapest accept]
P -- no --> R{any accept judged review?}
R -- yes --> REV[review]
R -- no --> DN[do_not_pay]
REV --> O{onReview}
O -- pay --> SIGN[x402-fetch signs, request retries]
O -- refuse --> X[refused, 402 returned unsigned]
PAY --> SIGN
DN --> X
do_not_pay is a real refusal, not a warning: a payee on the known-drainer or OFAC list, an
over-cap amount, a wrong network or asset, a policy that denies the payee, or a challenge that
cannot be parsed. review is the narrow middle — a payee the policy has no opinion about, or a payment over a
step_up threshold; either way the review names the rule, and a step-up lists the principal's non-browser answers
with human approval as the fallback. Both verdicts and the branch logic are in
packages/preflight/src/evaluate.ts; the hook that uses them is
packages/x402-guard/src/index.ts.
Try it without installing anything:
# Copy-paste as-is. A real 12.5 USDC Base challenge against a 5 USDC policy:
curl -s -X POST https://api.paystage.xyz/v1/evaluate_mcp_payment \
-H 'content-type: application/json' \
-d '{"payment_required":{"x402Version":2,"resource":{"url":"https://api.dataquay.xyz/v1/ohlc"},"accepts":[{"scheme":"exact","network":"eip155:8453","amount":"12500000","asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","payTo":"0x6160a0d8a3a1f8b0c4e2d1f7b3a9c6e5d4f23757","maxTimeoutSeconds":300}]},"policy":{"version":1,"max_amount":{"value":"5","asset":"USDC","decimals":6},"allowed_pay_to":["0x209693Bc6afc0C5328bA36FaF03C514EF312287C"],"allowed_assets":[{"symbol":"USDC","decimals":6,"address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"}],"allowed_networks":["eip155:8453"],"max_timeout_seconds":600,"unknown_payee":"deny"}}'
It answers do_not_pay with amount 12.5 USDC exceeds max_amount 5 USDC — a refusal with a reason, in one paste, with nothing elided. The shorter forms below are for reference
only; an example a reader cannot paste is an example that costs them their first attempt.
The hosted endpoint serves a real verdict with no payment and no account for the first 1,000 calls a day — an agent cannot fill in a signup form, so requiring one would exclude exactly the callers this is built for. Beyond that it is $0.002 per call over x402, paid in USDC on Base — 1,001 is 0.002, not a plan, not a seat, and no different from the surrounding calls.
Two caveats, both published rather than implied: the free counter lives in Worker isolate memory, so the
allowance is per instance and scales with instance count instead of being a global per-IP cap
(https://api.paystage.xyz/v1/public/status states it in machine-readable form), and the price is read
from the same constant the Worker charges.
Nine are read-only. None of them signs, holds a key, or moves money — the agent stays the only signer, which is the entire product.
The tenth, request_testnet_funds, is the one deliberate exception and it is worth naming rather than
hiding: it asks our Base Sepolia faucet for 0.5 test USDC so you can exercise the paid path before
spending anything. It moves testnet funds from a wallet we hold, touches nothing you own, and cannot
reach mainnet.
All ten are listed with what each answers in Tools. 语言 / Language: English · 简体中文
npm run build -w @paystage/preflight && node examples/run.mjs
Four challenges against one policy, four verdicts with reasons — no network, no keys. See examples/.
The same evaluator deciding a 402 before anything is signed, with the pay / review / do_not_pay
transcript checked into the repo: docs/demo.md.
A copyable paid seller endpoint — gate first, Bazaar schema, idempotent retries, signed receipt — is one
file: examples/seller/seller.mjs. It is a reference to copy, not a
service we host.
The endpoints that get paid in this ecosystem are cheap, deterministic calls an agent makes in a loop — hashing at 0.001 USDC, embeddings at 0.0005, completions at 0.003. A gate is bought when it sits inside such a loop, so the integration is one line: whatever pays your x402 call, wrap it.
import { guardFetch } from "@paystage/x402-guard";
// Before: const pay = wrapFetchWithPayment(fetch, account);
// After: wrap the same fetch, and every 402 it meets is evaluated first.
const pay = guardFetch(fetch, { walletClient: account, policy });
const res = await pay(url, init);
guardFetch returns a fetch of the same shape, so the loop does not change: it evaluates the 402 the caller was about to sign and passes the response through only when the verdict is
pay. A refusal costs one call and nothing else. The exact options are in
packages/x402-guard/README.md. The paid endpoint is
$0.002 per call, the same order as the calls around it — so the gate is one more line item, not a new procurement.
A refusal costs nothing; a loop that pays a drainer costs every iteration.
# Option 1: run instantly
npx -y -p @paystage/mcp paystage-mcp
# Option 2: install locally, then use the package bin
npm install @paystage/mcp
npx paystage-mcp
The server waits silently for an agent app to connect. That's normal; press Ctrl+C to exit. To try the tools without an app, run npx @modelcontextprotocol/inspector npx -y -p @paystage/mcp paystage-mcp.
@paystage/mcp is the umbrella MCP server (10 tools, including evaluate_hip3_trade and evaluate_velocity). It exposes the PayStage tools over stdio and reads a local policy file. See SECURITY.md for exactly what it accesses and why.
Copy the line for your client. The remote is Streamable HTTP, so nothing needs installing.
# Claude Code
claude mcp add --transport http paystage https://api.paystage.xyz/mcp
# Cursor — append to .cursor/mcp.json
{"mcpServers":{"paystage":{"url":"https://api.paystage.xyz/mcp"}}}
# Any MCP client, or just to read the tool schemas without an account
npx -y mcporter list https://api.paystage.xyz/mcp
Prefer it local? npx -y -p @paystage/mcp paystage-mcp runs the same ten tools over stdio and reads a
policy file from disk.
PayStage is a public good. MIT, no account, no custody, and an evaluator you can read in an afternoon.
The loop that maintains it is agentic. A research agent runs on a schedule, reads what changed in the protocol and the market, and writes proposals; a human decides which become backlog rows; build and test agents implement them, and merged work ships through CI. Counted from this repository on 2026-11-22: 300 merged pull requests, 14 published packages, and 10 MCP tools — each of those three is derived by a script in CI rather than typed here, which is why they are stated at all.
A seatbelt has to move at the speed of the road. The x402 spec, the facilitator landscape and the sanctioned-address list all change without asking us, so the jobs that keep this useful — re-reading a spec, re-checking a list, noticing a facilitator that started rejecting payments — are the jobs agents are best at. The loop runs on a cycle measured in hours; it does not claim to outrun an exploit, and a 24-hour loop would not be that claim.
Who pays, so far. The project runs on a mix of credits and free model access — Google for Startups credits, Cloudflare credits, and
NVIDIA's free tier, which is what the long-running loops execute on. All three are usage, not funding, and none implies an endorsement. The provenance and the boundaries of that statement are in docs/funding.md
in the ops repository; the amount and expiry are not disclosed because they have not been stated anywhere this project can cite.
Sustainability, stated as a condition rather than a promise. The work runs on inference budget and operator time. If paid calls
ever cover the cost, the loop continues on its own; until then it depends on both being available. If neither is, the cycle slows —
written down here because the alternative is implying perpetual motion. The measured numbers behind any cost claim live in
docs/state/ so the claim can be checked rather than believed.
On the shoulders of others. This builds on the work of the people who maintain x402 — the protocol, its facilitators, and the client SDKs whose interfaces we implement — and on the maintainers of the directories and lists that make tools findable. Where we implement a spec we try to cite it; where we get something wrong, the issue is open.
x402 is not owned by a vendor. It is a Linux Foundation project whose Technical Steering Committee lists Coinbase, Cloudflare and Stripe among
its participating organisations (TSC.md, read 2026-11-22). That structure is the
point: a payment rail several companies depend on cannot be judged by whichever one happens to hold the wallet.
Every payment has two roles, and they pull in opposite directions. The payer wants the call to happen; the adjudicator has to be able to say no. A tool that holds the keys and approves the spend cannot credibly answer whether the spend was a good idea — it is the party whose revenue, engagement or convenience depends on the answer being yes. The same reason a seller cannot verify its own delivery applies to a wallet judging its own payment.
So the useful shape is a checker that is a third party to the transaction: it holds no funds, it is not the seller, it is not the wallet, and it produces a record anyone can verify without trusting us. That is what this is, all the way down — MIT, no custody, self-hostable, verdicts carrying the rule that fired, receipts signed with a published key, and the sanctions and drainer lists published so the reasons can be inspected rather than believed.
Governance, sourced. The x402 Foundation was announced for launch in April 2026 and became operational on 14 July 2026, when Coinbase
completed its contribution of the protocol to the Linux Foundation, with 40 member organisations at launch — premier members include Adyen,
AWS, American Express, Circle, Cloudflare, Coinbase, Fiserv, Google, Mastercard, Monad Foundation, MoonPay, Ripple, Shopify, the Solana and Stellar
development foundations, Stripe and Visa. The charter covers "payment types ranging from traditional cards to stablecoins", so the governance was
built for several rails from the outset. PayStage is not a member of that structure; it is an independent checker that benefits from the
neutrality the structure creates. Sources: Linux Foundation press release, 14 July 2026 ·
TSC.md — both read 2026-11-22.
The specification already draws the shape without filling it: the client can refuse before anything is signed — onBeforePaymentCreation, whose hook may
return { abort: true, reason } (x402Client.ts) — and the
record has three defined homes, the offer-and-receipt extension,
payment_identifier and the
bazaar discovery extension. Where a decision can be refused, and where the evidence
lives, are both specified. Who occupies that seat is not — and that is a commercial question, not a standards one.
What the industry is doing about that seat is public, and it is arriving from several directions at once: Google's Agent Payments Protocol (AP2) and Mastercard's Verifiable Intent, co-developed with Google, have both been contributed to the FIDO Alliance for its agentic-payments trust layer (FIDO Alliance, read 2026-11-22), while Visa runs its own agentic-commerce programme (Visa newsroom, 18 November 2026). Different implementations, one question: who is allowed to say a payment should not happen. That plurality is why an independent checker has a place — and why none of them can be assumed to be it.
We are not claiming the protocol requires us. The protocol makes room for an independent adjudicator, and the value of that room grows as more value moves through rails no single company controls.
A gate that claims to stop every bad payment is the thing this project argues against. LIMITS.md is the honest boundary — settlements that already happened, payees that look legitimate and do not deliver, payments made outside the wrapper, and eight more. Read it before you trust the gate with money.
Every term this project uses — x402, facilitator, settlement, EIP-3009, HIP-3, CAIP-2 and the rest — is defined in one page.
State of x402 — issue 1: the registry counted, with its method.
Three states, and every project in this space picked its own three words. If you run more than one of these gates, here is the mapping — the semantics line up more closely than the names suggest.
| PayStage | Meaning | Same intent elsewhere |
|---|---|---|
pay | within policy — sign and send | DingDawg ELIGIBLE · Black_Wall GO · MandatePay authorize |
review | stronger attestation before paying — a step-up the principal can answer without a browser | DingDawg STEP_UP · Black_Wall HOLD · MandatePay challenge |
do_not_pay | refuse — a rule fired, and it is named | DingDawg DENY · Black_Wall STOP · MandatePay deny |
One difference worth knowing: review is a policy instruction, not an oversight. onReview: "pay" treats
it as permission, "refuse" treats it as a block — the gate never decides that for you. A step_up block makes
the instruction specific: the reason names the threshold (step_up.amount, step_up.unknown_payee,
step_up.first_payment) and the result lists the principal's pre-arranged non-browser answers — a pre-signed
allowance, a second key, or a bounded auto-approve. Human approval is the fallback.
How this compares with the four closest things in this lane — including what each has that we do not.
Burn five minutes before your agent pays anything — get the seller's challenge,
write one policy file, ask for a verdict, and keep the receipt. curl and node, nothing to install.
| You want | Use |
|---|---|
| the gate inside an agent's payment loop | @paystage/x402-guard |
| the tools in Claude Desktop or Cursor | @paystage/mcp |
| nothing installed at all — connect to a URL | https://api.paystage.xyz/mcp (Streamable HTTP, listed in the MCP Registry as a remote server) |
| a verdict from your own service, hosting included | POST https://api.paystage.xyz/v1/evaluate_mcp_payment |
| the evaluator as a library | @paystage/preflight |
| the Vercel AI SDK | @paystage/ai-sdk — two read-only tools, docs |
The ?from= token on each link names the listing channel; the API records it on the first call and /lab reports the counts with unknown as its own row.
The same MCP config works for Claude Desktop (claude_desktop_config.json) and Cursor (.cursor/mcp.json).
{
"mcpServers": {
"paystage": {
"command": "npx",
"args": ["-y", "@paystage/mcp"],
"env": {
"PAYSTAGE_POLICY_PATH": "/absolute/path/to/policy.json",
"PAYSTAGE_RPC_URL": "https://mainnet.base.org"
}
}
}
}
{
"mcpServers": {
"paystage": {
"command": "node",
"args": ["./node_modules/@paystage/mcp/dist/cli.js"],
"env": {
"PAYSTAGE_POLICY_PATH": "/absolute/path/to/policy.json",
"PAYSTAGE_RPC_URL": "https://mainnet.base.org"
}
}
}
}
The MCP server itself needs no environment variables and starts with an empty environment. It answers an MCP handshake and lists its tools with nothing configured — the policy arrives as an argument on each call, not as a file path. Verified:
env -i npx -y -p @paystage/mcp paystage-mcp # completes `initialize`, lists ten tools
The two variables below are for the stdio CLI path, where a policy file is convenient. They are optional, and a directory that reads this section as "required configuration" will refuse to start a server that in fact needs nothing:
PAYSTAGE_POLICY_PATH (optional, CLI only): path to a policy.json the CLI reads at startup.PAYSTAGE_RPC_URL (optional): RPC endpoint used by on-chain checks. Defaults to a public Base RPC.Everything PayStage does is decided by one local policy file. Three complete, annotated
examples are in registry/examples/ — copy one, change the
addresses and amounts, and point PAYSTAGE_POLICY_PATH at it. Each is schema-exact for
@paystage/policy and annotated field by field in
registry/examples/README.md.
| tool | what it answers |
|---|---|
evaluate_mcp_payment | should this x402 payment be signed? → pay · review · do_not_pay |
list_outstanding_auths | which ERC-20 / Permit2 / EIP-3009 authorisations are still outstanding |
evaluate_outstanding_auths | which of those need attention before the next payment |
evaluate_hip3_trade | should this HIP-3 / trade.xyz order be placed? → allow · review · do_not_trade |
evaluate_velocity | is this spend a burst, a spike, or a runaway cadence |
verify_receipt | is this receipt really ours — and is it about this payment, still in date |
decode_payment_required | what does this base64 402 header actually say |
validate_policy | is this policy document valid, and if not which field |
request_testnet_funds | 0.5 Base Sepolia USDC for testing — one drip per address per 24h, with the reset time |
evaluate_batch | the same question for several payments, one verdict each |
Fourteen packages. Only @paystage/mcp exposes ten MCP tools; the rest are the evaluator, guards for other
frameworks, a policy schema and a skill — hence fourteen packages and ten tools, which are different numbers.
| Package | Role | Links |
|---|---|---|
@paystage/mcp | umbrella MCP server — start here | npm |
@paystage/x402-guard | policy gate for x402 clients, before the wallet signs | npm |
@paystage/ai-sdk | the same gate as Vercel AI SDK tools | npm |
@paystage/auth-watch | outstanding ERC-20 / Permit2 / EIP-3009 authorisations | npm |
@paystage/channel | read-only x402 deposit-channel state | npm |
@paystage/policy | policy schema and loader | npm |
@paystage/preflight | x402 payment preflight (the evaluator) | npm |
@paystage/receipt-verify | verify a signed receipt without the server | npm |
@paystage/skill | agent skill manifest | npm |
@paystage/trade-preflight | HIP-3 / trade.xyz order preflight | npm |
@paystage/velocity | rate and spend-pattern checks | npm |
@paystage/x-evm | chain-agnostic EVM helpers | npm |
Four claims are checked against production, not against the repo — run all of them with one command:
npm run check:live
| check | what it asks the deployed system |
|---|---|
check-deployed-sha | is the site serving the newest deployable commit? |
check-mcp-live | does /mcp serve exactly the ten declared tools? |
check-receipt-live | does a real receipt verify — and does an altered one fail? |
check-sanctions-live | does the API refuse a sanctioned payee even when the policy allows it? |
Each exits non-zero on failure, so they belong in a release, not in a badge.
The wider conformance kit checks the published surfaces against reality:
node apps/hosted/scripts/conformance.mjs
It checks the published surfaces against reality — manifest shape, the ten tools being listed, machine surfaces being genuinely different from each other, health and timing headers on both networks, the receipt key endpoint, that an unpaid evaluation is challenge-only, and that malformed input fails closed. Read-only: no payment, no key, no account. Exit code 1 if anything is off.
It runs daily in CI (cadence.yml) and the result history is on the site.
A green tick is a claim; the run's JSON is the evidence. Every run uploads the full
JSON as the workflow artefact conformance-<run id>, retained for 30 days, and a
one-line summary (timestamp, status, passed/total, run id, run URL) is committed to
docs/state/conformance.log from that artefact. The
artefact is attached per run on the cadence workflow page;
because the repo is public but artefact downloads require a GitHub login, that page is
the link to the evidence rather than a direct file URL.
Socket.dev scores packages on capability, so a payment-safety tool will always carry
flags: it reads a policy file, reads two environment variables and talks to an RPC.
Every package README states exactly what it touches and why, and
SECURITY.md has the full table. The umbrella resolves to 11 installed modules, measured by
scripts/check-deps-budget.mjs (which packs each package, installs the tarball in an empty project and counts
npm ls --all --parseable) and enforced in CI: a dependency that pushes any package past deps-budget.json fails
the build, so a new dependency is a deliberate act rather than a diff nobody reads. The umbrella @paystage/mcp is ~16 KB
with no network, no filesystem and no eval of its own — the capability lives in the
tools it bundles.
This is an npm-workspaces monorepo — package-lock.json is the lockfile and CI runs npm ci.
There is no pnpm workspace and no lint script; npm run typecheck is the check that exists.
npm ci
npm run build
npm test
npm run typecheck
PayStage is built in the open, outside contributions are welcome.
KNOWN_DRAINERS.md with a public source link (incident report, explorer label, or security write-up). Unsourced addresses won't be merged.Look for issues labelled good first issue to get started.
Every non-static badge in the row at the top reads its value at render time, from the source linked here: the @paystage/mcp version from registry.npmjs.org; CI status from the ci.yml run history — the workflow that gates merges; the licence from LICENSE in this repo; the canary last-published date from badges/canary.json on the badges branch, written only by the scheduled release.yml run after a successful canary publish; and the MCP Registry entry from the registry's own API. npm provenance is not a badge — it is an attestation on each published version and scripts/check-provenance.mjs fails a release when a version carries none. The sixth badge, x402 · Base, is static: it is a label for what this project is, not a measurement, and it is the only one of the six that cannot change on its own.
MIT