mcp etherscan server
Provides Ethereum blockchain data tools via Etherscan's API, enabling users to check ETH balances, view transactions, track token transfers, fetch contract ABIs, monitor gas prices, and resolve ENS names.
Provides Ethereum blockchain data tools via Etherscan's API, enabling users to check ETH balances, view transactions, track token transfers, fetch contract ABIs, monitor gas prices, and resolve ENS names.
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.
Clone the repository:
git clone [your-repo-url]
cd mcp-etherscan-server
Install dependencies:
npm install
Create a .env
file in the root directory:
ETHERSCAN_API_KEY=your_api_key_here
Build the project:
npm run build
Start the server:
npm start
The server will run on stdio, making it compatible with MCP clients like 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
Output: ETH balance in both Wei and ETH
get-transactions
Output: Recent transactions with timestamps, values, and addresses
get-token-transfers
Output: Recent ERC20 token transfers with token details
get-contract-abi
Output: Contract ABI in JSON format
get-gas-prices
Output: Current gas prices in Gwei
get-ens-name
To add this server to Claude Desktop:
Start the server using npm start
In Claude Desktop:
{
"name": "Etherscan Tools",
"transport": "stdio",
"command": "node /path/to/mcp-etherscan-server/build/index.js"
}
Save the configuration
The Etherscan tools will now be available in your Claude conversations
You can use commands like:
Check the balance of 0x742d35Cc6634C0532925a3b844Bc454e4438f44e
or
Show me recent transactions for vitalik.eth
To add new features or modify existing ones:
src/server.ts
src/services/etherscanService.ts
npm run build
MIT License - See LICENSE file for details
[
{
"description": "Check the ETH balance of an Ethereum address",
"inputSchema": {
"properties": {
"address": {
"description": "Ethereum address (0x format)",
"pattern": "^0x[a-fA-F0-9]{40}$",
"type": "string"
}
},
"required": [
"address"
],
"type": "object"
},
"name": "check-balance"
},
{
"description": "Get recent transactions for an Ethereum address",
"inputSchema": {
"properties": {
"address": {
"description": "Ethereum address (0x format)",
"pattern": "^0x[a-fA-F0-9]{40}$",
"type": "string"
},
"limit": {
"description": "Number of transactions to return (max 100)",
"maximum": 100,
"minimum": 1,
"type": "number"
}
},
"required": [
"address"
],
"type": "object"
},
"name": "get-transactions"
},
{
"description": "Get ERC20 token transfers for an Ethereum address",
"inputSchema": {
"properties": {
"address": {
"description": "Ethereum address (0x format)",
"pattern": "^0x[a-fA-F0-9]{40}$",
"type": "string"
},
"limit": {
"description": "Number of transfers to return (max 100)",
"maximum": 100,
"minimum": 1,
"type": "number"
}
},
"required": [
"address"
],
"type": "object"
},
"name": "get-token-transfers"
},
{
"description": "Get the ABI for a smart contract",
"inputSchema": {
"properties": {
"address": {
"description": "Contract address (0x format)",
"pattern": "^0x[a-fA-F0-9]{40}$",
"type": "string"
}
},
"required": [
"address"
],
"type": "object"
},
"name": "get-contract-abi"
},
{
"description": "Get current gas prices in Gwei",
"inputSchema": {
"properties": {},
"type": "object"
},
"name": "get-gas-prices"
},
{
"description": "Get the ENS name for an Ethereum address",
"inputSchema": {
"properties": {
"address": {
"description": "Ethereum address (0x format)",
"pattern": "^0x[a-fA-F0-9]{40}$",
"type": "string"
}
},
"required": [
"address"
],
"type": "object"
},
"name": "get-ens-name"
}
]