Tutorial

Connect via MCP

MCP (Model Context Protocol) is a standard for connecting AI models to external tools. Vouch exposes an MCP server that lets any compatible AI agent look up identities, verify trust, and discover agents — no SDK needed, no API key, just an SSE endpoint.

What Is MCP?

MCP is an open protocol created by Anthropic for connecting AI models to tools and data sources. It uses a client-server architecture where AI models (clients) connect to tool providers (servers) via JSON-RPC over Server-Sent Events (SSE). Vouch runs an MCP server that exposes agent identity operations as tools.

No SDK, no API key. MCP tools are invoked by the AI model itself. You just point your MCP-compatible client at the Vouch endpoint and the tools become available automatically.

Step 1 — Add the MCP Configuration

Add the Vouch MCP server to your client configuration. For Claude and Claude Code, add this to your MCP settings:

MCP Configuration
{
  "mcpServers": {
    "vouch": {
      "url": "https://api.vouchprotocol.xyz/mcp/sse"
    }
  }
}

That's it. Once connected, the AI model has access to all Vouch tools.

Step 2 — Look Up an Agent

Use the lookup_agent tool to fetch details about an agent before interacting with it.

lookup_agent

Look up an agent by owner wallet address or agent PDA. Returns identity, tier, reputationScore, capabilities, and Agent Card URL.

MCP Tool Call
// The AI model calls this automatically when you ask:
// "Look up the agent owned by 7xKXtg..."

{
  "tool": "lookup_agent",
  "arguments": {
    "query": "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU"
  }
}

// Response:
{
  "did": "did:sol:7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",
  "name": "my-commerce-agent",
  "owner": "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",
  "pda": "AgentPda111111111111111111111111111111111111",
  "tier": "standard",
  "status": "active",
  "reputationScore": 720,
  "capabilities": 7,
  "serviceCategory": "commerce",
  "version": "1.0.0",
  "agentCardUrl": "https://example.com/agent-card.json",
  "createdAt": "2026-02-15T10:30:00.000Z",
  "updatedAt": "2026-03-10T14:22:00.000Z"
}

Step 3 — Verify an Agent

Use verify_agent to check if an agent meets your trust requirements before transacting.

verify_agent

Verify that an agent is active and meets minimum tier/reputationScore requirements. Returns a verified boolean, agent name, DID, and an array of check results.

MCP Tool Call
{
  "tool": "verify_agent",
  "arguments": {
    "owner": "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",
    "minTier": "basic",
    "minReputation": 500
  }
}

// Response:
{
  "verified": true,
  "agent": "my-commerce-agent",
  "did": "did:sol:7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",
  "checks": [
    {
      "check": "active",
      "passed": true,
      "detail": "Agent is active"
    },
    {
      "check": "tier",
      "passed": true,
      "detail": "Agent tier standard meets minimum basic"
    },
    {
      "check": "reputation",
      "passed": true,
      "detail": "Reputation 720 meets minimum 500"
    }
  ]
}

Step 4 — Discover Agents

Use list_agents to discover agents by category or tier.

list_agents

Search and filter agents by service category, minimum tier, or status. Returns a paginated list.

MCP Tool Call
{
  "tool": "list_agents",
  "arguments": {
    "category": "commerce",
    "tier": "standard"
  }
}

// Response:
{
  "total": 3,
  "agents": [
    {
      "did": "did:sol:7xKXtg2CW87d97TXJSDpHD4vMvnQ1985FchZRgCd9oPr",
      "name": "CommerceBot",
      "tier": "standard",
      "reputationScore": 720,
      "serviceCategory": "commerce",
      "status": "active"
    }
  ]
}

Step 5 — Check Reputation

check_reputation

Get the reputation score and history for a Vouch-registered agent. Returns DID, name, reputationScore, tier, status, and recent score-change history.

MCP Tool Call
{
  "tool": "check_reputation",
  "arguments": {
    "owner": "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU"
  }
}

// Response:
{
  "did": "did:sol:7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",
  "name": "my-commerce-agent",
  "reputationScore": 720,
  "tier": "standard",
  "status": "active",
  "recentHistory": [
    {
      "old_value": 710,
      "new_value": 720,
      "delta": 10,
      "timestamp": "2026-03-10T14:22:00.000Z"
    }
  ]
}

Step 6 — Register via MCP

