Universal Contract AI Interface (UCAI)

Universal Contract AI Interface (UCAI) ๐Ÿ”— ABI to MCP | The open standard for connecting AI agents to blockchain. MCP server generator for smart contracts. Claude + Uniswap, Aave, ERC20, NFTs, DeFi. Python CLI, Web3 integration, transaction simulation. Polygon, Arbitrum, Base, Ethereum EVM chains. Claude, GPT, LLM tooling, Solidity, OpenAI.

Universal Contract AI Interface

The ABI-to-MCP Server Generator

    โ–ˆโ–ˆโ•—   โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•—
    โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘
    โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘     โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘
    โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘     โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘
    โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘  โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘
     โ•šโ•โ•โ•โ•โ•โ•  โ•šโ•โ•โ•โ•โ•โ•โ•šโ•โ•  โ•šโ•โ•โ•šโ•โ•
                                
    Any contract. One command. Claude speaks it.

PyPI version Python 3.10+ License: MIT MCP Compatible UCAI Standard


๐ŸŒ Try It Live โ€” No Install Required

mcp.ucai.tech โ€” Generate MCP servers directly in your browser.

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
โ”‚                                                                                
โ”‚   ๐ŸŒ MCP BUILDER                                          [Connect Wallet]     
โ”‚                                                                                
โ”‚   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€  
โ”‚   โ”‚  โšก Pro Templates    โ”‚    ๐Ÿ”ง Custom Contract                                
โ”‚   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€  
โ”‚                                                                               
โ”‚   ๐Ÿ›ก๏ธ Security Scanner: Score 87/100 โœ… Low Risk                                
โ”‚   โ”œโ”€โ”€ โœ… Contract verified on Etherscan                                         
โ”‚   โ”œโ”€โ”€ โœ… Uses OpenZeppelin (audited)                                            
โ”‚   โ”œโ”€โ”€ โš ๏ธ  Owner can pause transfers                                             
โ”‚   โ””โ”€โ”€ โš ๏ธ  Mint function detected                                                
โ”‚                                                                                 
โ”‚   ๐Ÿ“– What This Contract Does:                                                  
โ”‚   "ERC-20 token with standard transfer, approve, and allowance functions."     
โ”‚                                                                                
โ”‚   [๐Ÿ“ฅ Download Server]  [๐Ÿ”— Share Link]  [๐Ÿ“‹ Copy Config]                       
โ”‚                                                                                
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€

Features:

  • ๐Ÿ›ก๏ธ Security Scanner โ€” Detects rug pulls, honeypots, and 50+ risks before you connect
  • ๐Ÿ“– Contract Whisperer โ€” Explains contracts in plain English
  • โšก Pro Templates โ€” Pre-built bundles for Flash Loans, Arbitrage, Yield Aggregators
  • ๐ŸŒ™ Dark/Light Mode โ€” Easy on the eyes
  • ๐Ÿ“ฅ ZIP Download โ€” Complete server with server.py, requirements.txt, README.md
  • ๐Ÿ”— Share Links โ€” Send ?address=0x...&network=ethereum to anyone

Overview

  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
  โ”‚                                                                          โ”‚
  โ”‚   1. FIND                      2. GENERATE                 3. DONE       โ”‚
  โ”‚                                                                          โ”‚
  โ”‚   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”         โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚
  โ”‚   โ”‚   Etherscan     โ”‚         โ”‚                 โ”‚     โ”‚               โ”‚  โ”‚
  โ”‚   โ”‚   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”‚         โ”‚  $ abi-to-mcp   โ”‚     โ”‚    Claude     โ”‚  โ”‚
  โ”‚   โ”‚   โ”‚ Contractโ”‚   โ”‚  โ”€โ”€โ”€โ”€โ–ถ  โ”‚    generate     โ”‚ โ”€โ”€โ–ถ โ”‚   ๐Ÿ”Œ Tools    โ”‚  โ”‚
  โ”‚   โ”‚   โ”‚   ABI   โ”‚   โ”‚         โ”‚    0x7a25...    โ”‚     โ”‚               โ”‚  โ”‚
  โ”‚   โ”‚   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ”‚         โ”‚                 โ”‚     โ”‚  "Swap 1 ETH" โ”‚  โ”‚
  โ”‚   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜         โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
  โ”‚                                                                          โ”‚
  โ”‚        Any contract              One command             AI speaks it    โ”‚
  โ”‚                                                                          โ”‚
  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Found a contract on Etherscan? One command. Claude can now use it.

