Build an AI Agent with MCP
Connect Claude or any MCP-compatible AI to your DUAL instance using the Model Context Protocol server.
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 — Install the MCP Server
git clone https://github.com/ro-ro-b/dual-mcp-server.git
cd dual-mcp-server
npm install
npm run buildStep 2 — Configure Claude Desktop
Add the DUAL server to your Claude Desktop config:
{
"mcpServers": {
"dual": {
"command": "node",
"args": ["/path/to/dual-mcp-server/dist/index.js"],
"env": {
"DUAL_API_KEY": "your-api-key-here"
}
}
}
}Config file locations:
| Platform | Path |
|---|---|
| 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 3 — Authenticate via Chat
If you didn't set an API key, authenticate interactively:
You: Log me into DUAL with email dev@example.com
Claude: [calls dual_login] Logged in as dev@example.com. Session authenticated.Step 4 — Build a Token with Natural Language
Describe what you want and let the AI handle the API calls:
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 5 — Available Modules
The MCP server exposes 14 modules with 80 tools total:
| Module | Tools | Description |
|---|---|---|
| Wallets | 10 | Auth, registration, profile |
| Organizations | 10 | Multi-tenant workspaces |
| Templates | 7 | Token blueprint CRUD |
| Objects | 8 | Token instances, search |
| Actions | 7 | Event Bus operations |
| Faces | 6 | Visual representations |
| Storage | 4 | File management |
| Webhooks | 6 | Real-time notifications |
| Notifications | 5 | Message sending |
| Sequencer | 4 | Batch and ZK queries |
| API Keys | 3 | Access management |
| Payments | 2 | Deposits and config |
| Support | 3 | Feature requests |
| Public API | 5 | Read-only (no auth) |
Alternative: Claude Code CLI
claude mcp add dual node /path/to/dual-mcp-server/dist/index.jsSummary
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.