Complete Documentation
Universal Crypto MCP - Full Documentation
This is a comprehensive guide to Universal Crypto MCP, the first AI-native blockchain infrastructure that combines a powerful MCP server with the x402 payment protocol.
📚 Documentation Structure
Getting Started
- Overview - What is Universal Crypto MCP and why use it
- Installation - Install and configure in minutes
- Quick Start - Your first blockchain transaction
- Configuration - Detailed configuration options
MCP Server
- Server Overview - Understanding the MCP server
- API Reference - Complete tool documentation (380+ tools)
- Tools Guide - How to use blockchain tools
- Architecture - System design and components
- ChatGPT Setup - Configure for ChatGPT
- Troubleshooting - Common issues and solutions
x402 Payment Protocol
- x402 Overview - Introduction to x402 payments
- Quick Start - Accept payments in 5 minutes
- Configuration - Payment gateway setup
- Deployment - Deploy to production
- Discovery Protocol - AI agent discovery network
- Providers - Deployment provider guides
Packages & Modules
- Core Package - @universal-crypto-mcp/core
- DeFi Package - @universal-crypto-mcp/defi
- Market Data - @universal-crypto-mcp/market-data
- Payments - @universal-crypto-mcp/payments
- Trading - @universal-crypto-mcp/trading
- Wallets - @universal-crypto-mcp/wallets
Tutorials
- AI Trading Agent - Build an automated trading bot
- Cross-Chain Portfolio - Multi-chain portfolio tracker
- DeFi Analytics - DeFi protocol analytics dashboard
- Security Scanner - Token security analyzer
- Paid API Service - Create a monetized AI service
Use Cases
- Portfolio Management - Track assets across chains
- Automated Trading - Execute trading strategies
- DeFi Interactions - Lending, borrowing, staking
- Payment Services - Accept crypto payments
- Data Services - Blockchain data APIs
🚀 Quick Navigation
By Role
AI Agent Developer 1. Installation 2. Quick Start 3. API Reference 4. Tutorials
API Developer 1. x402 Overview 2. Quick Start 3. Deployment Guide 4. Paid API Tutorial
Blockchain Developer 1. Architecture 2. Core Package 3. DeFi Package 4. Contributing
By Task
Setting Up - Install Universal Crypto MCP - Configure Environment - Connect to Claude
Blockchain Operations - Check Balances - Send Transactions - Swap Tokens - Query NFTs
Accepting Payments - Wrap Your API with x402 - Deploy to Production - Configure Pricing - Monitor Revenue
Building Projects - Trading Bot - Portfolio Tracker - DeFi Dashboard - Paid API
🔧 Core Concepts
Model Context Protocol (MCP)
MCP is an open protocol that standardizes how AI assistants connect to external data sources and tools.
Key Features: - JSON-RPC 2.0 based communication - Tool discovery and invocation - Resource management - Prompt templates
How it Works:
sequenceDiagram
participant AI as AI Agent (Claude)
participant MCP as MCP Server
participant BC as Blockchain
AI->>MCP: List available tools
MCP-->>AI: Returns 380+ blockchain tools
AI->>MCP: Call tool: get_balance(address, chain)
MCP->>BC: Query blockchain
BC-->>MCP: Return balance data
MCP-->>AI: Format and return result
x402 Payment Protocol
x402 is an HTTP 402-based protocol for AI agent payments using cryptocurrency.
Key Features: - HTTP 402 Payment Required status - On-chain payment verification - Automatic escrow and settlement - AI agent discovery network
How it Works:
sequenceDiagram
participant Agent as AI Agent
participant API as Paid API
participant Chain as Blockchain
participant Facilitator as x402 Facilitator
Agent->>API: GET /api/premium
API-->>Agent: 402 Payment Required + price
Agent->>Chain: Send payment transaction
Chain-->>Agent: Transaction hash
Agent->>API: GET /api/premium + x-payment header
API->>Facilitator: Verify payment
Facilitator->>Chain: Check transaction
Chain-->>Facilitator: Confirmed
Facilitator-->>API: Payment valid
API-->>Agent: 200 OK + premium data
Multi-Chain Support
Universal Crypto MCP provides a unified interface for 20+ blockchain networks.
Supported Networks:
EVM Chains: - Ethereum (mainnet, sepolia, goerli) - Arbitrum (one, nova) - Base (mainnet, sepolia) - Polygon (mainnet, mumbai) - Optimism (mainnet, goerli) - BNB Chain (mainnet, testnet) - Avalanche (c-chain, fuji) - Fantom (mainnet, testnet) - zkSync Era - Linea - Scroll - Blast - Mode - Mantle
Other Chains: - Solana (mainnet, devnet, testnet)
DeFi Protocol Integration
Supported Protocols: - DEXes: Uniswap V2/V3, SushiSwap, PancakeSwap, Curve - Lending: Aave V2/V3, Compound V2/V3, Maker - Derivatives: GMX, Synthetix, dYdX - Yield: Yearn, Convex, Beefy
💡 Common Patterns
Pattern 1: Multi-Chain Balance Check
// Check balances across all supported chains
const chains = ['ethereum', 'arbitrum', 'base', 'polygon', 'optimism'];
const address = '0x...';
for (const chain of chains) {
const balance = await getBalance(address, chain);
console.log(`${chain}: ${balance} ETH`);
}
Pattern 2: Conditional Token Swap
// Swap ETH to USDC if price drops below threshold
const ethPrice = await getTokenPrice('ETH', 'USD');
if (ethPrice < 2000) {
await swapTokens({
from: 'ETH',
to: 'USDC',
amount: '0.5',
chain: 'arbitrum'
});
}
Pattern 3: Paid API with x402
import express from 'express';
import { wrapWithX402 } from '@nirholas/universal-crypto-mcp/x402';
const app = express();
// Regular API endpoint
app.get('/api/free', (req, res) => {
res.json({ message: 'Free data' });
});
// Paid API endpoint
app.get('/api/premium', (req, res) => {
res.json({ data: 'Premium content' });
});
// Wrap with x402 payment gateway
wrapWithX402(app, {
pricing: {
'GET /api/premium': '$0.001'
},
wallet: '0x...'
});
app.listen(3000);
Pattern 4: AI Agent Discovery
import { discoverServices } from '@nirholas/universal-crypto-mcp/x402';
// Find weather APIs under $0.01 per request
const services = await discoverServices({
category: 'weather',
maxPrice: '$0.01',
minRating: 4.0
});
// Use the best service
const service = services[0];
const weather = await service.call('get_forecast', {
city: 'New York'
}, {
payment: {
amount: service.price,
token: 'USDC',
network: 'arbitrum'
}
});
📖 API Reference Quick Links
Blockchain Operations
Token Operations
DeFi Operations
NFT Operations
Market Data
x402 Operations
🎓 Learning Path
Beginner Track
- Week 1: Setup & Basics
- Install Universal Crypto MCP
- First Transaction Tutorial
-
Practice: Check balances, send small amounts
-
Week 2: Multi-Chain
- Understanding Chains
- Cross-Chain Tutorial
-
Practice: Query multiple chains, compare prices
-
Week 3: DeFi Basics
- DeFi Overview
- Token Swap Tutorial
-
Practice: Swap tokens, check liquidity
-
Week 4: Build Project
- Trading Bot Tutorial
- Build your own simple bot
- Practice: Automated operations
Intermediate Track
- Payments & Monetization
- x402 Protocol Overview
- Create Paid API
-
Build: Simple paid service
-
Advanced DeFi
- Lending & Borrowing
- Yield Strategies
-
Build: DeFi dashboard
-
Security & Best Practices
- Security Guide
- Error Handling
- Build: Security scanner
Advanced Track
- Custom Integrations
- Architecture Deep Dive
- Plugin Development
-
Build: Custom protocol integration
-
Production Deployment
- Deployment Guide
- Scaling Strategies
-
Deploy: Production service
-
Contributing
- Contributing Guide
- Code Standards
- Contribute: PR to the project
🔗 External Resources
Official Links
- GitHub: nirholas/universal-crypto-mcp
- npm: @nirholas/universal-crypto-mcp
- Documentation: mcp.giving
Community
- Discussions: GitHub Discussions
- Issues: GitHub Issues
- Discord: Coming soon
Related Projects
- MCP Protocol: modelcontextprotocol.io
- Claude: claude.ai
- x402 Protocol: x402.dev
📄 License
Universal Crypto MCP is open source under the Apache 2.0 License.
🤝 Support
Need help? Check these resources:
- FAQ - Frequently asked questions
- Troubleshooting - Common issues
- GitHub Issues - Bug reports
- Discussions - General questions