EVM MCP Server

by mcpdotdirect

379 630 downloads Not rated yet MIT

About

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

Details

License
MIT

Explore

- Personal Message Signing - Sign arbitrary messages for authentication and verification
- EIP-712 Typed Data Signing - Sign structured data for gasless transactions and meta-transactions
- SIWE Support - Enable Sign-In With Ethereum authentication flows
- Permit Signatures - Create off-chain approvals for gasless token operations
- Meta-Transaction Support - Sign transaction data for relay services and gasless transfers

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name EVM MCP Server
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

- Bun 1.0.0 or higher (recommended)
- Node.js 20.0.0 or higher (if not using Bun)
- Optional: Etherscan API key for ABI fetching


bun install

The server uses the following environment variables. For write operations and ABI fetching, you must configure these variables:

You can configure your wallet using either a private key or a mnemonic phrase:

Option 1: Private Key

bash
export EVM_PRIVATE_KEY="0x..." # Your private key in hex format (with or without 0x prefix)

Option 2: Mnemonic Phrase (Recommended for HD Wallets)

bash
export EVM_MNEMONIC="word1 word2 word3 ... word12" # Your 12 or 24 word BIP-39 mnemonic
export EVM_ACCOUNT_INDEX="0" # Optional: Account index for HD wallet derivation (default: 0)

The mnemonic option supports hierarchical deterministic (HD) wallet derivation:

- Uses BIP-39 standard mnemonic phrases (12 or 24 words)
- Supports BIP-44 derivation path: m/44'/60'/0'/0/{accountIndex}
- EVM_ACCOUNT_INDEX allows you to derive different accounts from the same mnemonic
- Default account index is 0 (first account)

Wallet is used for:

- Transferring native tokens (transfer_native tool)
- Transferring ERC20 tokens (transfer_erc20 tool)
- Approving token spending (approve_token_spending tool)
- Writing to smart contracts (write_contract tool)
- Signing messages for authentication (sign_message tool)
- Signing structured data for gasless transactions (sign_typed_data tool)

⚠️ Security:

- Never commit your private key or mnemonic to version control
- Use environment variables or a secure key management system
- Store mnemonics securely - they provide access to all derived accounts
- Consider using different account indices for different purposes

The server uses the following default configuration:

- Default Chain ID: 1 (Ethereum Mainnet)
- Server Port: 3001
- Server Host: 0.0.0.0 (accessible from any network interface)

These values are hardcoded in the application. If you need to modify them, you can edit the following files:

- For chain configuration: src/core/chains.ts
- For server configuration: src/server/http-server.ts

You can run the MCP EVM Server directly without installation using npx:

bash

Start the server using stdio (for embedding in CLI tools):


javascript // Example of using the MCP client to check a token balance using ENS const mcp = new McpClient("http://localhost:3000");

const result = await mcp.invokeTool("get-token-balance", {
tokenAddress: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", // USDC on Ethereum
ownerAddress: "vitalik.eth", // ENS name instead of address
network: "ethereum",
});

