Skip to content
Back to blog
developer-guide13 min read

Building Agentic Commerce #7: Card Network Adapters — Visa VIC & Mastercard Agent Pay

How AgenticMCPStores integrates Visa Intelligent Commerce (VIC) and Mastercard Agent Pay (MCAP) to give AI agents access to 2B+ tokenized cards — without ever seeing card data.

Executive summary

A technical walkthrough of how AgenticMCPStores connects AI agents to Visa and Mastercard's tokenized payment rails — covering VIC's 4-layer cryptography stack, MCAP's zero-code Stripe pass-through, consent management, and the unified AgentPaymentIntent model that lets merchants accept both with a single integration.

Published

2026-06-16

13 min read

Author

MCP Editorial Team

Editorial and research desk

The editorial team at AgenticMCPStores covers agentic commerce, WebMCP adoption, and practical implementation patterns for merchants and platforms.

View profile

Category

developer-guide

visamastercardcard-networkstokenizationagentic-commercepayment-protocolsMCPsecurity

AI agents can search products, compare prices, and build carts across protocols like MCP, ACP, and A2A. But when it's time to pay, the agent needs access to real payment rails — Visa, Mastercard, the networks that process 80% of global card transactions. This post covers how AgenticMCPStores integrates both card networks through purpose-built adapters, giving agents tokenized payment access without ever exposing card data.

The Problem: Agents Need Card Rails

Stablecoin payments (x402) and protocol-native checkout (ACP, UCP) work well for crypto-native and platform-native flows. But most consumers still pay with Visa and Mastercard. For agentic commerce to reach mainstream adoption, agents need to interact with card networks — securely, with consumer consent, and without handling raw card numbers. Visa's Intelligent Commerce (VIC) and Mastercard's Agent Pay (MCAP) are the two card network protocols designed specifically for this use case.

Visa Intelligent Commerce (VIC)

VIC is Visa's direct API integration for agentic payments. The agent creates a purchase instruction with amount, currency, and merchant details. Visa's backend tokenizes the card via VTS (Visa Tokenization Service), binds it to the consumer's FIDO-enrolled device, and returns payment credentials — never exposing card data to the agent or merchant backend.

VIC Architecture: 4-Layer Cryptography

VIC's security model uses four cryptographic layers: (1) JWE token authentication — RS256 signing + RSA-OAEP-256 encryption with stale-while-revalidate caching (3600s TTL, auto-refresh 60s before expiry). (2) X-Pay HMAC — request-level integrity verification. (3) Message-Level Encryption (MLE) — RSA-OAEP-256 key wrapping + A128GCM content encryption for payload confidentiality. (4) HTTPS — transport-level encryption. This means every VIC API call is signed, encrypted at message level, and transmitted over TLS — defense in depth against man-in-the-middle, replay, and data exfiltration attacks.

VIC Settlement Flow

The settlement service exposes three operations: createInstruction() — creates a VIC purchase instruction with amount, currency, merchant category code (MCC), frequency (SINGLE or recurring WEEKLY/MONTHLY), and shipping address. retrieveAndConfirm() — obtains payment credentials from VIC without exposing card data, then confirms the transaction event. cancelInstruction() — cancels an active purchase instruction. All operations use exponential backoff retry (max 3 attempts: 2s, 4s, 8s delays) and circuit breaker protection for resilience.

VIC Mandate Types

  • 1
    Single mandates (PRO tier): One-time purchase instruction with transaction limit enforcement
  • 2
    Recurring mandates (ENTERPRISE tier): WEEKLY or MONTHLY frequency with state reconciliation and webhook-driven updates
  • 3
    Multi-merchant mandates (ENTERPRISE tier): Agent can pay across multiple merchants under a single consumer enrollment

Mastercard Agent Pay (MCAP)

MCAP takes the opposite approach to VIC. Instead of a direct API integration with multi-layer cryptography, MCAP uses a zero-code Stripe pass-through model. If a merchant already has Stripe configured, MCAP works automatically — the Agentic Token (a 16-digit network token) is processed as a standard card token through existing Stripe rails. The complexity shifts to agent identity verification and consumer consent management.

MCAP: HTTP Message Signatures (RFC 9421)

MCAP verifies agent identity using HTTP Message Signatures per RFC 9421 with Ed25519 keys. Every payment request includes Signature-Input and Signature headers with tag='agent-payer-auth'. The signature service parses the input header, extracts keyid/created/expires/nonce/alg, validates the Ed25519 signature against the agent's public key, enforces clock skew tolerance (plus or minus 30 seconds), and prevents replay attacks via a nonce cache with 5-minute TTL. Key rotation is supported with a 24-hour grace period for smooth transitions.

MCAP's consent service validates every transaction against the consumer's consent scope — maximum amount per period, allowed merchant category codes (MCCs), specific merchant IDs, and time windows. Accumulated usage tracking uses optimistic locking (WHERE updatedAt condition) for concurrent safety. Consent periods (DAILY, WEEKLY, MONTHLY) auto-reset when expired. Consumers can revoke consent at any time with immediate effect, ensuring the consumer always maintains control over their agent's spending authority.