pip install abi-to-mcp

# Uniswap โ€” Claude can swap tokens
abi-to-mcp generate 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D -o ~/uniswap-server

# ETH 2.0 Beacon Deposit โ€” Claude can explore staking
abi-to-mcp generate 0x00000000219ab540356cBB839Cbe05303d7705Fa -o ~/eth-staking-server

# Any verified contract works
abi-to-mcp generate <ANY_CONTRACT_ADDRESS>

That's it. Every function, every event, every query โ€” now a Claude tool.


Quick Start

1. Generate a server

abi-to-mcp generate 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D -o ~/uniswap-server
cd ~/uniswap-server && pip install -r requirements.txt

2. Connect to Claude Desktop

Add to your config (~/Library/Application Support/Claude/claude_desktop_config.json on Mac):

{
  "mcpServers": {
    "uniswap": {
      "command": "python",
      "args": ["/Users/YOU/uniswap-server/server.py"],
      "env": {
        "RPC_URL": "https://eth.llamarpc.com"
      }
    }
  }
}

3. Ask Claude anything

  • "What's the best route to swap 1 ETH for USDC?"
  • "Get the reserves for the ETH/DAI pool"
  • "Show me recent swaps on Uniswap"

Claude now speaks DeFi.


Example

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  YOU                                                                       โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  "What's the best route to swap 1 ETH for USDC on Uniswap?"                โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                    โ”‚
                                    โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  CLAUDE                                                                    โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  I'll check the Uniswap router for the best path...                        โ”‚
โ”‚                                                                            โ”‚
โ”‚  โœ… Called: getAmountsOut(1 ETH, [WETH, USDC])                             โ”‚
โ”‚                                                                            โ”‚
โ”‚  Best route: ETH โ†’ WETH โ†’ USDC                                             โ”‚
โ”‚  You would receive: 3,847.23 USDC                                      m   โ”‚
โ”‚  Price impact: 0.02%                                                       โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                    โ”‚
                                    โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  YOU                                                                       โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  "Do it. Swap 1 ETH for USDC."                                             โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                    โ”‚
                                    โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  CLAUDE                                                                    โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  ๐Ÿ”’ Simulating transaction first...                                        โ”‚
โ”‚                                                                            โ”‚
โ”‚  โœ… Simulation successful                                                  โ”‚
โ”‚  Gas estimate: 152,847 (~$3.42)                                            โ”‚
โ”‚  Expected output: 3,847.23 USDC                                            โ”‚
โ”‚                                                                            โ”‚
โ”‚  Ready to execute. Confirm? [Yes/No]                                       โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

The UCAI Standard

UCAI (Universal Contract AI Interface) is a standard for how AI agents interact with smart contracts.

โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—
โ•‘                                                                               โ•‘
โ•‘   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”      โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”      โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”      โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ•‘
โ•‘   โ”‚         โ”‚      โ”‚              โ”‚      โ”‚              โ”‚      โ”‚          โ”‚   โ•‘
โ•‘   โ”‚  Claude โ”‚โ”€โ”€โ”€โ”€โ”€โ–ถโ”‚  abi-to-mcp  โ”‚โ”€โ”€โ”€โ”€โ”€โ–ถโ”‚  MCP Server  โ”‚โ”€โ”€โ”€โ”€โ”€โ–ถโ”‚  Chain   โ”‚   โ•‘
โ•‘   โ”‚         โ”‚      โ”‚   generate   โ”‚      โ”‚ (your tools) โ”‚      โ”‚   โ›“๏ธ     โ”‚   โ•‘
โ•‘   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜      โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜      โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜      โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ•‘
โ•‘        โ”‚                                        โ”‚                     โ”‚       โ•‘
โ•‘        โ”‚              "swap 1 ETH"              โ”‚    call swap()      โ”‚       โ•‘
โ•‘        โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜       โ•‘
โ•‘                                                                               โ•‘
โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

UCAI defines

  • ๐Ÿ“‹ Tool schemas โ€” How contract functions become AI-callable tools
  • ๐Ÿ”„ Type mappings โ€” Solidity โ†’ JSON Schema โ†’ Python
  • ๐Ÿ”’ Safety patterns โ€” Simulation-first for all state changes
  • ๐Ÿ“ก Event queries โ€” Historical data access patterns

