An MCP (Model Context Protocol) server that provides Ethereum blockchain data tools via Etherscan's API. Features include checking ETH balances, viewing transaction history, tracking ERC20 transfers, fetching contract ABIs, monitoring gas prices, and resolving ENS names.
- Balance Checking: Get ETH balance for any Ethereum address
- Transaction History: View recent transactions with detailed information
- Token Transfers: Track ERC20 token transfers with token details
- Contract ABI: Fetch smart contract ABIs for development
- Contract Code: Fetch smart contract code for development
- Gas Prices: Monitor current gas prices (Safe Low, Standard, Fast)
- ENS Resolution: Resolve Ethereum addresses to ENS names
- Node.js >= 18
- An Etherscan API key (obtain one at https://etherscan.io/apis)
To install MCP Etherscan Server for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install mcp-etherscan-server --client claude- Clone the repository:
git clone [your-repo-url]
cd mcp-etherscan-server- Install dependencies:
npm install- Create a
.envfile in the root directory:
ETHERSCAN_API_KEY=your_api_key_here- Build the project:
npm run buildStart the server:
npm startThe server runs on stdio, making it compatible with MCP clients like Cursor and Claude Desktop.
This server implements the Model Context Protocol (MCP) to provide tools for interacting with Ethereum blockchain data through Etherscan's API. Each tool is exposed as an MCP endpoint that can be called by compatible clients.
-
check-balance- Input: Ethereum address
- Output: ETH balance in both Wei and ETH
-
get-transactions- Input: Ethereum address, optional limit
- Output: Recent transactions with timestamps, values, and addresses
-
get-token-transfers- Input: Ethereum address, optional limit
- Output: Recent ERC20 token transfers with token details
-
get-contract-abi- Input: Contract address
- Output: Contract ABI in JSON format
-
get-contract-code- Input: Contract address
- Output: Contract code in string format
-
get-gas-prices- Input: None
- Output: Current gas prices in Gwei
-
get-ens-name- Input: Ethereum address
- Output: Associated ENS name if available
To add this server to Cursor:
-
Open
Cursorand go toCursor settings->MCP -
Select the option to either add the MCP Server
locallyorglobally, which will open a JSON configuration file. -
Add the configuration details. You can either add the MCP server via Smithery or via this repo locally:
-
Navigate to this URL in your web browser: https://smithery.ai/server/@ThirdGuard/mcp-etherscan-server
-
Enter your Etherscan API key in the field
etherscanApiKeyand click theconnectbutton -
Navigate to the
Cursortab, copy the command, and run it in your terminal.
Paste the following configuration in the JSON file and replace
ETHERSCAN-API-KEY-HEREwith your Etherscan API key:{ "Etherscan Tools": { "command": "npx", "args": [ "-y", "@smithery/cli@latest", "run", "@ThirdGuard/mcp-etherscan-server", "--config", "\"{\\\"etherscanApiKey\\\":\\\"ETHERSCAN-API-KEY-HERE\\\"}\"" ] } }Paste the following configuration in the JSON file and replace
ABSOLUTE-PATH-HERE/mcp-etherscan-server/start.shwith the absolute path to thestart.shin this repo:{ "Etherscan Tools (local)": { "command": "ABSOLUTE-PATH-HERE/mcp-etherscan-server/start.sh", "args": [] } } -
-
Save the configuration
-
The Etherscan tools will now be available in your Cursor AI conversations
You can use commands like:
Check the balance of 0x742d35Cc6634C0532925a3b844Bc454e4438f44e
or
Get the code of this smart contract: 0xdAC17F958D2ee523a2206206994597C13D831ec7 (USDT)
To add new features or modify existing ones:
- The main server logic is in
src/server.ts - Etherscan API interactions are handled in
src/services/etherscanService.ts - Run
npm run buildafter making changes
MIT License - See LICENSE file for details