This document provides instructions for Claude Desktop agents to interact with the TAP-RS (Transaction Authorization Protocol - Rust) system through the Model Context Protocol (MCP).
TAP-RS is a Rust implementation of the Transaction Authorization Protocol that enables secure, compliant cryptocurrency transactions. Through MCP, you can:
- Create and manage TAP agents
- Send and receive TAP messages
- Track message deliveries
- Monitor transaction status
First, list all registered TAP agents:
Resource: tap://agents
This will show you all agents with their DIDs, roles, and metadata.
To create a new TAP agent:
Tool: create_agent
Parameters:
{
"label": "My Trading Desk" // Optional human-readable name
}
This creates an ephemeral agent with a new DID. The response includes:
agent_did: The agent's decentralized identifierlabel: The human-readable label
To initiate a cryptocurrency transfer:
Tool: send_transfer
Parameters:
{
"agent_did": "did:key:z6Mk...", // Your agent's DID
"to_did": "did:key:z6Mk...", // Recipient's DID
"asset": "eip155:1/erc20:0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", // USDC on Ethereum
"amount": "1000.00",
"originator_name": "John Doe",
"beneficiary_name": "Jane Smith"
}
The response includes:
message_id: Unique identifier for trackingdelivery_results: Status of delivery to each recipient
To authorize a transfer:
Tool: send_authorize
Parameters:
{
"agent_did": "did:key:z6Mk...",
"to_did": "did:key:z6Mk...",
"transaction_id": "tx-123",
"settlement_address": "eip155:1:0x742d35Cc6634C0532925a3b844Bc9e7595f2bD6e"
}
To see all message deliveries for an agent:
Resource: tap://deliveries?agent_did=did:key:z6Mk...
You can filter deliveries by various criteria:
Resource: tap://deliveries?agent_did=did:key:z6Mk...&status=failed
Resource: tap://deliveries?agent_did=did:key:z6Mk...&delivery_type=https
Resource: tap://deliveries?agent_did=did:key:z6Mk...&message_id=msg-123
Resource: tap://deliveries/42
Each delivery record contains:
id: Unique delivery IDmessage_id: ID of the message being deliveredmessage_text: The full signed/encrypted messagerecipient_did: DID of the intended recipientdelivery_url: HTTP endpoint (for external deliveries)delivery_type: Type of delivery (https, internal, return_path, pickup)status: Current status (pending, success, failed)retry_count: Number of delivery attemptslast_http_status_code: HTTP response code (for external deliveries)error_message: Error details if failedcreated_at,updated_at,delivered_at: Timestamps
Resource: tap://messages?agent_did=did:key:z6Mk...
Resource: tap://messages?agent_did=did:key:z6Mk...&direction=incoming
Resource: tap://messages?agent_did=did:key:z6Mk...&type=https://tap.rsvp/schema/1.0#Transfer
Resource: tap://messages?agent_did=did:key:z6Mk...&thread_id=tx-123
Resource: tap://messages/msg-123
- Originator creates transfer:
Tool: send_transfer
Parameters: {
"agent_did": "did:key:originator",
"to_did": "did:key:beneficiary_vasp",
"asset": "eip155:1/erc20:0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"amount": "1000.00",
"originator_name": "John Doe",
"beneficiary_name": "Jane Smith"
}
- Check delivery status:
Resource: tap://deliveries?agent_did=did:key:originator&message_id=<message_id_from_step_1>
- Beneficiary VASP views received transfer:
Resource: tap://messages?agent_did=did:key:beneficiary_vasp&type=https://tap.rsvp/schema/1.0#Transfer
- Beneficiary VASP authorizes:
Tool: send_authorize
Parameters: {
"agent_did": "did:key:beneficiary_vasp",
"to_did": "did:key:originator",
"transaction_id": "<transaction_id_from_transfer>",
"settlement_address": "eip155:1:0x742d35Cc6634C0532925a3b844Bc9e7595f2bD6e"
}
internal: Message delivered to another agent on the same TAP nodehttps: Message delivered via HTTP to an external TAP nodereturn_path: Response delivered back through the original connectionpickup: Message stored for later retrieval by recipient
pending: Delivery attempt in progresssuccess: Successfully delivered (HTTP 2xx response or internal delivery)failed: Delivery failed (network error, HTTP error, or recipient not found)
- Always Check Delivery Status: After sending a message, check the delivery status to ensure it was received
- Monitor Failed Deliveries: Regularly check for failed deliveries that may need manual intervention
- Use Thread IDs: Keep track of transaction threads to follow the complete message flow
- Handle Errors Gracefully: Check error messages in failed deliveries for troubleshooting
The recipient's DID could not be resolved to an endpoint. Verify the recipient DID is correct.
The recipient's server rejected the message. This could be due to authorization issues or policy violations.
The recipient's DID document doesn't contain a service endpoint. They may not be set up to receive TAP messages.
To monitor all your agent's activities:
# Pseudo-code for monitoring
agent_did = "did:key:z6Mk..."
# Check recent messages
messages = fetch("tap://messages?agent_did={agent_did}&limit=10")
# Check delivery status
deliveries = fetch("tap://deliveries?agent_did={agent_did}&limit=10")
# Alert on failures
failed = fetch("tap://deliveries?agent_did={agent_did}&status=failed")
if failed.total > 0:
alert("Failed deliveries detected!")create_agent: Create a new TAP agentsend_transfer: Send a transfer messagesend_authorize: Send an authorization messagesend_reject: Reject a transactionsend_cancel: Cancel a transactionsend_settle: Mark a transaction as settled
tap://agents: List all agentstap://messages: View messages with filteringtap://deliveries: Track message deliveriestap://schemas: View TAP message schemas
Remember: All message delivery is automatically tracked. You don't need to manually create delivery records - they're created automatically whenever you send a message.