Why UCAI

  • ๐Ÿ” Repeatable โ€” Same pattern works for ERC20, ERC721, DeFi, DAOs, Solana, anything
  • ๐Ÿ”’ Safe by default โ€” All write operations simulate first
  • ๐ŸŒ Universal โ€” Works on any chain, with any AI agent
  • ๐Ÿค– AI-native โ€” Designed specifically for LLM tool-calling

Every contract becomes AI-accessible through the same interface. No custom code per contract.

This package (abi-to-mcp) is the reference implementation of UCAI for MCP.


Why UCAI?

The Problem: You want AI to interact with smart contracts. But:

  • Writing MCP server boilerplate is tedious
  • Mapping Solidity types to JSON Schema is error-prone
  • Every contract needs the same patterns repeated
  • Safety (simulation, gas limits) is easy to forget

The Solution: One command generates a production-ready MCP server from any ABI.

Manual ApproachWith abi-to-mcp
Read contract ABIabi-to-mcp generate 0x...
Write 15+ tool functionsโœ… Auto-generated
Map types (address โ†’ string, uint256 โ†’ string)โœ… Handled
Add transaction simulationโœ… Built-in
Handle events as resourcesโœ… Included
~2-4 hours per contract~10 seconds

Use Cases

  • AI Agent Builders โ€” Give your agent DeFi superpowers (swap, lend, vote)
  • Wallet Developers โ€” Let Claude explain and execute transactions
  • DAO Tooling โ€” AI-powered proposal creation, voting, treasury management
  • DeFi Dashboards โ€” Natural language queries for on-chain data
  • Vibecoders โ€” Ship faster with AI-generated blockchain tools

Real Examples

๐Ÿฆ„ Uniswap: Swap tokens with natural language

abi-to-mcp generate 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D -o ~/uniswap-server

Now ask Claude:

"What's the current rate for swapping 10 ETH to USDC?"

Claude calls getAmountsOut() and responds:

"10 ETH โ†’ 38,472.31 USDC via the WETH/USDC pool. Want me to simulate the swap?"


๐Ÿฆ Aave: Check your health factor

abi-to-mcp generate 0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2 -o ~/aave-server

"What's my health factor on Aave? Am I at risk of liquidation?"

Claude reads your position and warns you before it's too late.


๐ŸŽจ Any NFT: Explore collections

abi-to-mcp generate 0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D -o ~/bayc-server

"Who owns BAYC #8817? How many apes does that wallet have?"

Claude calls ownerOf() and balanceOf() to answer.


๐Ÿ”ฎ Your own contract

abi-to-mcp generate ./my-contract-abi.json --address 0x... -o ~/my-server

Any verified contract. Any local ABI. One command.


๐Ÿ›ก๏ธ Security Scanner

Before you connect Claude to a contract, know what you're dealing with. The security scanner analyzes contracts for 50+ risk patterns:

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  ๐Ÿ›ก๏ธ SECURITY REPORT                                         Score: 42/100      โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                                                                                โ”‚
โ”‚  ๐Ÿšจ CRITICAL                                                                   โ”‚
โ”‚  โ”œโ”€โ”€ Self-Destruct Function โ€” Contract can be destroyed                        โ”‚
โ”‚  โ””โ”€โ”€ tx.origin Authentication โ€” Vulnerable to phishing                         โ”‚
โ”‚                                                                                โ”‚
โ”‚  โš ๏ธ  HIGH                                                                      โ”‚
โ”‚  โ”œโ”€โ”€ Hidden Mint โ€” Owner can create unlimited tokens                           โ”‚
โ”‚  โ”œโ”€โ”€ Pausable โ€” Owner can freeze all transfers                                 โ”‚
โ”‚  โ””โ”€โ”€ Blacklist โ€” Owner can block specific addresses                            โ”‚
โ”‚                                                                                โ”‚
โ”‚  โœ… POSITIVES                                                                  โ”‚
โ”‚  โ”œโ”€โ”€ Contract verified on Etherscan                                            โ”‚
โ”‚  โ”œโ”€โ”€ Uses OpenZeppelin (audited library)                                       โ”‚
โ”‚  โ””โ”€โ”€ Has reentrancy protection                                                 โ”‚
โ”‚                                                                                โ”‚
โ”‚  [โš ๏ธ Proceed Anyway]                           [โŒ Cancel โ€” Too Risky]          โ”‚
โ”‚                                                                                โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Risk Detection Categories:

