# check-payment-recipient Pre-signing payment safety check for AI agents, exposed as a paid MCP tool over x402 v2. ## What it does Before your agent signs a USDC payment, send the recipient address, amount, asset and network. The service checks the OFAC SDN list and an operator blocklist, counterparty history (address changes, asset/network mismatches) and amount anomalies, and returns a decision: allow, escalate or block, with reason codes, a risk score (0-100) and a verifiable receipt id. ## Endpoint MCP (Streamable HTTP, stateless, JSON responses): POST https://check-payment-recipient.fuwafuwow.workers.dev/mcp 1. Plain HTTP discovery. For example, `curl -i https://check-payment-recipient.fuwafuwow.workers.dev/mcp` returns HTTP 402 with the x402 challenge in the PAYMENT-REQUIRED header. It lists the payment options for both tools without starting a check. 2. MCP payment flow. POST a JSON-RPC tools/call to /mcp with the tool name and arguments. A valid unpaid call returns the x402 challenge inside the MCP tool result. Retry the same tools/call with the same arguments and the payment payload in params._meta["x402/payment"]. ## Paying with XNO (Nano dual rail) Both paid tools accept XNO at fixed prices: - check_payment_recipient: 0.15 XNO (150000000000000000000000000000 raw) - check_payment_batch: 1.5 XNO (1500000000000000000000000000000 raw) Use the XNO quote from the MCP tool result. Send the quoted amount from your Nano wallet to nano_1edjtwsjn1ptew5tg3915q6sm6jwzryj7t7frsn4rmu31ujripc5c9nw6aqz. Resend the same tools/call with the same arguments and idempotency_key, passing the Nano send block hash in that call's params._meta["x402/payment"]: {"scheme": "exact", "network": "nano:mainnet", "payload": {"blockHash": ""}} The service verifies that the block is confirmed, pays the quoted destination and amount, and is no older than 15 minutes at redemption. Overpayment is accepted and reported. Each block can be redeemed once across both tools. On a transient Nano RPC failure (NANO_VERIFY_UNAVAILABLE), retry the same call with the SAME block hash. To confirm completion, replay the original call with the same idempotency_key and arguments, or look up that key with the free get_receipt tool. The receipt's payment_reference contains the redeemed block hash. ## Tools - check_payment_recipient (paid): arguments recipient_address, amount (decimal string, e.g. "12.50"), asset ("USDC"), network ("eip155:8453"), counterparty_id, idempotency_key, requested_at (ISO 8601). Optional: purpose. - check_payment_batch (paid): arguments items (array of 1-20 check_payment_recipient argument objects) and idempotency_key. Runs up to 20 payment checks in ONE paid call and returns per-item decisions plus a summary {total, allow, escalate, block, input_error}, with one receipt for the whole batch. - ping (free), list_capabilities (free), get_receipt (free, by receipt_id or idempotency_key; also returns batch receipts). ## Price and payment $0.05 per check with check_payment_recipient; $0.50 per check_payment_batch call (up to 20 checks in one call). USDC on Base mainnet (eip155:8453), x402 v2 scheme "exact", payTo 0x4B8e0ef68787d9a2bfb4f9201209002C44E622E4, maxTimeoutSeconds 300. An unpaid call returns the payment challenge in the tool result; pay it with any x402 v2 client and retry the same call with the payment payload. ## Failure behavior - Single-check validation errors return INPUT_ERROR before payment and incur no charge. - Invalid batch requests (malformed body, missing or invalid batch idempotency_key, or items other than an array of 1-20 entries) are refused before payment and incur no charge. An invalid item in an otherwise valid paid batch returns INPUT_ERROR as part of the paid result. The batch price still applies. - Checks require EVM-format recipient addresses. XNO on nano:mainnet can pay for checks where enabled. A Nano-format recipient returns INPUT_ERROR before payment in a single check, or as an item error in a paid batch. - Replaying a call with the same idempotency_key and the same payload returns the stored receipt with no new payment. The same key with a different payload returns IDEMPOTENCY_CONFLICT. This applies to both tools (a batch replay uses the batch idempotency_key). - If settlement fails after verification, nothing is charged and nothing is stored; retry with the same idempotency_key. - Decisions expire after 600 seconds (decision_expires_at in the receipt). ## Operator end-to-end test (2026-11-06) In an operator test, Muse used check_payment_recipient before paying SI Dog Park (https://si.kgninja.dev) for "Buyer Checklist v1" (0.01 USDC, Base mainnet): - Safety check decision: allow (risk_score 10), receipt rcpt_094b1e95de1228c4a2e45bde1ba570ad - Settlement tx: 0x74a69cb0ebf74116fe53402190ba720bee532594a470874df91c024d47a1a021 - Delivered content SHA-256 verified against the expected hash 9ecba1f1d5bf7a95dd6d9461ed460aad442b5792fdffaed67a13eea655783c1b: match Both the safety check and the SI purchase worked as documented: priced as listed, settled on Base, and the delivery matched its published hash.