console.log(result);
// {
// tokenAddress: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
// owner: "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
// network: "ethereum",
// raw: "1000000000",
// formatted: "1000",
// symbol: "USDC",
// decimals: 6
// }
```

get_wallet_address

Get the address of the configured wallet. Use this to verify which wallet is active.

get_chain_info

Get information about an EVM network: chain ID, current block number, and RPC endpoint

get_supported_networks

Get a list of all supported EVM networks

get_gas_price

Get current gas prices (base fee, standard, and fast) for a network

resolve_ens_name

Resolve an ENS name to an Ethereum address

lookup_ens_address

Lookup the ENS name for an Ethereum address (reverse resolution)

get_block

Get block details by block number or hash

get_latest_block

Get the latest block from the network

get_balance

Get the native token balance (ETH, MATIC, etc.) for an address

get_token_balance

Get the ERC20 token balance for an address

get_allowance

Check the allowance granted to a spender for a token. This tells you how much of a token an address can spend on your behalf.

get_transaction

Get transaction details by transaction hash

get_transaction_receipt

Get transaction receipt (confirmation status, gas used, logs). Use this to check if a transaction has been confirmed.

wait_for_transaction

Wait for a transaction to be confirmed (mined). Polls the network until confirmation.

get_contract_abi

Fetch a contract's full ABI from Etherscan/block explorers. Use this to understand verified contracts before interacting. Requires ETHERSCAN_API_KEY. Supports 30+ EVM networks. Works best with verified contracts on block explorers.

read_contract

Call read-only functions on a smart contract. Automatically fetches ABI from block explorer if not provided (requires ETHERSCAN_API_KEY). Falls back to common functions if contract is not verified. Use this to query contract state and data.

write_contract

Execute state-changing functions on a smart contract. Automatically fetches ABI from block explorer if not provided (requires ETHERSCAN_API_KEY). Use this to call any write function on verified contracts. Requires wallet to be configured (via private key or mnemonic).

multicall

Batch multiple contract read calls into a single RPC request. Significantly reduces latency and RPC usage when querying multiple functions. Uses the Multicall3 contract deployed on all major networks. Perfect for portfolio analysis, price aggregation, and querying multiple contract states efficiently.

transfer_native

Transfer native tokens (ETH, MATIC, etc.) to an address. Uses the configured wallet.

transfer_erc20

Transfer ERC20 tokens to an address. Uses the configured wallet.

approve_token_spending

Approve a spender (contract) to spend tokens on your behalf. Required before interacting with DEXes, lending protocols, etc.

get_nft_info

Get information about an ERC721 NFT including metadata URI

get_erc1155_balance

Get ERC1155 token balance for an address

sign_message

Sign an arbitrary message using the configured wallet. Useful for authentication (SIWE), meta-transactions, and off-chain signatures. The signature can be verified on-chain or off-chain.

sign_typed_data

Sign structured data (EIP-712) using the configured wallet. Used for gasless transactions, meta-transactions, permit signatures, and protocol-specific signatures. The signature follows the EIP-712 standard.

The server provides 25 focused MCP tools for agents. All tools that accept address parameters support both Ethereum addresses and ENS names.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "evm mcp server": {
            "evm-mcp-server": {
                "command": "npx",
                "args": [
                    "-y",
                    "@mcpdotdirect/evm-mcp-server"
                ]
            },
            "evm-mcp-http": {
                "command": "npx",
                "args": [
                    "-y",
                    "@mcpdotdirect/evm-mcp-server",
                    "--http"
                ]
            }
        }
    }
}

McpServers

{
    "evm-mcp-server": {
        "command": "npx",
        "args": [
            "-y",
            "@mcpdotdirect/evm-mcp-server"
        ]
    },
    "evm-mcp-http": {
        "command": "npx",
        "args": [
            "-y",
            "@mcpdotdirect/evm-mcp-server",
            "--http"
        ]
    }
}

License: MIT
EVM Networks
TypeScript
MCP
Viem

A comprehensive Model Context Protocol (MCP) server that provides blockchain services across 60+ EVM-compatible networks. This server enables AI agents to interact with Ethereum, Optimism, Arbitrum, Base, Polygon, and many other EVM chains with a unified interface through 22 tools and 10 AI-guided prompts.

📋 Contents

- Overview
- Features
- Supported Networks
- Prerequisites
- Installation
- Configuration
- Environment Variables
- Server Configuration
- Usage
- API Reference
- Tools
- Prompts
- Resources
- Security Considerations
- Project Structure
- Development
- License

🔭 Overview

The MCP EVM Server leverages the Model Context Protocol to provide blockchain services to AI agents. It supports a wide range of services including:

- Reading blockchain state (balances, transactions, blocks, etc.)
- Interacting with smart contracts with automatic ABI fetching from block explorers
- Transferring tokens (native, ERC20, ERC721, ERC1155)
- Querying token metadata and balances
- Chain-specific services across 60+ EVM networks (34 mainnets + 26 testnets)
- ENS name resolution for all address parameters (use human-readable names like 'vitalik.eth' instead of addresses)
- AI-friendly prompts that guide agents through complex workflows

All services are exposed through a consistent interface of MCP tools, resources, and prompts, making it easy for AI agents to discover and use blockchain functionality. Every tool that accepts Ethereum addresses also supports ENS names, automatically resolving them to addresses behind the scenes. The server includes intelligent ABI fetching, eliminating the need to know contract ABIs in advance.

✨ Features

Blockchain Data Access

- Multi-chain support for 60+ EVM-compatible networks (34 mainnets + 26 testnets)
- Chain information including blockNumber, chainId, and RPCs
- Block data access by number, hash, or latest
- Transaction details and receipts with decoded logs
- Address balances for native tokens and all token standards
- ENS resolution for human-readable Ethereum addresses (use 'vitalik.eth' instead of '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045')

Token services

- ERC20 Tokens

- Get token metadata (name, symbol, decimals, supply)
- Check token balances
- Transfer tokens between addresses
- Approve spending allowances

- NFTs (ERC721)

- Get collection and token metadata
- Verify token ownership
- Transfer NFTs between addresses
- Retrieve token URIs and count holdings

- Multi-tokens (ERC1155)
- Get token balances and metadata
- Transfer tokens with quantity
- Access token URIs

Smart Contract Interactions

- Read contract state through view/pure functions
- Write to contracts - Execute any state-changing function with automatic ABI fetching
- Contract verification to distinguish from EOAs
- Event logs retrieval and filtering
- Automatic ABI fetching from Etherscan v2 API across all 60+ networks (no need to know ABIs in advance)
- ABI parsing and validation with function discovery

Comprehensive Transaction Support

- Flexible Wallet Support - Configure with Private Key or Mnemonic (BIP-39) with HD path support
- Native token transfers across all supported networks
- Gas estimation for transaction planning
- Transaction status and receipt information
- Error handling with descriptive messages

Message Signing Capabilities

- Personal Message Signing - Sign arbitrary messages for authentication and verification
- EIP-712 Typed Data Signing - Sign structured data for gasless transactions and meta-transactions
- SIWE Support - Enable Sign-In With Ethereum authentication flows
- Permit Signatures - Create off-chain approvals for gasless token operations
- Meta-Transaction Support - Sign transaction data for relay services and gasless transfers

AI-Guided Workflows (Prompts)

- Transaction preparation - Guidance for planning and executing transfers
- Wallet analysis - Tools for analyzing wallet activity and holdings
- Smart contract exploration - Interactive ABI fetching and contract analysis
- Contract interaction - Safe execution of write operations on smart contracts
- Network information - Learning about EVM networks and comparisons
- Approval auditing - Reviewing and managing token approvals
- Error diagnosis - Troubleshooting transaction failures

🌐 Supported Networks

Mainnets

- Ethereum (ETH)
- Optimism (OP)
- Arbitrum (ARB)
- Arbitrum Nova
- Base
- Polygon (MATIC)
- Polygon zkEVM
- Avalanche (AVAX)
- Binance Smart Chain (BSC)
- zkSync Era
- Linea
- Celo
- Gnosis (xDai)
- Fantom (FTM)
- Filecoin (FIL)
- Moonbeam
- Moonriver
- Cronos
- Scroll
- Mantle
- Manta
- Blast
- Fraxtal
- Mode
- Metis
- Kroma
- Zora
- Aurora
- Canto
- Flow
- Lumia

Testnets

- Sepolia
- Optimism Sepolia
- Arbitrum Sepolia
- Base Sepolia
- Polygon Amoy
- Avalanche Fuji
- BSC Testnet
- zkSync Sepolia
- Linea Sepolia
- Scroll Sepolia
- Mantle Sepolia
- Manta Sepolia
- Blast Sepolia
- Fraxtal Testnet
- Mode Testnet
- Metis Sepolia
- Kroma Sepolia
- Zora Sepolia
- Celo Alfajores
- Goerli
- Holesky
- Flow Testnet
- Filecoin Calibration
- Lumia Testnet

🛠️ Prerequisites

- Bun 1.0.0 or higher (recommended)
- Node.js 20.0.0 or higher (if not using Bun)
- Optional: Etherscan API key for ABI fetching

📦 Installation

```bash

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.