TAP-MCP: Model Context Protocol Server for TAP
A Model Context Protocol (MCP) server that provides AI applications with standardized access to Transaction Authorization Protocol (TAP) functionality. This enables LLMs and AI agents to create, manage, and monitor TAP transactions through a well-defined interface.
Overview
TAP-MCP is a thin wrapper around TAP Node that exposes transaction authorization functionality through the Model Context Protocol standard. This enables AI applications to:
- Agent Management: Create TAP agents with auto-generated DIDs and manage cryptographic identities
- Transaction Creation: Initiate transfers, payments, and other TAP operations
- Message Monitoring: Access transaction history and message details
- Delivery Tracking: Monitor message delivery status, retry counts, and error details
- Schema Access: Get JSON schemas for TAP message types
- Per-Agent Storage: Each agent has isolated SQLite storage at
~/.tap/{sanitized_did}/transactions.db
Key design principles:
- Agents are cryptographic identities (DIDs) without predefined roles
- Roles (SettlementAddress, Exchange, Compliance, etc.) are specified per transaction
- Party associations are transaction-specific, not stored with agents
- Automatic DID generation ensures globally unique identifiers
- All transaction and message operations require an
agent_didparameter to specify which agent signs the message - Agent-Specific Storage: Each agent has its own isolated SQLite database for transactions and messages
Installation
From crates.io (recommended)
From source
Verify installation
Prerequisites
- Rust 1.70+ with Cargo
Quick Start
1. Basic Usage
Run the MCP server with default settings:
The server will:
- Use
~/.tapas the TAP root directory - Create DID-based storage (if --agent-did is provided)
- Listen for MCP requests on stdin/stdout
2. Custom Configuration
# Use specific agent DID for organized storage
# This creates database at ~/.tap/did_web_example.com/transactions.db
# Use custom TAP root directory
# Enable debug logging
# Show all options
3. Integration with AI Applications
TAP-MCP uses stdio transport, making it compatible with MCP clients like Claude Desktop:
Available Tools
TAP-MCP provides 38 comprehensive tools covering the complete TAP transaction lifecycle:
Agent Management
tap_create_agent
Create a new TAP agent with auto-generated DID. Agents are cryptographic identities; roles and party associations are specified per transaction.
Returns:
tap_list_agents
List all configured agents from ~/.tap/keys.json.
Agent Management for Transactions
tap_add_agents
Add agents to an existing TAP transaction (TAIP-5). Allows adding settlement addresses, compliance officers, or other agents to handle the transaction.
tap_remove_agent
Remove an agent from a TAP transaction (TAIP-5). Removes an agent's authorization to act on behalf of a party in the transaction.
tap_replace_agent
Replace an agent in a TAP transaction (TAIP-5). Atomically replaces one agent with another while maintaining continuity.
Transaction Creation
tap_create_transfer
Initiate a new TAP transfer transaction (TAIP-3). Requires specifying which agent will sign the message.
| Parameter | Required | Description |
|---|---|---|
agent_did |
Yes | DID of the signing agent |
asset |
Yes | CAIP-19 asset identifier |
amount |
Yes | Transfer amount |
originator |
Yes | Originator party (@id required) |
beneficiary |
Yes | Beneficiary party (@id required) |
agents |
No | Array of agents with @id, role, for |
memo |
No | Transaction memo |
expiry |
No | ISO 8601 expiry timestamp |
transaction_value |
No | Fiat equivalent for Travel Rule (amount + currency) |
metadata |
No | Additional metadata object |
tap_payment
Create a TAP payment request (TAIP-14). Supports crypto asset or fiat currency payments with optional invoice data.
| Parameter | Required | Description |
|---|---|---|
agent_did |
Yes | DID of the signing agent |
amount |
Yes | Payment amount |
merchant |
Yes | Merchant party (@id required) |
asset |
No* | CAIP-19 asset identifier |
currency |
No* | ISO 4217 currency code (e.g., USD) |
agents |
No | Array of agents |
memo |
No | Payment memo |
expiry |
No | ISO 8601 expiry timestamp |
invoice |
No | Invoice URL string or structured invoice object (TAIP-16) |
fallback_settlement_addresses |
No | Array of fallback settlement addresses (CAIP-10) |
metadata |
No | Additional metadata object |
* One of asset or currency must be specified.
tap_connect
Create a TAP connection request (TAIP-15) to establish a relationship between parties with optional constraints.
| Parameter | Required | Description |
|---|---|---|
agent_did |
Yes | DID of the signing agent |
recipient_did |
Yes | DID of the agent to connect with |
for_party |
Yes | DID of the party this connection is for |
role |
No | Agent role (e.g., SourceAgent, DestinationAgent) |
constraints |
No | Connection constraints (limits, allowed parties/assets) |
expiry |
No | ISO 8601 expiry timestamp |
agreement |
No | URL to terms of service or agreement |
tap_escrow
Create a TAP escrow request (TAIP-17) to place funds in escrow with an escrow agent.
tap_capture
Release escrowed funds (TAIP-17). Supports partial capture.
tap_exchange
Create a TAP exchange request (TAIP-18) for cross-asset exchanges.
| Parameter | Required | Description |
|---|---|---|
agent_did |
Yes | DID of the signing agent |
from_assets |
Yes | Source asset identifiers (CAIP-19, DTI, or ISO 4217) |
to_assets |
Yes | Target asset identifiers |
from_amount |
No* | Amount of source asset to exchange |
to_amount |
No* | Amount of target asset desired |
requester_did |
Yes | DID of the exchange requester |
provider_did |
No | DID of the exchange provider (omit to broadcast) |
agents |
No | Array of agents |
* One of from_amount or to_amount must be specified.
tap_quote
Respond with a quote to an exchange request (TAIP-18).
Transaction Actions
tap_authorize
Authorize a TAP transaction (TAIP-4). The agent_did specifies which agent signs the authorization.
tap_reject
Reject a TAP transaction (TAIP-4). The agent_did specifies which agent signs the rejection.
tap_cancel
Cancel a TAP transaction (TAIP-5). The agent_did specifies which agent signs the cancellation.
tap_settle
Settle a TAP transaction (TAIP-6). The agent_did specifies which agent signs the settlement.
Transaction Management
tap_list_transactions
List transactions with filtering and pagination support. Shows only transactions from the specified agent's storage.
Policy Management
tap_update_policies
Update policies for a TAP transaction (TAIP-7). Allows agents to update transaction policies such as authorization requirements, compliance rules, or operational constraints.
Customer and Connection Management
tap_list_customers
Lists all customers (parties) that a specific agent acts on behalf of. Analyzes transaction history to identify parties represented by the agent and includes metadata about each party.
Returns:
tap_list_connections
Lists all counterparties (connections) that a specific party has transacted with. Searches across all agent databases to find transaction relationships and includes role information.
Returns:
tap_get_customer_details
Get detailed information about a specific customer, including all their profile data and transaction history.
tap_generate_ivms101
Generate IVMS101 travel rule data from a customer's profile. Converts stored customer information into the IVMS101 format required for FATF travel rule compliance.
Returns IVMS101-formatted data for the customer's natural or legal person information.
tap_update_customer_profile
Update customer profile data using Schema.org vocabulary. Stores structured customer information in the agent's database.
tap_update_customer_from_ivms101
Update customer profile from IVMS101 data. Converts IVMS101 travel rule data into Schema.org format and stores it in the customer profile.
Communication Tools
tap_trust_ping
Send a trust ping message (DIDComm standard) to verify connectivity and agent availability.
tap_basic_message
Send a basic text message (DIDComm standard) for human-readable communication between agents.
Transaction Reversal
tap_revert
Request reversal of a settled transaction (TAIP-14). Used for compliance reversals or dispute resolutions.
Message Delivery Tracking
tap_list_deliveries_by_recipient
List message deliveries to a specific recipient, showing delivery status and retry information.
tap_list_deliveries_by_message
List all delivery attempts for a specific message ID.
tap_list_deliveries_by_thread
List all message deliveries for a transaction thread.
Database Tools
tap_query_database
Execute direct SQL queries on the agent's database for advanced analysis. Read-only access.
tap_get_database_schema
Get the complete database schema for understanding the data structure.
Message Debugging Tools
tap_list_received
Lists raw received messages with filtering and pagination support. Shows all incoming messages (JWE, JWS, or plain) before processing.
tap_get_pending_received
Gets pending received messages that haven't been processed yet. Useful for debugging message processing issues.
tap_view_raw_received
Views the raw content of a received message. Shows the complete raw message as received (JWE, JWS, or plain JSON).
Decision Management
tap_list_pending_decisions
Lists pending decisions from the decision_log table. Use this to poll for decisions that require action when tap-http is running in poll mode (--decision-mode poll).
Returns:
tap_resolve_decision
Resolves a pending decision by marking it as resolved in the database. Note: this only updates the decision log — to actually send the TAP message, call the corresponding action tool (e.g., tap_authorize).
Auto-resolution: When action tools (tap_authorize, tap_reject, tap_settle, tap_cancel, tap_revert) succeed, matching pending decisions are automatically resolved. This means you typically only need to call the action tool — you don't need to explicitly call tap_resolve_decision afterwards.
Available Resources
TAP-MCP provides 6 read-only resources for accessing TAP data without requiring tool calls:
tap://agents
Read-only access to agent information.
tap://agents # All agents with their DIDs and labels
tap://messages
Access to transaction messages and history from agent-specific storage.
tap://messages?agent_did=did:key:z6Mk... # Messages for specific agent (required)
tap://messages?agent_did=did:key:z6Mk...&direction=incoming # Filter by direction
tap://messages?agent_did=did:key:z6Mk...&direction=outgoing # Outgoing messages only
tap://messages?agent_did=did:key:z6Mk...&thread_id=abc123 # Filter by thread
tap://messages?agent_did=did:key:z6Mk...&type=Transfer # Filter by message type
tap://messages?agent_did=did:key:z6Mk...&limit=100&offset=50 # Pagination
tap://messages/msg-id-123 # Specific message
tap://deliveries
Access to message delivery tracking information.
tap://deliveries?agent_did=did:key:z6Mk... # Delivery records for specific agent
tap://deliveries?message_id=msg-123 # Deliveries for specific message
tap://deliveries?recipient_did=did:example:bob # Deliveries to specific recipient
tap://deliveries?delivery_type=https # Filter by delivery type (https/internal/return_path/pickup)
tap://deliveries?status=failed # Filter by status (pending/success/failed)
tap://deliveries?limit=50&offset=100 # Pagination
tap://deliveries/123 # Specific delivery record by ID
tap://database-schema
Access to database schema information for agent storage.
tap://database-schema?agent_did=did:key:z6Mk... # Complete schema for agent's database (required)
tap://database-schema?agent_did=did:key:z6Mk...&table_name=messages # Specific table schema
Returns comprehensive database schema information including:
- Table structures and column definitions
- Index information and constraints
- Row counts for each table
- Database path and metadata
This resource provides the same information as the tap_get_database_schema tool but through the MCP resource interface, making it more appropriate for read-only data access.
tap://schemas
JSON schemas for TAP message types with enhanced lookup capabilities.
tap://schemas # All TAP message schemas with version info
tap://schemas/Transfer # Specific schema for Transfer message type
tap://schemas/Authorize # Specific schema for Authorize message type
tap://schemas/Reject # Specific schema for Reject message type
tap://schemas/Settle # Specific schema for Settle message type
tap://schemas/Cancel # Specific schema for Cancel message type
Enhanced with individual schema lookup:
- Access specific message schemas by name (e.g.,
Transfer,Authorize) - Search by message type URL (e.g.,
https://tap.rsvp/schema/1.0#Transfer) - Includes comprehensive JSON schemas for all TAIP message types
- Version information and TAIP specification references
tap://received
Access to raw received messages before processing.
tap://received?agent_did=did:key:z6Mk... # Received messages for specific agent
tap://received?agent_did=did:key:z6Mk...&status=pending # Filter by status (pending/processed/failed)
tap://received?agent_did=did:key:z6Mk...&source_type=https # Filter by source type
tap://received?agent_did=did:key:z6Mk...&limit=50&offset=100 # Pagination
tap://received/123 # Specific received message by ID
Configuration
Environment Variables
TAP_ROOT: Default TAP root directory (default:~/.tap)TAP_DB_PATH: Database file path (default:$TAP_ROOT/tap-node.db)RUST_LOG: Logging level (debug, info, warn, error)
Directory Structure
~/.tap/ # TAP root directory
├── keys.json # Agent keys storage
├── did_key_z6MkpGuzuD38tpgZKPfm/ # Auto-generated agent directory
│ └── transactions.db # SQLite database for this agent
├── did_web_example.com/ # Manual agent directory
│ └── transactions.db # SQLite database for this agent
└── logs/ # Log files directory
Automatic Storage Initialization: When you create a new agent using tap_create_agent, TAP-MCP automatically:
- Generates a unique DID for the agent
- Creates a sanitized directory name from the DID (replacing
:with_) - Initializes a dedicated SQLite database for that agent's transactions
- Registers the agent with the TAP Node for message processing
Agent-Specific Storage: Each transaction operation (create, authorize, reject, cancel, settle, list) uses the storage database specific to the agent_did parameter. This ensures:
- Complete transaction isolation between different agents
- Scalable storage architecture as each agent manages its own data
- Clear audit trails per agent identity
- No cross-contamination of transaction data between agents
- Multi-agent transaction storage: transactions involving multiple agents are stored in all participating agents' databases
- Multi-recipient message delivery: messages are delivered to ALL recipients specified in the
tofield following DIDComm specification
Examples
Creating a Complete Transfer Flow
- Create agents for both parties:
# Create settlement agent for originator
| \
# Create compliance agent for beneficiary
| \
- Initiate transfer: (Note: Use the DID from the created agent)
|
- Authorize the transfer:
|
- Settle the transaction:
|
- Monitor transactions:
# List all transactions for a specific agent
| \
# List recent transfers for an agent
| \
# List recent messages
# Check delivery status for the transaction
# Check failed deliveries
# Get database schema for the agent
# Get schema for Transfer messages
# Get all message schemas
# List customers that the agent represents
| \
# List connections for a specific party
| \
Alternative Workflow: Rejecting a Transaction
If a transaction needs to be rejected instead of authorized:
# Reject with reason
|
Canceling a Transaction
Either party can cancel a transaction before settlement:
# Cancel transaction
|
Integration Examples
Claude Desktop
To configure Claude Desktop to use TAP-MCP, you need to add the server configuration to your Claude Desktop settings. The configuration file location depends on your operating system:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%/Claude/claude_desktop_config.json
Linux: ~/.config/Claude/claude_desktop_config.json
Option 1: Using the built binary (recommended for production)
First, build and install TAP-MCP:
Then add this configuration to your Claude Desktop config file:
Option 2: Using cargo run (for development)
Add this configuration to your Claude Desktop config file:
Configuration Options
--agent-did: (Optional) Specify an agent DID for organized storage. Creates database at~/.tap/{sanitized-did}/--tap-root: (Optional) Custom TAP root directory (default:~/.tap)--debug: Enable debug loggingTAP_ROOT: Environment variable alternative to--tap-rootRUST_LOG: Control log level (debug, info, warn, error)
Complete Example Configuration
Verifying the Configuration
After updating your Claude Desktop configuration:
- Restart Claude Desktop for the changes to take effect
- Check the Claude Desktop logs (usually in the app's menu under "View" → "Developer" → "Developer Tools")
- Test the connection by asking Claude: "List the available TAP tools"
You should see tools like tap_create_agent, tap_create_transfer, tap_authorize, etc.
Troubleshooting Claude Desktop Integration
If TAP-MCP doesn't appear in Claude Desktop:
- Check the config file syntax - ensure valid JSON formatting
- Verify file paths - make sure the
commandandmanifest-pathare correct - Check permissions - ensure Claude Desktop can execute the command
- Review logs - check Claude Desktop's developer console for error messages
- Test manually - try running the exact command from terminal first:
# Test the command manually
# Or if using the binary
Once configured, you can interact with TAP through Claude Desktop by asking questions like:
- "Create a new TAP agent for settlement services"
- "Show me recent TAP transactions"
- "Help me authorize a transfer transaction"
- "List all customers that my agent represents"
- "Show me connections for a specific party"
Python MCP Client
# Initialize the session
await
# List available tools
= await
# Create an agent
= await
# Create a transfer transaction
= await
# Authorize the transaction
= await
# List recent transactions
= await
# List customers of the agent
= await
# List connections for a specific party
= await
Troubleshooting
Common Issues
-
Database Connection Errors
# Ensure TAP Node has initialized the database -
Permission Errors
# Check file permissions -
Missing Dependencies
# Rebuild with all features
Debug Mode
Enable detailed logging for troubleshooting:
RUST_LOG=debug
Testing the Connection
Test basic MCP connectivity:
# Send a simple initialize request
|
Development
Running Tests
# Run all tests
# Run with output
# Run specific test
Adding New Tools
- Create tool implementation in
src/tools/ - Add to tool registry in
src/tools/mod.rs - Add JSON schema in
src/tools/schema.rs - Update documentation
Contributing
- Fork the repository
- Create a feature branch
- Add tests for new functionality
- Ensure all tests pass
- Submit a pull request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Related Projects
- TAP-RS - Core TAP implementation in Rust
- tap-cli - Command-line interface for TAP Agent operations (terminal alternative to tap-mcp)
- Model Context Protocol - MCP specification and tools
- Claude Desktop - AI assistant with MCP support
Support
- GitHub Issues: Report bugs and request features
- Documentation: TAP Protocol Documentation
- Community: TAP Discord Server