a2a-x402-guard-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| X402_DEFAULT_MAX_TX_USDC_ATOMIC | No | Default per-transaction spend ceiling in USDC atomic units (minor units), e.g. "5000000". Enforced by the integer-only SPEC_CLASS_09 spend gate. | 5000000 |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
Zero-dependency x402 HTTP 402 & A2A AP2 payment guard: inspect CAIP-2 payment headers, enforce SPEC_CLASS_09 integer minor-unit spend caps & SQLite WAL nonces, verify Ed25519 + RFC 8785 JCS AP2 CartMandates, scaffold S4-REJECT-005-safe signed A2A v1.0.1 AgentCards, convert exact atomic units, and verify settlement webhooks.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| x402_inspect_payment_headerA | Parse & audit HTTP 402 |
| x402_enforce_spend_policyA | Deterministic |
| ap2_verify_cart_mandateA | Verify A2A AP2 ( |
| x402_scaffold_agent_card_extensionB | Generate spec-compliant HTTP 402 |
| x402_convert_atomic_unitsA | Exact |
| x402_verify_settlement_webhookA | Verify x402 / facilitator settlement webhooks via constant-time |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
| audit-402-payment-challenge | Decode an HTTP 402 `PAYMENT-REQUIRED` or `X-PAYMENT` header, verify CAIP-2 asset authenticity and EIP-3009 time bounds, and evaluate spend-cap policy before signing. |
| verify-ap2-cart-mandate | Verify an A2A AP2 `CartMandate` or `IntentMandate` envelope across ISO-4217/crypto minor-unit exponents, line-item sum conservation, human-confirmation threshold, and Ed25519 JCS signatures. |
| add-x402-pricing-to-agent-card | Scaffold HTTP 402 `PAYMENT-REQUIRED` headers and an `S4-REJECT-005`-compliant Ed25519-signed A2A v1.0.1 `/.well-known/agent-card.json` + `jwks.json` bundle. |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| CAIP-2 Canonical x402 Asset Contracts & Currency Minor-Unit Exponents | Canonical contract/mint addresses for Base USDC (`eip155:8453`), Base Sepolia (`eip155:84532`), Solana USDC/SOL, Stacks sBTC (`stacks:1`), and exact `0/2/3/6/8/9/18` decimal exponents. |
| SPEC_CLASS_09 & SPEC_CLASS_14 Agentic Payment Security Invariants | Engineering checklist covering integer-only minor-unit math, EIP-3009 replay bounds, AP2 Ed25519 + RFC 8785 JCS mandates, S4-REJECT-005 ProtoJSON safety, and webhook DLP hygiene. |
TDQS
Scored across 6 tools
Each tool targets a distinct phase of the payment lifecycle: policy enforcement, header parsing, mandate verification, artifact scaffolding, unit conversion, and webhook verification. Only minor overlap exists between x402_enforce_spend_policy and ap2_verify_cart_mandate, since both validate amounts, payees, and thresholds, but their inputs (transactions vs. mandate envelopes) are clearly separated.
All six names follow a verb_noun pattern (enforce_spend_policy, inspect_payment_header, convert_atomic_units, etc.), so they are predictable and readable. The only deviation is the ap2_ prefix on ap2_verify_cart_mandate versus x402_ elsewhere, though this usefully signals the protocol family the tool handles.
Six tools is well-scoped for a focused x402/AP2 guard server, and each maps to a distinct responsibility (enforce, inspect, verify mandates, scaffold, convert, verify webhooks). No tool appears redundant or vestigial.
The surface covers the core guard workflow: policy enforcement, header audit, mandate verification, artifact generation, unit math, and webhook verification. Minor gaps remain: there is no payer-side X-PAYMENT payload construction or signing tool, and no way to query or reset the cumulative spend ledger that x402_enforce_spend_policy maintains, but agents can work around these with the scaffolding and enforcement tools.