EVM MCP Server
Visit ProjectAn MCP server built in TypeScript that enables LLM agents to perceive blockchain data across multiple EVM-compatible networks using QuickNode endpoints.
Visit ProjectCategory
Tags
What is the EVM MCP Server?
EVM MCP Server is a TypeScript-based server that enables LLM agents to access and analyze blockchain data across multiple EVM-compatible networks (Ethereum, Base, Arbitrum, Avalanche, BSC) using QuickNode endpoints through the Model Context Protocol (MCP).
How to use the EVM MCP Server?
- Prerequisites: Install Node.js (ā„ 18), set up a QuickNode account, and configure a multichain endpoint
- Setup: Clone the repository, install dependencies, and build the project
- Configuration: Add server details to Claude Desktop's configuration file
- Usage: Ask LLM agents (like Claude Desktop) to perform blockchain-related tasks using natural language queries
Key features of the EVM MCP Server
- MCP-compatible for direct LLM agent interaction
- Multi-chain support for 5 EVM-compatible networks
- Includes core EVM methods (
eth_getBalance
,eth_getCode
,eth_gasPrice
) - Pre-built LLM prompts for wallet analysis, contract inspection, and gas price evaluation
- Resource references for gas data, block explorers, and supported chains
Use cases of the EVM MCP Server
- Checking wallet balances across multiple chains
- Contract code inspection and analysis
- Gas price monitoring and transaction optimization
- Cross-chain blockchain data comparison
- Automated blockchain analysis for research or applications
FAQ about the EVM MCP Server
- Is this server compatible with all LLM agents?
It's compatible with any MCP-compatible agent runner, with Claude Desktop specifically mentioned
- How many chains are supported?
Currently supports Ethereum, Base, Arbitrum, Avalanche, and BSC
- Is QuickNode required?
Yes, QuickNode endpoints are required for blockchain data access
- What's the best way to test the server?
Restart Claude Desktop and try commands like 'check wallet balance' or 'analyze contract'
EVM MCP Server
An MCP server built in TypeScript that enables LLM agents to perceive blockchain data across multiple EVM-compatible networks using QuickNode endpoints.
Written tutorial of this project: Create an EVM MCP Server with Claude Desktop
Tech Stack
Features
- MCP-Compatible: Built using the Model Context Protocol SDK to directly talk to LLM agents
- Multi-Chain Support: Works with Ethereum, Base, Arbitrum, Avalanche, and BSC
- Core EVM Methods: Includes
eth_getBalance
,eth_getCode
, andeth_gasPrice
- LLM Prompts: Pre-built prompts for wallet analysis, contract inspection, and gas price evaluation
Prerequisites
- Node.js >= 18
- QuickNode account (create a free one here)
- TypeScript
- Claude Desktop or any other MCP-compatible agent runner
QuickNode Endpoint and Token ID
- Sign up at QuickNode
- Create a multichain endpoint. See the How to Use the QuickNode Multichain Endpoint for more details.
- From the endpoint URL
https://your-endpoint.quiknode.pro/your-token-id/
(for Ethereum) orhttps://your-endpoint.NETWORK.quiknode.pro/your-token-id/
(for other chains):- Extract the endpoint name (replace
your-endpoint
) - Extract the token ID (replace
your-token-id-here
)
- Extract the endpoint name (replace
- Keep the endpoint name and token ID for later use.
Project Instructions
- Clone the repository
git clone https://github.com/quiknode-labs/qn-guide-examples.git
cd qn-guide-examples/AI/evm-mcp-server
- Install dependencies
npm install
- Build the project
Compile the TypeScript code:
npm run build
Project Structure
āāā chains.ts # Chain configuration and QuickNode endpoint mapping
āāā clients.ts # Viem public client creator for RPC connections
āāā index.ts # Main entry point that sets up the MCP server
āāā package.json # Package configuration
āāā prompts.ts # Defines LLM prompts for blockchain analysis tasks
āāā resources.ts # External references and helpers
āāā tools.ts # Implements the EVM RPC methods as MCP tools
āāā tsconfig.json # TypeScript configuration
Configure Claude Desktop
Environment variables are used to configure the server. These variables will be defined in Claude Desktop's configuration file, claude_desktop_config.json
.
To configure, open the Claude Desktop app, go to Claude > Settings > Developer. Then, modify the claude_desktop_config.json
file with the following content: (if you already have other configurations, add the new configuration under the mcpServers
object)
{
"mcpServers": {
"evm": {
"command": "node",
"args": [
"/absolute-path-to/evm-mcp-server/build/index.js"
],
"env": {
"QN_ENDPOINT_NAME": "your-quicknode-endpoint-name",
"QN_TOKEN_ID": "your-quicknode-token-id"
}
}
}
}
- Replace
your-quicknode-endpoint-name
with the name of your QuickNode endpoint. - Replace
your-quicknode-token-id
with the token ID of your QuickNode endpoint. - Replace
/absolute-path-to
with the absolute path to theevm-mcp-server
directory.
Test the MCP Server
Restart Claude Desktop and test the server by asking Claude Desktop to perform a task that requires the EVM MCP Server. For example, ask Claude Desktop to get balance of an address on any supported chain.
Example Agent Interactions
- Check a wallet balance:
Give the balance of the 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 address on Ethereum
- Analyze a contract:
Analyze 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2 on Ethereum
- Get current gas prices:
Analyze the current gas prices on Ethereum, is it a good time to use the chain?
MCP Tools
-
eth_getBalance
- Description: Get the ETH/native token balance of an address
- Parameters:
address
: Ethereum address to checkchain
: Chain to query (ethereum, base, arbitrum, avalanche, bsc)
- Returns:
- Address, chain name, balance in wei, formatted balance with symbol
-
eth_getCode
- Description: Detect whether an address is a contract or wallet
- Parameters:
address
: Ethereum address to checkchain
: Chain to query (ethereum, base, arbitrum, avalanche, bsc)
- Returns:
- Address information, contract status, bytecode size
-
eth_gasPrice
- Description: Get the current gas price on the specified chain
- Parameters:
chain
: Chain to query (ethereum, base, arbitrum, avalanche, bsc)
- Returns:
- Chain name, gas price in wei and Gwei, timestamp
MCP Prompts
The server provides the following MCP prompts:
-
check-wallet
- Description: Guide for analyzing a wallet's balance and context
- Parameters:
address
: Ethereum address to checkchain
: Chain to query (ethereum, base, arbitrum, avalanche, bsc)
- Functionality: Guides the LLM to get the balance and check if it's a contract, then provide analysis
-
check-contract
- Description: Prompt contract code introspection and analysis
- Parameters:
address
: Ethereum address to checkchain
: Chain to query (ethereum, base, arbitrum, avalanche, bsc)
- Functionality: Guides the LLM to verify code presence, analyze contract size and balance
-
gas-analysis
- Description: Analyze gas price trends and evaluate timing
- Parameters:
chain
: Chain to query (ethereum, base, arbitrum, avalanche, bsc)
- Functionality: Guides the LLM to analyze current gas prices and provide recommendations
MCP Resources
The server provides access to these resources:
evm://docs/gas-reference
- Gas price reference data for supported chainsevm://docs/block-explorers
- Block explorer URLs by chainevm://docs/supported-chains
- Supported chains