MCP-ABI

by iqaicom

Not rated
GitHub

About

Interact with Ethereum-compatible smart contracts using their ABI.

Details

Author
iqaicom
Categories
Developer Tools, Other, Finance
Tags
#evm, #smart-contracts

Setup

Install MCP-ABI in your MCP client (Claude Desktop, Cursor, Windsurf, and others).

Repository: https://github.com/iqaicom/mcp-abi

Follow the installation instructions in the repository README, then restart your MCP client.

The ABI MCP Server enables AI agents to interact with any Ethereum-compatible smart contract using its ABI (Application Binary Interface). This server dynamically generates MCP tools from contract ABIs, allowing seamless interaction with any smart contract without requiring custom tool implementations.

By implementing the Model Context Protocol (MCP), this server allows Large Language Models (LLMs) to read contract state, execute transactions, and interact with decentralized applications directly through their context window.

- Dynamic Tool Generation: Automatically creates MCP tools from any contract ABI at runtime.
- Read Functions: Query contract state (view/pure functions) without sending transactions.
- Write Functions: Execute state-changing transactions with wallet signing support.
- Multi-Chain Support: Works with any EVM-compatible blockchain via configurable RPC endpoints.
- Type-Safe Interactions: Validates function arguments against ABI specifications.

To use this server without installing it globally:

git clone https://github.com/IQAIcom/mcp-abi.git cd mcp-abi pnpm install pnpm run build

Add the following configuration to your MCP client settings (e.g.,claude_desktop_config.json).

{ "mcpServers": { "smart-contract-abi": { "command": "npx", "args": ["-y", "@iqai/mcp-abi"], "env": { "CONTRACT_ABI": "[{\"inputs\":[{\"name\":\"account\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", "CONTRACT_ADDRESS": "0xaB195B090Cc60C1EFd4d1cEE94Bf441F5931C01b", "CONTRACT_NAME": "ERC20" } } } }
{ "mcpServers": { "smart-contract-abi": { "command": "node", "args": ["/absolute/path/to/mcp-abi/dist/index.js"], "env": { "WALLET_PRIVATE_KEY": "your_wallet_private_key_here", "CONTRACT_ABI": "[{\"inputs\":[{\"name\":\"to\",\"type\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", "CONTRACT_ADDRESS": "0xaB195B090Cc60C1EFd4d1cEE94Bf441F5931C01b", "CONTRACT_NAME": "ERC20", "CHAIN_ID": "252", "RPC_URL": "https://rpc.frax.com" } } } }

- "Check the token balance of wallet 0xabc..."
- "What is the total supply of this token?"
- "Get the allowance for spender 0x123... from owner 0x456..."

- "Transfer 100 tokens to address 0xabc..."
- "Approve 0x123... to spend 1000 tokens"
- "Mint a new NFT to wallet 0xdef..."

- "What functions are available on this contract?"
- "Show me all the read functions I can call"
- "What parameters does the transfer function require?"

Tools are dynamically generated based on the provided contract ABI. Each function in the ABI becomes an MCP tool:

- Read Functions (view/pure): Tools prefixed with contract name (e.g.,erc20_balanceOf,erc20_totalSupply)
- Write Functions: Tools for state-changing operations (e.g.,erc20_transfer,erc20_approve)

Example tool names for an ERC20 contract withCONTRACT_NAME=ERC20:

- erc20_balanceOf- Query token balance
- erc20_transfer- Transfer tokens
- erc20_approve- Approve spending
- erc20_allowance- Check allowance

Note:Tools are generated dynamically based on the loaded contract ABI. The tool names follow the pattern{contractname}_{functionname}.

When you load a contract ABI, tools are automatically created for each function in the ABI:

- Read functionsbecome query tools (no gas required)
- Write functionsbecome execution tools (requires wallet)

All generated tools accept the same parameter schema:

If you load an ERC-20 token contract named "USDC", the following tools would be generated:

- usdc_name- Query the token name
- usdc_symbol- Query the token symbol
- usdc_decimals- Query token decimals
- usdc_totalSupply- Query total token supply
- usdc_balanceOf- Query balance of an address
- usdc_transfer- Transfer tokens to an address
- usdc_approve- Approve spending allowance
- usdc_transferFrom- Transfer tokens on behalf of another address

βœ… Successfully queried {functionName} πŸ“Š Result: {JSON result}
βœ… Successfully executed {functionName} πŸ”— Transaction Hash: {hash} πŸ“¦ Block Number: {blockNumber} β›½ Gas Used: {gasUsed} βœ… Status: Success

- src/tools/: Tool generation logic
- src/services/: Contract interaction service
- src/lib/: Shared utilities
- src/index.ts: Server entry point

- Model Context Protocol (MCP)
-
Ethereum ABI Specification
-
Viem Documentation

This tool interacts with blockchain smart contracts and can execute real transactions. Store private keys securely and never commit them to version control. Always test interactions on testnets before mainnet deployment. Trading and interacting with smart contracts involves risk.

This is a web browser that enables your coding agent, such as Claude Code, to visit websites on your behalf and assist you in identifying bugs or creating UI test cases.

MCP server for Klever blockchain smart contract development, on-chain data exploration, and VM interaction. Public remote server available at https://mcp.klever.org/mcp.

Read/write to over 2k blockchains, enabling data querying, contract analysis/deployment, and transaction execution, powered by Thirdweb.

A comprehensive toolkit for Ethereum blockchain analysis directly within Claude AI.

An MCP server that provides complete access to Ethereum Virtual Machine (EVM) JSON-RPC methods. Works with any EVM-compatible node provider including Infura, Alchemy, QuickNode, local nodes, and more.

Provides blockchain services for over 30 EVM-compatible networks through a unified interface.

A lightweight MCP server for Solidity development using the Foundry toolchain (Forge, Cast, and Anvil).

Interact with the Monad testnet, query blockchain data, and engage with the CoinflipGame smart contract.

An MCP server for Solana development providing basic RPC methods and helpful prompts.

An MCP server providing access to various Starknet RPC methods.

An MCP server for interacting with the Tatara blockchain ecosystem. Requires configuration for the Tatara RPC endpoint and a wallet private key.

No reviews yet β€” be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.