EVM MCP Server
Uses Bun as a runtime environment with specific support for installation and running the server with Bun commands.
Provides blockchain services for Ethereum mainnet, allowing AI agents to read blockchain state, check balances, transfer tokens, interact with smart contracts, and resolve ENS names to addresses.
Provides support for the Fantom network, enabling token transfers, balance checks, smart contract interactions, and general blockchain data access on the Fantom chain.
Supports Node.js as an alternative runtime environment, allowing the server to be run on Node.js 18.0.0 or higher.
Enables interaction with the Optimism network, supporting blockchain data access, token transfers, smart contract interactions and transaction operations on this Ethereum L2 solution.
Supports the Polygon network and Polygon zkEVM, allowing for native token transfers, smart contract interactions, token services (ERC20, ERC721, ERC1155), and blockchain data access.
Built with TypeScript 5.0+, providing type safety and modern language features for the implementation.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@EVM MCP Server what's the balance of vitalik.eth on Ethereum mainnet?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
EVM MCP Server
A comprehensive Model Context Protocol (MCP) server that provides blockchain services across multiple 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.
📋 Contents
Related MCP server: EVM MCP Server
🔭 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
Transferring tokens (native, ERC20, ERC721, ERC1155)
Querying token metadata and balances
Chain-specific services across 30+ EVM networks
ENS name resolution for all address parameters (use human-readable names like 'vitalik.eth' instead of addresses)
All services are exposed through a consistent interface of MCP tools and resources, 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.
✨ Features
Blockchain Data Access
Multi-chain support for 30+ EVM-compatible networks
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 services with private key signing
Contract verification to distinguish from EOAs
Event logs retrieval and filtering
Comprehensive Transaction Support
Native token transfers across all supported networks
Gas estimation for transaction planning
Transaction status and receipt information
Error handling with descriptive messages
🌐 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
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
🛠️ Prerequisites
Bun 1.0.0 or higher
Node.js 18.0.0 or higher (if not using Bun)
📦 Installation
# Clone the repository
git clone https://github.com/yourusername/mcp-evm-server.git
cd mcp-evm-server
# Install dependencies with Bun
bun install
# Or with npm
npm install⚙️ Server Configuration
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.tsFor server configuration:
src/server/http-server.ts
🚀 Usage
Using npx (No Installation Required)
You can run the MCP EVM Server directly without installation using npx:
# Run the server in stdio mode (for CLI tools)
npx @mcpdotdirect/evm-mcp-server
# Run the server in HTTP mode (for web applications)
npx @mcpdotdirect/evm-mcp-server --httpRunning the Server Locally
Start the server using stdio (for embedding in CLI tools):
# Start the stdio server
bun start
# Development mode with auto-reload
bun devOr start the HTTP server with SSE for web applications:
# Start the HTTP server
bun start:http
# Development mode with auto-reload
bun dev:httpConnecting to the Server
Connect to this MCP server using any MCP-compatible client. For testing and debugging, you can use the MCP Inspector.
Connecting from Cursor
To connect to the MCP server from Cursor:
Open Cursor and go to Settings (gear icon in the bottom left)
Click on "Features" in the left sidebar
Scroll down to "MCP Servers" section
Click "Add new MCP server"
Enter the following details:
Server name:
evm-mcp-serverType:
commandCommand:
npx @mcpdotdirect/evm-mcp-server
Click "Save"
Once connected, you can use the MCP server's capabilities directly within Cursor. The server will appear in the MCP Servers list and can be enabled/disabled as needed.
Using mcp.json with Cursor
For a more portable configuration that you can share with your team or use across projects, you can create an .cursor/mcp.json file in your project's root directory:
{
"mcpServers": {
"evm-mcp-server": {
"command": "npx",
"args": ["-y", "@mcpdotdirect/evm-mcp-server"]
},
"evm-mcp-http": {
"command": "npx",
"args": ["-y", "@mcpdotdirect/evm-mcp-server", "--http"]
}
}
}Place this file in your project's .cursor directory (create it if it doesn't exist), and Cursor will automatically detect and use these MCP server configurations when working in that project. This approach makes it easy to:
Share MCP configurations with your team
Version control your MCP setup
Use different server configurations for different projects
Example: HTTP Mode with SSE
If you're developing a web application and want to connect to the HTTP server with Server-Sent Events (SSE), you can use this configuration:
{
"mcpServers": {
"evm-mcp-sse": {
"url": "http://localhost:3001/sse"
}
}
}This connects directly to the HTTP server's SSE endpoint, which is useful for:
Web applications that need to connect to the MCP server from the browser
Environments where running local commands isn't ideal
Sharing a single MCP server instance among multiple users or applications
To use this configuration:
Create a
.cursordirectory in your project root if it doesn't existSave the above JSON as
mcp.jsonin the.cursordirectoryRestart Cursor or open your project
Cursor will detect the configuration and offer to enable the server(s)
Example: Using the MCP Server in Cursor
After configuring the MCP server with mcp.json, you can easily use it in Cursor. Here's an example workflow:
Create a new JavaScript/TypeScript file in your project:
// blockchain-example.js
async function main() {
try {
// Get ETH balance for an address using ENS
console.log("Getting ETH balance for vitalik.eth...");
// When using with Cursor, you can simply ask Cursor to:
// "Check the ETH balance of vitalik.eth on mainnet"
// Or "Transfer 0.1 ETH from my wallet to vitalik.eth"
// Cursor will use the MCP server to execute these operations
// without requiring any additional code from you
// This is the power of the MCP integration - your AI assistant
// can directly interact with blockchain data and operations
} catch (error) {
console.error("Error:", error.message);
}
}
main();With the file open in Cursor, you can ask Cursor to:
"Check the current ETH balance of vitalik.eth"
"Look up the price of USDC on Ethereum"
"Show me the latest block on Optimism"
"Check if 0x1234... is a contract address"
Cursor will use the MCP server to execute these operations and return the results directly in your conversation.
The MCP server handles all the blockchain communication while allowing Cursor to understand and execute blockchain-related tasks through natural language.
Connecting using Claude CLI
If you're using Claude CLI, you can connect to the MCP server with just two commands:
# Add the MCP server
claude mcp add evm-mcp-server npx @mcpdotdirect/evm-mcp-server
# Start Claude with the MCP server enabled
claudeExample: Getting a Token Balance with ENS
// 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
// }Example: Resolving an ENS Name
// Example of using the MCP client to resolve an ENS name to an address
const mcp = new McpClient("http://localhost:3000");
const result = await mcp.invokeTool("resolve-ens", {
ensName: "vitalik.eth",
network: "ethereum",
});
console.log(result);
// {
// ensName: "vitalik.eth",
// normalizedName: "vitalik.eth",
// resolvedAddress: "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
// network: "ethereum"
// }📚 API Reference
Tools
The server provides the following MCP tools for agents. All tools that accept address parameters support both Ethereum addresses and ENS names.
Token services
Tool Name | Description | Key Parameters |
| Get ERC20 token metadata |
|
| Check ERC20 token balance |
|
| Transfer ERC20 tokens |
|
| Approve token allowances |
|
| Get NFT metadata |
|
| Verify NFT ownership |
|
| Transfer an NFT |
|
| Count NFTs owned |
|
| Get ERC1155 metadata |
|
| Check ERC1155 balance |
|
| Transfer ERC1155 tokens |
|
Blockchain services
Tool Name | Description | Key Parameters |
| Get network information |
|
| Get native token balance |
|
| Send native tokens |
|
| Get transaction details |
|
| Read smart contract state |
|
| Write to smart contract |
|
| Check if address is a contract |
|
| Resolve ENS name to address |
|
Resources
The server exposes blockchain data through the following MCP resource URIs. All resource URIs that accept addresses also support ENS names, which are automatically resolved to addresses.
Blockchain Resources
Resource URI Pattern | Description |
| Chain information for a specific network |
| Ethereum mainnet chain information |
| Block data by number |
| Latest block data |
| Native token balance |
| Transaction details |
| Transaction receipt with logs |
Token Resources
Resource URI Pattern | Description |
| ERC20 token information |
| ERC20 token balance |
| NFT (ERC721) token information |
| NFT ownership verification |
| ERC1155 token URI |
| ERC1155 token balance |
🔒 Security Considerations
Private keys are used only for transaction signing and are never stored by the server
Consider implementing additional authentication mechanisms for production use
Use HTTPS for the HTTP server in production environments
Implement rate limiting to prevent abuse
For high-value services, consider adding confirmation steps
📁 Project Structure
mcp-evm-server/
├── src/
│ ├── index.ts # Main stdio server entry point
│ ├── server/ # Server-related files
│ │ ├── http-server.ts # HTTP server with SSE
│ │ └── server.ts # General server setup
│ ├── core/
│ │ ├── chains.ts # Chain definitions and utilities
│ │ ├── resources.ts # MCP resources implementation
│ │ ├── tools.ts # MCP tools implementation
│ │ ├── prompts.ts # MCP prompts implementation
│ │ └── services/ # Core blockchain services
│ │ ├── index.ts # Operation exports
│ │ ├── balance.ts # Balance services
│ │ ├── transfer.ts # Token transfer services
│ │ ├── utils.ts # Utility functions
│ │ ├── tokens.ts # Token metadata services
│ │ ├── contracts.ts # Contract interactions
│ │ ├── transactions.ts # Transaction services
│ │ └── blocks.ts # Block services
│ │ └── clients.ts # RPC client utilities
├── package.json
├── tsconfig.json
└── README.md🛠️ Development
To modify or extend the server:
Add new services in the appropriate file under
src/core/services/Register new tools in
src/core/tools.tsRegister new resources in
src/core/resources.tsAdd new network support in
src/core/chains.tsTo change server configuration, edit the hardcoded values in
src/server/http-server.ts
📄 License
This project is licensed under the terms of the MIT License.
Available Tools
25 toolsapprove_token_spendingA
Approve a spender (contract) to spend tokens on your behalf. Required before interacting with DEXes, lending protocols, etc.
Inputs: tokenAddress (required), spenderAddress (required), amount (required), network.
get_allowanceARead-onlyIdempotent
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.
Inputs: tokenAddress (required), spenderAddress (required), ownerAddress, network.
get_balanceARead-onlyIdempotent
Get the native token balance (ETH, MATIC, etc.) for an address
Inputs: address (required), network.
get_blockBRead-onlyIdempotent
Get block details by block number or hash
Inputs: blockIdentifier (required), network.
get_chain_infoARead-onlyIdempotent
Get information about an EVM network: chain ID, current block number, and RPC endpoint
Inputs: network.
get_contract_abiARead-onlyIdempotent
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.
Inputs: contractAddress (required), network.
get_erc1155_balanceBRead-onlyIdempotent
Get ERC1155 token balance for an address
Inputs: contractAddress (required), tokenId (required), address (required), network.
get_gas_priceARead-only
Get current gas prices (base fee, standard, and fast) for a network
Inputs: network.
get_latest_blockBRead-only
Get the latest block from the network
Inputs: network.
get_nft_infoARead-onlyIdempotent
Get information about an ERC721 NFT including metadata URI
Inputs: contractAddress (required), tokenId (required), network.
get_supported_networksARead-onlyIdempotent
Get a list of all supported EVM networks
Inputs: no named parameters.
get_token_balanceARead-onlyIdempotent
Get the ERC20 token balance for an address
Inputs: address (required), tokenAddress (required), network.
get_transactionBRead-onlyIdempotent
Get transaction details by transaction hash
Inputs: txHash (required), network.
get_transaction_receiptARead-onlyIdempotent
Get transaction receipt (confirmation status, gas used, logs). Use this to check if a transaction has been confirmed.
Inputs: txHash (required), network.
get_wallet_addressARead-onlyIdempotent
Get the address of the configured wallet. Use this to verify which wallet is active.
Inputs: no named parameters.
lookup_ens_addressARead-onlyIdempotent
Lookup the ENS name for an Ethereum address (reverse resolution)
Inputs: address (required), network.
multicallARead-onlyIdempotent
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.
Inputs: calls (required), allowFailure, network.
read_contractARead-onlyIdempotent
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.
Inputs: contractAddress (required), functionName (required), args, abiJson, +1 more.
resolve_ens_nameARead-onlyIdempotent
Resolve an ENS name to an Ethereum address
Inputs: ensName (required), network.
sign_messageAIdempotent
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.
Inputs: message (required).
sign_typed_dataAIdempotent
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.
Inputs: domainJson (required), typesJson (required), primaryType (required), messageJson (required).
transfer_erc20ADestructive
Transfer ERC20 tokens to an address. Uses the configured wallet.
Inputs: tokenAddress (required), to (required), amount (required), network.
transfer_nativeADestructive
Transfer native tokens (ETH, MATIC, etc.) to an address. Uses the configured wallet.
Inputs: to (required), amount (required), network.
wait_for_transactionARead-only
Wait for a transaction to be confirmed (mined). Polls the network until confirmation.
Inputs: txHash (required), confirmations, network.
write_contractADestructive
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).
Inputs: contractAddress (required), functionName (required), args, value, +2 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 25 tools
Most tools have distinct purposes, but there is some overlap between get_block and get_latest_block, and between get_contract_abi and read_contract/write_contract's ABI fetching. The descriptions help clarify, but an agent might occasionally hesitate between these pairs.
Tool names follow a highly consistent verb_noun or verb_noun_noun pattern throughout, such as get_balance, transfer_erc20, and sign_message. There are no deviations in style, making them predictable and easy to parse.
With 25 tools, the count is on the high side for an MCP server, bordering on heavy. While the domain (EVM interactions) is broad, this many tools could overwhelm agents or lead to redundancy, though it covers many use cases.
The tool set provides comprehensive coverage for EVM operations, including token transfers, contract interactions, network queries, and wallet management. It supports full workflows from reading to writing, with no obvious gaps in the domain.
Maintenance
Related MCP Connectors
MCP server for the Z1N Protocol - on-chain identity for AI agents on Polygon
AI Agent Utility Layer for agent safety, web monitoring, crypto research and tool discovery.
ERC-8004 agent identity, on-chain subscriptions, reputation, A2A tasks and chat over 53 tools.
MCP server connecting AI agents to non-custodial staking data across 130+ networks.
Related MCP Servers
- AlicenseBqualityDmaintenanceA Model Context Protocol server that enables AI agents to interact with 30+ Ethereum-compatible blockchain networks, providing services like token transfers, contract interactions, and ENS resolution through a unified interface.2877 npm381MIT
- -licenseNot gradedqualityNot gradedmaintenanceComprehensive Model Context Protocol server that enables AI agents to interact with 30+ Ethereum-compatible blockchain networks, supporting token transfers, smart contract interactions, and ENS name resolution through a unified interface.1-
- AlicenseNot gradedqualityBmaintenanceAn MCP server that bridges AI models with Ethereum blockchains via all JSON-RPC calls, enabling natural language queries for block numbers, balances, transactions, and smart contract data.21MIT
- AlicenseCqualityCmaintenanceWeb3 MCP proxy server for AI agents: EVM execution, DeFi swaps, bridges, advanced orders, market data, wallet management, and confirmation-gated writes.10091 npm1MIT