SeverityExamples
๐Ÿšจ Criticalselfdestruct, arbitrary delegatecall, tx.origin auth
โš ๏ธ HighHidden mint, pause, blacklist, adjustable fees, tx limits
โšก MediumTransfer restrictions, external calls, proxy patterns
โ„น๏ธ LowTimestamp dependence, unchecked math

Positive Indicators:

  • โœ… Contract verified on block explorer
  • โœ… Uses OpenZeppelin
  • โœ… Reentrancy guards
  • โœ… Ownership renounced
  • โœ… NatSpec documentation

Try it: mcp.ucai.tech โ€” Enter any contract address and click "๐Ÿ›ก๏ธ Scan"


๐Ÿ“– Contract Whisperer

Don't understand what a contract does? The Contract Whisperer explains it in plain English:

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  ๐Ÿ“– WHAT THIS CONTRACT DOES                                                    โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                                                                                โ”‚
โ”‚  Summary: Uniswap V2 Router โ€” Decentralized token exchange                     โ”‚
โ”‚                                                                                โ”‚
โ”‚  Main Functions:                                                               โ”‚
โ”‚  โ”œโ”€โ”€ ๐Ÿ“– getAmountsOut โ€” Calculate expected output for a swap                   โ”‚
โ”‚  โ”œโ”€โ”€ โœ๏ธ swapExactTokensForTokens โ€” Exchange tokens at market rate              โ”‚
โ”‚  โ”œโ”€โ”€ โœ๏ธ addLiquidity โ€” Provide liquidity to earn fees                          โ”‚
โ”‚  โ””โ”€โ”€ ๐Ÿ“– getReserves โ€” Check pool balances                                      โ”‚
โ”‚                                                                                โ”‚
โ”‚  Permissions:                                                                  โ”‚
โ”‚  โ”œโ”€โ”€ ๐ŸŸข Anyone โ€” Can swap, add/remove liquidity                                โ”‚
โ”‚  โ””โ”€โ”€ ๐ŸŸก Factory โ€” Can create new pairs                                         โ”‚
โ”‚                                                                                โ”‚
โ”‚  Risk Summary:                                                                 โ”‚
โ”‚  "Standard DEX router. No owner privileges. Interacts with external pools      โ”‚
โ”‚   which may have their own risks."                                             โ”‚
โ”‚                                                                                โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Explains:

  • What the contract does (in one sentence)
  • Main functions and their purpose
  • Who can do what (permissions/roles)
  • Tokenomics (mintable, burnable, fees)
  • Risk summary

โšก Pro Templates

Pre-built multi-contract bundles for advanced use cases:

TemplateContractsDescription
Flash Loan PlaygroundAave V3 Pool, Uniswap RouterExplore flash loans for arbitrage
Multi-DEX ArbitrageUniswap, Sushiswap, CurveCompare prices across exchanges
Yield Aggregator IntelYearn, Convex, AuraTrack yield farming opportunities
Liquidation Bot IntelAave, CompoundMonitor positions for liquidation
Base DeFi StarterAerodrome, BaseSwapL2-native DeFi on Base
Arbitrum Perps SuiteGMX, CamelotPerpetual futures on Arbitrum

Each bundle downloads as a ZIP with:

  • Multiple server.py files (one per contract)
  • Pre-configured claude_config.json
  • Sample prompts to get started

Try it: mcp.ucai.tech โ†’ "โšก Pro Templates" tab


What Gets Generated?

When you point abi-to-mcp at a contract, it introspects every function and event, then generates tools Claude can call:

Contract has...You get...Claude can...
balanceOf(address)Read tool"Check vitalik.eth's USDC balance"
swap(path, amount)Write tool (simulated)"Swap 1 ETH for DAI" โ€” simulates first, shows you gas
Transfer eventQuery tool"Show me the last 10 transfers over $1M"
Complex structsTyped schemasHandles tuples, arrays, nested data

15-30 tools per contract, fully typed, simulation-protected for writes.

CLI Reference

abi-to-mcp generate

Generate an MCP server from an ABI.

abi-to-mcp generate <source> [options]

Arguments:

  • source: ABI file path or contract address

Options:

  • -o, --output PATH: Output directory (default: ./mcp-server)
  • -n, --network TEXT: Network for address lookups (default: mainnet)
  • -a, --address TEXT: Contract address (if not in source)
  • --name TEXT: Server name (auto-detected if not provided)
  • --read-only: Only generate read operations
  • --no-events: Exclude events as resources
  • --no-simulate: Disable simulation by default for writes

abi-to-mcp inspect