VIC vs MCAP: Architecture Comparison

  • 1
    Integration model: VIC uses 6 direct API endpoints; MCAP uses Stripe pass-through (zero additional config)
  • 2
    Cryptography: VIC has 4 layers (JWE + X-Pay + MLE + HTTPS); MCAP has 1 layer (Ed25519 HTTP signatures)
  • 3
    Merchant activation: VIC requires API key + MLE certificates; MCAP is automatic if Stripe is enabled
  • 4
    Enrollment: VIC uses FIDO multi-step device binding per card; MCAP uses pre-enrolled Mastercard Agent Sign-Up
  • 5
    Settlement: VIC returns its own credential-based payment token; MCAP routes through standard Stripe network tokens
  • 6
    Recurring: VIC has native WEEKLY/MONTHLY mandates with state sync; MCAP uses Stripe subscription integration
  • 7
    Complexity: VIC is crypto-heavy (7/10); MCAP is signature-focused (4/10)
  • 8
    Consumer auth: VIC binds to FIDO device; MCAP delegates to Mastercard app/biometrics

Unified Integration: The AgentPaymentIntent Model

Both VIC and MCAP feed into the same AgentPaymentIntent model — the platform's universal payment abstraction. The Protocol Router detects the incoming protocol via headers (X-Protocol: VIC or Signature-Input with agent-payer-auth tag), normalizes the request through the respective inbound adapter, and routes it to the settlement service. VIC is bidirectional (inbound + outbound adapters); MCAP is inbound-only since settlement happens via Stripe. Both adapters implement the IProtocolAdapter interface (detect, normalize, translate, healthCheck) and register in the PluginRegistry at server startup.

Protocol Detection Priority

VIC is never auto-selected as a fallback — it requires active consumer enrollment and an explicit X-Protocol: VIC header. If the header is detected but the consumer is not enrolled, the request fails with a clear error. MCAP has zero fallback friction — if a merchant has Stripe configured, MCAP payment requests are accepted automatically. Both protocols pass through the unified KYAI policy engine for spending limits, merchant verification, and agent trust scoring before settlement.

Tier Gating

  • 1
    PRO tier: VIC single mandates + MCAP basic agent payments
  • 2
    ENTERPRISE tier: VIC recurring mandates + multi-merchant + MCAP consent management
  • 3
    Both use the requireTier() middleware pattern consistent with all other protocol adapters

Combined Coverage: 80% of Global Card Payments

Together, VIC and MCAP provide coverage for approximately 2 billion tokenized cards globally — Visa's 1B+ and Mastercard's 1B+ cardholders. Combined with x402 stablecoin payments, ACP protocol-native checkout, and UCP standardized flows, AgenticMCPStores offers the most comprehensive payment coverage in agentic commerce. Merchants configure their preferred protocols once; the Protocol Router handles detection and routing automatically.

Production Status and Testing

VIC (spec 014) is complete with 200+ tests across 14 test files covering adapter detection, API client, settlement flow, MLE/JWE crypto, token manager, circuit breaker, analytics, enrollment, recurring mandates, schemas, and config validation. Currently in sandbox awaiting Visa production credentials (external blocker). MCAP (spec 017) is complete with 78 tests across 6 files covering adapter detection, RFC 9421 signature verification, consent validation, nonce cache, schemas, and integration. MCAP is enabled in production (Railway MCAP_ENABLED=true). Both specs are fully implemented — the only remaining dependency is Visa's production credential issuance for VIC.

Card network adapters are one of seven payment protocols supported by AgenticMCPStores. For the full protocol stack — MCP native checkout, x402 stablecoin payments, ACP protocol-native flows, UCP standardized checkout, A2A agent-to-agent messaging, and card network adapters — see the Building Agentic Commerce series at /en/blog.

Essential insight

Frequently asked questions

Does the AI agent ever see the consumer's actual card number?

Never. Both VIC and MCAP use tokenized payment flows. VIC creates tokenized credentials via Visa Tokenization Service (VTS) with FIDO device binding — the agent only receives a purchase instruction ID. MCAP uses 16-digit Agentic Tokens that are standard network tokens processed through Stripe — no raw card data touches the agent or merchant backend. All card data stays within the card network's secure infrastructure.

Can a merchant accept both Visa VIC and Mastercard MCAP simultaneously?

Yes. Both protocols register as separate adapters in the PluginRegistry and implement the same IProtocolAdapter interface. The Protocol Router detects which protocol the incoming request uses (via headers) and routes to the correct adapter. A merchant on PRO or ENTERPRISE tier can accept VIC, MCAP, x402, ACP, UCP, and A2A payments — all through a single MCP endpoint.

What happens if a consumer revokes their MCAP consent mid-transaction?

Consent revocation takes immediate effect. If a consumer revokes consent via the Mastercard app while an agent is attempting a purchase, the McapConsentService.validateAndConsume() call will reject the transaction before it reaches Stripe. The agent receives a clear error indicating consent was revoked, and can inform the user accordingly. No partial charges are created.

Why does VIC require 4 cryptographic layers while MCAP only needs 1?

Architecture difference. VIC is a direct API integration — the merchant backend communicates directly with Visa's servers, requiring end-to-end cryptographic verification at every layer (authentication, integrity, confidentiality, transport). MCAP uses Stripe as an intermediary — Stripe already handles the heavy cryptography with Mastercard, so the merchant only needs to verify the agent's identity via HTTP Message Signatures. The security guarantees are equivalent; the complexity is distributed differently.

Is Visa TAP the same as VIC?

No. Visa TAP (Token and Permissions) is a separate initiative that Visa is developing for broader agentic use cases. When TAP's public specification is released, AgenticMCPStores plans to extend the existing VIC adapter rather than creating a new protocol adapter — the architecture is designed for incremental extension. TAP is currently being monitored for spec publication.

Sources and references

Related articles

Visa VIC & Mastercard Agent Pay for AI Agents | Building Agentic Commerce #7 | AgenticMCPStores