Quickstart¶
This guide will have you generating MCP servers from smart contracts in under 5 minutes.
Prerequisites¶
- Python 3.10 or higher
- pip or pipx
- (Optional) An Etherscan API key for better rate limits
Step 1: Install abi-to-mcp¶
Verify the installation:
Step 2: Generate from a Contract Address¶
Let's generate an MCP server for the USDC stablecoin on Ethereum mainnet:
abi-to-mcp generate 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 \
--network mainnet \
--output ./usdc-mcp
This will:
- Fetch the verified ABI from Etherscan
- Parse the contract to identify functions and events
- Detect that this is an ERC-20 token
- Generate a complete MCP server in
./usdc-mcp/
You'll see output like:
✓ Fetched ABI from Etherscan (mainnet)
✓ Detected ERC20 standard
✓ Parsed 13 functions, 2 events
✓ Generated 13 tools, 2 resources
MCP server generated successfully!
Output: ./usdc-mcp/
Next steps:
cd ./usdc-mcp
cp .env.example .env
# Edit .env to configure RPC_URL
pip install -r requirements.txt
python server.py
Step 3: Inspect the Output¶
You'll see:
usdc-mcp/
├── server.py # The MCP server
├── config.py # Configuration settings
├── README.md # Usage documentation
├── requirements.txt # Python dependencies
├── pyproject.toml # Package configuration
└── .env.example # Environment variable template
Step 4: Configure and Run¶
Create your environment file:
Edit .env to add your RPC URL:
Install dependencies and run:
The server will start and wait for MCP connections.
Step 5: Add to Claude Desktop¶
Add this to your claude_desktop_config.json:
Location: ~/Library/Application Support/Claude/claude_desktop_config.json
Location: %APPDATA%\Claude\claude_desktop_config.json
Use Absolute Paths
Always use absolute paths in Claude Desktop configuration, not relative paths like ./ or ~.
Restart Claude Desktop, and you can now ask Claude questions about USDC!
Alternative: Generate from Local ABI¶
If you have an ABI file already (from Hardhat, Foundry, or downloaded):
abi-to-mcp generate ./my-contract-abi.json \
--address 0xYourContractAddress \
--network mainnet \
--output ./my-mcp-server
The ABI file can be:
- Plain ABI array:
[{"type": "function", ...}] - Hardhat artifact:
{"abi": [...], "contractName": "..."} - Foundry output:
{"abi": [...]}
Try Other Contracts¶
Here are some popular contracts to try:
What's Next?¶
- First MCP Server - Detailed walkthrough of the generated code
- CLI Reference - All command options
- Claude Desktop Guide - Integration tips
- Safety Features - Understanding simulation and safety