Build an AI Agent with MCP

Connect Claude or any MCP-compatible AI to your DUAL instance using the Model Context Protocol server.

20 minAdvanced

Prerequisites

  • Node.js 18+ installed
  • A DUAL account with API key
  • Claude Desktop, Cursor, or Claude Code installed

What You'll Build

The Model Context Protocol (MCP) lets AI agents interact with external tools natively. DUAL's MCP server exposes 80 tools across 14 API modules — meaning an AI agent can create templates, mint tokens, execute actions, and query data using natural language. In this tutorial you'll install the server, connect it to Claude, and build a complete tokenization workflow driven by conversation.

Step 1 — Configure Claude Desktop

The DUAL MCP server is hosted — no local installation required. Add it to your Claude Desktop config:

json
{
  "mcpServers": {
    "dual": {
      "url": "https://mcp.blockv.io/mcp",
      "headers": {
        "X-API-Key": "your-api-key-here"
      }
    }
  }
}

Config file locations:

PlatformPath
macOS~/Library/Application Support/Claude/claude_desktop_config.json
Windows%APPDATA%\Claude\claude_desktop_config.json
Linux~/.config/Claude/claude_desktop_config.json

Restart Claude Desktop after saving.

Step 2 — Authenticate via Chat

If you didn't set an API key, authenticate interactively:

text
You: Log me into DUAL with email dev@example.com

Claude: [calls dual_login] Logged in as dev@example.com. Session authenticated.

Step 3 — Build a Token with Natural Language

Describe what you want and let the AI handle the API calls:

text
You: Create a reward token template called "Coffee Stamp Card" with properties
     for stamps (number, default 0), max_stamps (10), and redeemed (false).

Claude: [calls dual_create_template]
        Created template "Coffee Stamp Card" (ID: tmpl_abc123).

You: Mint 5 of those for wallet "wallet_xyz"

Claude: [calls dual_execute_action to mint 5 objects]
        Minted 5 Coffee Stamp Card objects.

You: Set up a webhook to notify me when any get redeemed

Claude: [calls dual_create_webhook]
        Webhook created for object.updated events.

Step 4 — Available Modules

The MCP server exposes 14 modules with 80 tools total:

ModuleToolsDescription
Wallets10Auth, registration, profile
Organizations10Multi-tenant workspaces
Templates7Token blueprint CRUD
Objects8Token instances, search
Actions7Event Bus operations
Faces6Visual representations
Storage4File management
Webhooks6Real-time notifications
Notifications5Message sending
Sequencer4Batch and ZK queries
API Keys3Access management
Payments2Deposits and config
Support3Feature requests
Public API5Read-only (no auth)

Alternative: Claude Code CLI

bash
claude mcp add dual --transport sse https://mcp.blockv.io/mcp
Hosted Server: The DUAL MCP server is hosted at mcp.blockv.io — no local setup required. Your API key is sent securely via the X-API-Key header over HTTPS.

Summary

You've connected an AI agent to the DUAL platform via MCP. The agent can now autonomously create templates, mint tokens, manage organizations, and execute actions through natural conversation. For the full reference, see the MCP Server docs and Setup Guide.