UCAI — Claude Code MCP server: ABI to tools
UCAI turns a smart contract ABI into an MCP server, giving an agent tools to call contract functions and query blockchain data.
claude mcp add --env WEB3_PROVIDER_URL=<WEB3_PROVIDER_URL> --env ETHERSCAN_API_KEY=<ETHERSCAN_API_KEY> --env PRIVATE_KEY=<PRIVATE_KEY> --transport stdio ucai -- uvx abi-to-mcpWhat UCAI does
UCAI generates an MCP server from a contract address or ABI. Contract functions and events become tools an agent can call, such as checking a pool’s reserves or retrieving recent swaps. It can connect an agent to smart contracts used in DeFi.
For Claude Code, the setup runs uvx abi-to-mcp and supplies ETHERSCAN_API_KEY and PRIVATE_KEY. An alternate command also accepts WEB3_PROVIDER_URL for the provider endpoint. Those environment values are part of the server setup, so the matching configuration matters. A browser-based builder can generate a server as well.
What it helps with
- generate an MCP server from a contract address
- let an agent call smart contract functions
- query a pool’s reserves through contract tools
- retrieve recent blockchain swaps
Example prompts for the agent
- Ask the Uniswap contract for the best route to exchange 1 ETH for USDC.
- Check the ETH/DAI pool reserves through the contract.
- Show recent swaps on Uniswap.
How to install UCAI
Platform CLI
claude mcp add --env WEB3_PROVIDER_URL=<WEB3_PROVIDER_URL> --env ETHERSCAN_API_KEY=<ETHERSCAN_API_KEY> --env PRIVATE_KEY=<PRIVATE_KEY> --transport stdio ucai -- uvx abi-to-mcpReplace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from abi-to-mcp <command>
Platform CLI
codex mcp add ucai --env WEB3_PROVIDER_URL=<WEB3_PROVIDER_URL> --env ETHERSCAN_API_KEY=<ETHERSCAN_API_KEY> --env PRIVATE_KEY=<PRIVATE_KEY> -- uvx abi-to-mcpReplace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from abi-to-mcp <command>
Config file
{
"mcpServers": {
"ucai": {
"command": "uvx",
"args": [
"abi-to-mcp"
],
"env": {
"WEB3_PROVIDER_URL": "<WEB3_PROVIDER_URL>",
"ETHERSCAN_API_KEY": "<ETHERSCAN_API_KEY>",
"PRIVATE_KEY": "<PRIVATE_KEY>"
}
}
}
}Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from abi-to-mcp <command>
Config file
{
"servers": {
"ucai": {
"type": "stdio",
"command": "uvx",
"args": [
"abi-to-mcp"
],
"env": {
"WEB3_PROVIDER_URL": "<WEB3_PROVIDER_URL>",
"ETHERSCAN_API_KEY": "<ETHERSCAN_API_KEY>",
"PRIVATE_KEY": "<PRIVATE_KEY>"
}
}
}
}Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from abi-to-mcp <command>
Platform CLI
gemini mcp add -e WEB3_PROVIDER_URL=<WEB3_PROVIDER_URL> -e ETHERSCAN_API_KEY=<ETHERSCAN_API_KEY> -e PRIVATE_KEY=<PRIVATE_KEY> ucai uvx abi-to-mcpReplace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from abi-to-mcp <command>
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about UCAI
How do I install UCAI in Claude Code?
Run claude mcp add abi-to-mcp -e ETHERSCAN_API_KEY=<ETHERSCAN_API_KEY> -e PRIVATE_KEY=<PRIVATE_KEY> -- uvx abi-to-mcp. To configure a provider, use this separate command: `claude mcp add --env WEB3_PROVIDER_URL=<WEB3_PROVIDER_URL> --env ETHERSCAN_API_KEY=<ETHERSCAN_API_KEY> --env PRIVATE_KEY=<PRIVATE_KEY> --transport stdio ucai -- uvx abi-to-mcp`.
What does UCAI do?
It builds an MCP server from a smart contract ABI. The connected agent can use tools to call contract functions and query its data.
Which environment variables does UCAI use?
The Claude Code command sets ETHERSCAN_API_KEY and PRIVATE_KEY. The provider configuration also uses WEB3_PROVIDER_URL.