MCP Etherscan Server

MCP Etherscan Server

An MCP server providing comprehensive access to Ethereum blockchain data across 72+ networks via Etherscan's V2 API. It enables users to check balances, track transactions, analyze smart contracts, and monitor gas prices through natural language.

Category
访问服务器

README

MCP Etherscan Server

An MCP (Model Context Protocol) server that provides Ethereum blockchain data tools via Etherscan's V2 API. Supports 72+ blockchain networks with a single API key, including Ethereum, Arbitrum, Base, Polygon, Optimism, and many more.

Features

Core Features

  • Multi-Chain Support: 72+ networks (Ethereum, L2s, sidechains, testnets)
  • Balance Checking: Get native token balance for any address
  • Transaction History: View recent transactions with detailed information
  • Token Transfers: Track ERC20/ERC721/ERC1155 token transfers
  • Contract Tools: Fetch ABIs, source code, verify contracts
  • Gas Prices: Monitor current gas prices across networks
  • ENS Resolution: Resolve Ethereum addresses to ENS names

V2 API Features (New)

  • Beacon Withdrawals: Track ETH 2.0 staking withdrawals
  • Token Info: Get comprehensive token metadata and social links
  • Token Holders: View top holders for any token
  • Token Portfolio: Get all token balances for an address
  • Event Logs: Query contract events with advanced filtering
  • Network Stats: ETH supply, price, market cap data
  • Daily Statistics: Historical transaction counts

Supported Networks

72+ networks including:

Category Networks
Ethereum Mainnet, Sepolia, Holesky, Hoodi
Layer 2 Arbitrum, Optimism, Base, zkSync, Scroll, Linea, Mantle, Blast
Sidechains Polygon, BNB Chain, Avalanche, Fantom, Gnosis
Emerging Berachain, Sonic, Taiko, Unichain, World, Abstract

See docs/api/NETWORK_SUPPORT.md for the complete list.

Prerequisites

  • Node.js >= 18
  • An Etherscan API key (get one at https://etherscan.io/apis)
  • One API key works for all 72+ networks!

Installation

  1. Clone the repository:
git clone [your-repo-url]
cd mcp-etherscan-server
  1. Install dependencies:
npm install
  1. Create a .env file in the root directory:
ETHERSCAN_API_KEY=your_api_key_here
  1. Build the project:
npm run build

Running the Server

Start the server:

npm start

The server will run on stdio, making it compatible with MCP clients like Claude Desktop.

How It Works

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.

Available Tools (24 Total)

Account Tools

Tool Description
check-balance Get native token balance for any address
get-transactions Recent transactions with timestamps and values
get-token-transfers ERC20 token transfers with token details
get-internal-transactions Internal transactions with trace details
get-mined-blocks Blocks mined by an address with rewards
get-beacon-withdrawals ETH 2.0 staking withdrawals

Token Tools (V2)

Tool Description
get-token-info Comprehensive token metadata and social links
get-token-holders Top token holders with balances
get-token-portfolio All token balances for an address

Contract Tools

Tool Description
get-contract-abi Contract ABI in JSON format
get-contract-source Verified source code and metadata
get-contract-creation Creator address and deployment tx
verify-contract Submit contract for verification
check-verification Check verification status
verify-proxy Verify proxy contract
get-verified-contracts Recently verified contracts

Block Tools

Tool Description
get-block-details Block info (hash, gas, transactions)
get-block-reward Block and uncle rewards

Network Tools (V2)

Tool Description
get-gas-prices Current gas prices in Gwei
get-network-stats ETH supply, price, market cap
get-daily-stats Daily transaction statistics
get-logs Event logs with topic filtering
list-networks All 72+ supported networks

Utility Tools

Tool Description
get-ens-name Resolve address to ENS name

Using with Claude Desktop

To add this server to Claude Desktop:

  1. In Claude Desktop settings, add this server configuration:

    {
      "mcpServers": {
        "etherscan": {
          "command": "node",
          "args": ["/path/to/mcp-etherscan-server/build/index.js"],
          "env": {
            "ETHERSCAN_API_KEY": "your_api_key_here"
          }
        }
      }
    }
    
  2. The Etherscan tools will now be available in your Claude conversations

Example Usage in Claude

Check the balance of 0x742d35Cc6634C0532925a3b844Bc454e4438f44e on Ethereum
Show me recent transactions for vitalik.eth on mainnet
Get token holders for USDC on Polygon
List all supported networks

Specifying Networks

All tools support a network parameter. You can use:

  • Network slug: "ethereum", "polygon", "arbitrum", "base"
  • Chain ID: 1, 137, 42161, 8453
Check balance of 0x... on arbitrum
Check balance of 0x... with chainId 42161

Documentation

Comprehensive API documentation is available in the docs/ directory:

Development

Project Structure

src/
├── index.ts              # Entry point
├── server.ts             # MCP server with 24 tools
├── config/
│   └── networks.ts       # 72+ network configurations
├── api/
│   └── v2-request-builder.ts  # V2 API request builder
├── services/
│   └── etherscanService.ts    # Etherscan API service
├── types/
│   └── index.ts          # TypeScript type definitions
└── __tests__/            # Test suites

Building

npm run build    # Compile TypeScript
npm run test     # Run tests
npm start        # Start server

Adding New Networks

Networks are configured in src/config/networks.ts. The V2 API automatically handles the chainid parameter.

V2 API Migration

This server uses Etherscan's V2 API which:

  • Uses a unified endpoint: https://api.etherscan.io/v2/api
  • Requires chainid parameter for all requests
  • Supports 72+ networks with a single API key
  • Deprecates the old per-network API URLs

See Etherscan V2 Migration Guide for details.

License

MIT License - See LICENSE file for details

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选