Pre-payment PII screener for x402 β catches emails, SSNs, names before agents sign.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
We haven't yet run this listing's install command through our automated sandbox check. This isn't a red flag β we're steadily working through the catalog.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
Pre-payment safety gate for x402 β agents call screen_payment_metadata(...), check_payment_policy(...), and check_payment_replay(...) before signing, catching PII, budget overruns, and duplicate payments before metadata or money leaves the agent host.
Part of the presidio-hardened-* toolkit family. Thin MCP (Model Context Protocol) adapter over the presidio-hardened-x402 library, pinned for parent 0.11.x compatibility (presidio-hardened-x402>=0.11.1,<0.12.0). The >=0.11.1 floor is a security floor, not a preference β it is the release that closed the percent-encoded PII redaction bypass.
x402 agentic payments routinely carry user-supplied free text β descriptions, memos, query-string parameters β straight through to merchants and facilitators. When an LLM agent generates that text, it can include PII the user never intended to share. Once the merchant logs it, retention is their decision, not yours.
This MCP server gives agents a small default-deny gate before payment leaves the agent host. Three tools expose the parent library's stable pre-payment controls: PII redaction, spending policy, and replay detection. They are designed to compose with payment-execution and endpoint-safety MCP servers (x402station, Coinbase x402, Sardis, ...), while newer parent-library surfaces β evidence-ref@1 verification, the v0.9.1 SLO broker, the v0.10.0 settlement-ref@1 treasury binding, and the v0.11.0 CapabilityEnforcer β stay in the Python library unless an MCP tool explicitly wraps them later.
Requires Python β₯ 3.10. Distributed on PyPI; recommended invocation via uvx (no global install).
Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or the equivalent on your platform:
Same shape β every MCP host accepts command / args / env. See your editor's MCP-server docs for the config-file path.
All optional. Defaults give a zero-config in-process mode with no quota, no network, and no PII storage.
| Variable | Purpose | Default |
|---|---|---|
PRESIDIO_X402_MCP_MODE | regex (zero-setup) or nlp (needs [nlp] extra + a spaCy model) | regex |
PRESIDIO_X402_MCP_MAX_PER_CALL_USD | Max USD per single payment (policy gate) | unset β no limit |
PRESIDIO_X402_MCP_DAILY_LIMIT_USD | Max USD per rolling window (policy gate) | unset β no limit |
PRESIDIO_X402_MCP_PER_ENDPOINT_JSON | Per-endpoint cap, e.g. '{"api.foo.com": 5.00}' | unset |
PRESIDIO_X402_MCP_WINDOW_SECONDS | Rolling window for the daily limit | 86400 |
PRESIDIO_X402_MCP_AGENT_ID | Label written into audit records | unset |
PRESIDIO_X402_MCP_REPLAY_TTL | Fingerprint cache TTL (seconds) | 300 |
PRESIDIO_X402_MCP_REDIS_URL | Use Redis for replay state instead of in-memory | unset |
PRESIDIO_X402_MCP_AUDIT_PATH | Append-only JSON-L audit log path; omit to disable | unset |
PRESIDIO_X402_MCP_LOG_LEVEL | DEBUG / INFO / WARNING / ERROR | INFO |
PRESIDIO_X402_MCP_REMOTE_BASE_URL | Enable HTTP-proxy mode for tool 1 β see Modes. Must be https://; plain http:// is accepted only for loopback and otherwise refuses to start | unset |
PRESIDIO_X402_MCP_REMOTE_API_KEY | API key for the remote screening service | unset |
PRESIDIO_X402_FINGERPRINT_KEY | 32-byte hex key for cross-process replay detection | unset (per-process) |
PRESIDIO_X402_CHAIN_KEY | 32-byte hex key for cross-process audit-chain HMAC | unset (per-process) |
PRESIDIO_X402_REQUIRE_FINGERPRINT_KEY | Fail startup if replay key is absent or invalid | unset |
PRESIDIO_X402_REQUIRE_CHAIN_KEY | Fail startup if audit-chain key is absent or invalid | unset |
Generate cross-process keys with openssl rand -hex 32.
screen_payment_metadata(resource_url, description, reason, entities?)Detects and redacts PII in payment metadata. No side effects β safe to call repeatedly.
entities (optional list of Presidio entity types) narrows detection to a whitelist. Field-length caps mirror the screening-api wire contract that remains stable through parent 0.7.x: resource_url β€ 2048, description β€ 4096, reason β€ 4096 characters. Oversized inputs raise ValueError.
check_payment_policy(resource_url, amount_usd)Spending-policy gate. Records the spend on success β call exactly once, immediately before payment. Skipping the actual payment after a successful check inflates the daily-limit ledger until the window rolls over.
check_payment_replay(resource_url, pay_to, amount, currency, deadline_seconds)Duplicate-payment gate via HMAC-SHA256 fingerprint of the canonical fields. Records the fingerprint on success β call exactly once, immediately before payment.
amount is a string to preserve precision. Cross-process detection requires PRESIDIO_X402_FINGERPRINT_KEY (and optionally PRESIDIO_X402_MCP_REDIS_URL); otherwise each MCP server process keeps its own in-memory store.
In-process (default). Wraps the local presidio-hardened-x402 library in the same process as the MCP server. No network, no API key, no quota. PII never leaves the agent host. Use this unless you have a specific reason not to.
HTTP-proxy. When both PRESIDIO_X402_MCP_REMOTE_BASE_URL and PRESIDIO_X402_MCP_REMOTE_API_KEY are set, screen_payment_metadata calls /v1/screen on the configured host (e.g. https://screen.presidio-group.eu) for centralized audit. On auth / quota / network failure, returns a structured { "error": "auth_error" | "rate_limit" | "unavailable", "detail": ..., "mode": "remote" } β never silently falls back to in-process. Tools 2 and 3 always stay in-process.
Designed to slot into agent flows alongside payment-execution and endpoint-safety MCP servers:
screen_payment_metadata is read-only and safe to interleave anywhere. The policy and replay gates record state on call β sequence them immediately before payment.
Endpoint-safety and payload-safety are independent signals β calling both is what you actually want before signing. Configure the two MCP servers side-by-side:
Agent flow before signing a payment (pseudocode β each step is one MCP tool call):
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/presidio-hardened-x402-mcp)<a href="https://allmcps.com/mcp/presidio-hardened-x402-mcp"><img src="https://allmcps.com/api/badge/presidio-hardened-x402-mcp?style=directory" alt="Presidio Hardened X402 MCP on AllMCPs" /></a>