ZERO Payment Guard
Checks x402 payment assets for native Circle USDC and verifies Base USDC payments, flagging bridged USDbC as a caution.
Reads payTo addresses via public Ethereum RPC to determine whether they are EOAs or contracts, and includes Ethereum in USDC network checks.
Supports x402 payment-option preflight checks on Optimism, validating native Circle USDC assets and network recognition.
Supports x402 payment-option preflight checks on Polygon, validating native Circle USDC assets and network recognition.
This server has a remotely hosted endpoint. Open its connector listing for connection details, authentication requirements, and setup instructions:
zero-payment-guard
Check an x402 endpoint before your agent signs a payment: a single-file Python CLI, plus the source of the ZERO Payment Guard MCP server and x402 API (server/).
x402_preflight.py is a single-file, standard-library-only Python script. It makes one unpaid
request, reads the HTTP 402 payment terms (x402 v2 PAYMENT-REQUIRED header or v1 JSON body),
and tells you whether they look safe to pay. It never signs or pays anything.
Quick start
curl -O https://raw.githubusercontent.com/qweewqqwe221/zero-payment-guard/main/x402_preflight.py
python3 x402_preflight.py https://example.com/paid-endpoint --max-usd 0.05Python 3.8+; no dependencies.
Options:
--max-usd N: block if the price is above your cap.--method GET|POST|HEAD: method for the unpaid probe (defaultGET).
Related MCP server: obolpay-x402-mcp
What it checks
For each payment option in accepts:
Check | Result if it fails |
Asset is native Circle USDC on that network (Base, Base Sepolia, Ethereum, Arbitrum, Optimism, Polygon, Avalanche) | block (lookalike token) |
Asset is bridged USDbC instead of native USDC | caution |
Network is in the known-USDC table | caution |
Scheme is | caution (read the spending semantics) |
Price is at or under | block |
| caution (a signed authorization stays valid that long) |
| reported, not judged |
The endpoint's verdict is the best of its options.
Exit codes
Code | Meaning |
0 | ok |
1 | caution (also: endpoint did not answer 402) |
2 | block |
3 | could not check (network error) |
So an agent or a shell script can gate a payment on the exit code:
python3 x402_preflight.py "$URL" --max-usd 0.01 && pay "$URL"Example output
{
"url": "https://zero-payment-guard.worker.beacon.host/v1/token-check",
"x402Version": 2,
"verdict": "ok",
"options": [
{
"network": "eip155:8453",
"priceUsd": 0.003,
"payTo": "0x857B162e7817D385ED1Dc895c3823BeE42D0ebE5",
"payToIsContract": false,
"verdict": "ok",
"flags": []
}
]
}Tests
python3 -m unittest discover -s tests -vThe tests are offline (RPC lookups are disabled).
MCP server and API (source in server/)
This repo also contains the full source of the ZERO Payment Guard x402 API and MCP server: the same preflight logic plus Base USDC payment verification, token safety checks, wallet and transaction reads, and web/company data tools.
Hosted: https://zero-payment-guard.worker.beacon.host (MCP:
https://zero-payment-guard.worker.beacon.host/mcp). Tools are paid per call in USDC on Base via x402 ($0.001 to $0.008).initialize,tools/list,/openapi.json,/llms.txtand/sample/*are free.Local:
cd server && npm ci && npm run stdio(MCP over stdio), ordocker build -t zero-payment-guard .Setup, configuration and deploy notes: server/README.md. Client config: mcp/.
Listed in the official MCP Registry as
host.beacon.worker.zero-payment-guard/payment-guard.
The Python script above does not depend on the server.
Longer write-up: How to preflight an x402 endpoint before your agent pays (also on Hashnode).
Disclosure
This project is built and operated by ZERO, an AI agent run by Silas Montgomery, as part of an experiment in earning USDC through useful, legal work. Code and docs were written with AI assistance and reviewed by running the tests and live checks above.
License
MIT, see LICENSE.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
x402 pay-per-call APIs over MCP, settled in USDC on Base for autonomous agents and developers.
Pay-per-action access to APIs and MCP tools over Lightning L402 and Base USDC x402.
Paid KYC, AML, and regulatory risk assessment over MCP via x402 USDC micropayments on Base.
Operated by SpendPreflight: sanctions screening and allow/hold/block preflight for x402 payments.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAn MCP server that tests agent payment capabilities by making a real x402 payment ($10 USDC on Base) and returning a signed diagnostic report covering the entire payment flow.MIT
- FlicenseAqualityCmaintenanceMCP server for a live x402 payment gateway on Base (USDC). Lets AI agents discover, preview for free, then pay per call — with prepaid gasless payments, signed receipts, and delta delivery.7-

tereno-mcpofficial
AlicenseNot gradedqualityCmaintenanceMCP server for verifying blockchain safety on Base via x402, with free pricing/receipt tools and paid per-call guard, contract, and metadata checks settled in USDC.458 npmMIT- AlicenseAqualityAmaintenanceEnables agents and developers to check x402 endpoints, assess scores and wallet risks, authorize payments with spending rules, and report outcomes before an agent pays.62MIT