TAP-MCP Bridge
Rust library and MCP server for Visa's Trusted Agent Protocol (TAP), enabling AI agents to securely authenticate with merchants and execute payment transactions.
Workspace Structure
| Crate | Type | Description |
|---|---|---|
tap-mcp-bridge |
Library | RFC 9421 signatures, JWE encryption, TAP protocol |
tap-mcp-server |
Binary | MCP server exposing TAP tools for Claude and other AI agents |
Installation
As a Library
[]
= "0.1"
As MCP Server
Configure your MCP client (Claude Desktop, etc.):
[!IMPORTANT] Requires Rust 1.85+ (Edition 2024).
Quick Example
use SigningKey;
use ;
let signing_key = from_bytes;
let signer = new;
let signature = signer.sign_request?;
println!;
println!;
MCP Tools
The server exposes three tools for AI agents:
| Tool | Description |
|---|---|
checkout_with_tap |
Execute payment with TAP authentication |
browse_merchant |
Browse merchant catalog with verified identity |
verify_agent_identity |
Health check and agent verification |
Features
TAP Protocol
- RFC 9421 HTTP Message Signatures with Ed25519
- RFC 7516 JWE encryption for payment data (A256GCM + RSA-OAEP-256)
- RFC 7638 JWK Thumbprints for key identification
- ID Tokens (JWT) for consumer authentication
- ACRO — Agentic Consumer Recognition Object
- APC — Agentic Payment Container with JWE encryption
Production Features
- Retry with backoff — Exponential backoff with jitter for transient failures
- Circuit breaker — Protection against cascading failures
- Rate limiting — Token bucket algorithm for request throttling
- Audit logging — Structured security events with sensitive data redaction
- Prometheus metrics — Request counters, error rates, latency tracking
- Replay protection — UUID v4 nonce with LRU cache validation
Examples
# Basic checkout flow
# Browse merchant catalog
# Error handling patterns
# TAP signature generation
# JWKS for agent directory
# ID Token (JWT) generation
# ACRO generation
# APC encryption/decryption
[!TIP] Set
AGENT_SIGNING_KEYenvironment variable before running examples:
Documentation
| Resource | Description |
|---|---|
| API Reference | Complete API documentation |
| Examples | Runnable code examples |
Development
# Install tools
# Quick verification
# Full test suite (200+ tests)
# Security audit
# Documentation
License
Licensed under MIT OR Apache-2.0 at your option.
Resources
- TAP Protocol — Official Visa documentation
- MCP Protocol — Anthropic's Model Context Protocol
- RFC 9421 — HTTP Message Signatures
- RFC 7516 — JSON Web Encryption (JWE)