Preview what would be generated without creating files.

abi-to-mcp inspect ./token-abi.json

abi-to-mcp validate

Validate an ABI without generating.

abi-to-mcp validate ./token-abi.json

Generated Server Structure

my-mcp-server/
โ”œโ”€โ”€ server.py           # Main MCP server
โ”œโ”€โ”€ config.py           # Configuration
โ”œโ”€โ”€ requirements.txt    # Dependencies
โ”œโ”€โ”€ README.md           # Documentation
โ”œโ”€โ”€ pyproject.toml      # Package config
โ””โ”€โ”€ .env.example        # Environment template

Type Mapping

Solidity TypeJSON SchemaPython Type
addressstring with patternstr
uint256string (for precision)str
uint8-uint32integer with boundsint
boolbooleanbool
stringstringstr
bytesstring with patternstr
bytes32string with patternstr
tupleobjectDict
T[]arrayList
T[N]array with boundsList

Environment Variables

VariableDescriptionRequired
RPC_URLWeb3 RPC endpointYes
CONTRACT_ADDRESSOverride contract addressNo
PRIVATE_KEYFor write operationsFor writes
ETHERSCAN_API_KEYFor fetching from EtherscanFor Etherscan

Supported Networks

NetworkIDChain ID
mainnetEthereum1
sepoliaSepolia Testnet11155111
polygonPolygon137
arbitrumArbitrum One42161
optimismOptimism10
baseBase8453
bscBNB Chain56
avalancheAvalanche C-Chain43114

Security

  1. Private keys โ€” Only loaded from environment variables, never from files or CLI
  2. Simulation by default โ€” Write operations simulate first; set simulate=False to execute
  3. Read-only mode โ€” Use --read-only to completely disable writes
  4. Gas protection โ€” Configurable maximum gas price limits

Development

git clone https://github.com/nirholas/UCAI.git
cd UCAI

make setup    # Install dependencies
make test     # Run 876 tests (92% coverage)
make lint     # Check code quality
make docs     # Build documentation

Real-World Applications

1. DeFi Portfolio Agent

"Show me my positions across Uniswap, Aave, and Compound"
"Swap 1 ETH for USDC if the price is above $3,500"

Generate servers for each protocol, Claude handles the rest.

2. DAO Governance Assistant

"What proposals are active on Nouns DAO?"
"Draft a proposal to fund the marketing budget"
"Cast my vote on proposal #47"

3. NFT Collection Manager

"List all my NFTs on Opensea"
"Transfer Bored Ape #1234 to vitalik.eth"
"What's the floor price history for CryptoPunks?"

4. Wallet Assistant

"What tokens do I hold?"
"Send 100 USDC to alice.eth"
"What did I spend on gas this month?"

Keywords

For SEO and discoverability:

UCAI โ€ข Universal Contract AI Interface โ€ข MCP โ€ข Model Context Protocol โ€ข Claude โ€ข AI Agent โ€ข Smart Contract โ€ข Ethereum โ€ข EVM โ€ข DeFi โ€ข Web3 โ€ข Solidity โ€ข ABI โ€ข Blockchain โ€ข Token โ€ข ERC20 โ€ข ERC721 โ€ข NFT โ€ข DAO โ€ข Uniswap โ€ข Aave โ€ข Polygon โ€ข Arbitrum โ€ข Base โ€ข Optimism โ€ข LLM Tool โ€ข AI Blockchain โ€ข Vibecoding


Roadmap

We welcome contributions! See CONTRIBUTING.md.

๐Ÿ”ด High Priority

  • Integration tests for generated servers โ€” Validate MCP servers import correctly

๐ŸŸก Good First Issues

  • More EVM chains โ€” Fantom, zkSync, Cronos, etc.
  • More ABI sources โ€” Blockscout, 4byte.directory
  • Example contracts โ€” Uniswap, Aave, Compound, OpenSea

๐Ÿš€ Future

  • UCAI for Solana โ€” Generate from Anchor IDL
  • UCAI for REST APIs โ€” Generate from OpenAPI specs
  • TypeScript output โ€” Generate servers in JS/TS
  • Batch generation โ€” Multiple contracts at once
  • Event subscriptions โ€” Real-time WebSocket streaming

License

MIT License โ€” see LICENSE.


Acknowledgments

Built with:

  • MCP Python SDK โ€” Official Model Context Protocol implementation
  • web3.py โ€” Ethereum interaction
  • Typer โ€” CLI framework

Related Servers