You can even register a new agent from within an AI workflow using a two-step process:

prepare_register_agent

Prepare an unsigned registration transaction. Returns a base64-encoded transaction that needs to be signed.

submit_transaction

Submit a signed transaction to Solana. Used after the wallet signs the prepared transaction.

MCP Tool Calls
// Step 1: Prepare the transaction
{
  "tool": "prepare_register_agent",
  "arguments": {
    "ownerPubkey": "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",
    "name": "my-agent",
    "serviceCategory": "commerce",
    "agentCardUrl": "https://example.com/agent-card.json",
    "agentCardHash": [171, 23, 55, 198, 42, 91, 7, 220, 131, 65, 88, 14, 247, 102, 33, 176,
      59, 200, 144, 18, 73, 250, 5, 112, 163, 89, 201, 44, 77, 156, 232, 119]
  }
}

// Step 2: Sign the returned serializedTx, then submit
{
  "tool": "submit_transaction",
  "arguments": {
    "txId": "tx_01HXYZ...",
    "signedTx": "base64-encoded-signed-tx"
  }
}

Sign-and-submit workflow. When prepare_register_agent (or any prepare_* tool) returns a serializedTx, the developer must: 1) decode the base64 string into a Solana Transaction or VersionedTransaction, 2) sign it with the owner wallet keypair, 3) re-encode the signed transaction to base64, 4) call submit_transaction with the txId from the prepare response and the base64-encoded signedTx.

Step 7 — Resolve a DID

Use resolve_did to resolve a did:sol: URI into a W3C DID Document and the associated Vouch agent identity.

resolve_did

Resolve a did:sol URI to a W3C DID Document and Vouch agent identity. Returns the DID Document with verification methods and service endpoints, plus the agent's name, tier, status, reputationScore, and Agent Card URL.

MCP Tool Call
{
  "tool": "resolve_did",
  "arguments": {
    "did": "did:sol:7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU"
  }
}

// Response:
{
  "did": "did:sol:7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",
  "didDocument": {
    "@context": ["https://www.w3.org/ns/did/v1", "..."],
    "id": "did:sol:7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",
    "verificationMethod": [{ "type": "Ed25519VerificationKey2020", "...": "..." }],
    "service": [
      { "id": "...#agent-card", "type": "A2AAgentCard", "serviceEndpoint": "https://example.com/agent-card.json" },
      { "id": "...#vouch-registry", "type": "VouchRegistry", "serviceEndpoint": "solana:<programId>:<pda>" }
    ]
  },
  "agent": {
    "name": "my-commerce-agent",
    "tier": "standard",
    "status": "active",
    "reputationScore": 720,
    "agentCardUrl": "https://example.com/agent-card.json"
  }
}

Step 8 — Check Credentials

Use check_credentials to see what W3C Verifiable Credentials an agent holds, such as security audits, compliance certs, or capability attestations.

check_credentials

Check what W3C Verifiable Credentials a Vouch-registered agent holds. Optionally filter by credential type or return only currently valid credentials.

MCP Tool Call
{
  "tool": "check_credentials",
  "arguments": {
    "owner": "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",
    "type": "SecurityAuditCredential",
    "activeOnly": true
  }
}

// Response:
{
  "did": "did:sol:7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",
  "agent": "my-commerce-agent",
  "totalCredentials": 1,
  "credentials": [
    {
      "type": "SecurityAuditCredential",
      "issuer": "did:sol:AuditorPubkey1111111111111111111111111111",
      "credentialUrl": "https://auditor.example.com/creds/abc123",
      "validFrom": "2026-01-15T00:00:00.000Z",
      "validUntil": "2027-01-15T00:00:00.000Z",
      "structurallyValid": true
    }
  ]
}

Practical Scenario: Pre-Payment Verification

Here is a real-world workflow. Before your AI agent pays another agent for a service, verify the provider:

AI Agent Workflow
// Your AI agent's reasoning:
// 1. "I need to pay agent X for a data service."
// 2. "First, let me verify they're trustworthy."

// Tool call: verify_agent
{
  "tool": "verify_agent",
  "arguments": {
    "owner": "SellerPubkey111111111111111111111111111111",
    "minTier": "basic",
    "minReputation": 500
  }
}

// If verified: true → proceed with payment
// If verified: false → refuse or ask for human approval

Next Steps