HE

huahuayu/etherscan-mcp-server

Developer tools

Эта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал

10 stars 4 forks Качество 52 Тренд 18

etherscan v2 api mcp server

Обзор

A Go implementation of an Etherscan API client for the Model Context Protocol (MCP) that enables LLM applications to access Etherscan blockchain data. - Access Etherscan API V2 for multi-chain support - Use a single API key for over 50 supported chains - Supports various blockchain data retrieval methods: - Account balances - Block information - Contract data (ABI, source code) - Gas oracle - Token information - Transaction data - And more - Etherscan API key (get from https://etherscan.io/myapikey) Run the server using stdin/stdout communication (default mode): This mode is useful for direct integration with LLM applications that communicate via stdin/stdout. Restart cursor and check if it's success: Run the server in Server-Sent Events mode: In SSE mode, the server listens on HTTP and provides an SSE endpoint.

README

Показан фрагмент оригинального README. Открыть оригинал.

Etherscan MCP Server

A Go implementation of an Etherscan API client for the Model Context Protocol (MCP) that enables LLM applications to access Etherscan blockchain data.

Features

  • Access Etherscan API V2 for multi-chain support
  • Use a single API key for over 50 supported chains
  • Supports various blockchain data retrieval methods:
    • Account balances
    • Block information
    • Contract data (ABI, source code)
    • Gas oracle
    • Token information
    • Transaction data
    • And more

Requirements

Installation

  1. Clone the repository:

    git clone https://github.com/huahuayu/etherscan-mcp-server.git
    cd etherscan-mcp-server
    
  2. Set Etherscan API key env variable:

    ETHERSCAN_API_KEY=your_api_key_here
    
  3. Build the server:

    make build
    
  4. Install the server:

    make install # install to /usr/local/bin
    

Usage

Default Mode (Standard Input/Output)

Run the server using stdin/stdout communication (default mode):

./bin/etherscan-mcp-server

This mode is useful for direct integration with LLM applications that communicate via stdin/stdout.

MCP config:

{
  "mcpServers": {
    "etherscan-mcp-server": {
      "command": "etherscan-mcp-server",
      "env": {
        "ETHERSCAN_API_KEY": "$your_api_key"
      }
    }
  }
}

Restart cursor and check if it’s success:

SSE Mode

Run the server in Server-Sent Events mode:

./bin/etherscan-mcp-server --sse

In SSE mode, the server listens on HTTP and provides an SSE endpoint.

SSE MCP config:

{
  "mcpServers": {
    "etherscan-mcp-server": {
      "url": "http://localhost:4000/sse",
      "env": {
        "ETHERSCAN_API_KEY": "$your_api_key"
      }
    }
  }
}

Server Options

  • --sse: Enable SSE server mode (default is stdin/stdout mode)
  • --port : Specify the port for SSE server (defaults to PORT env var or 4000)

Connection Endpoints (SSE Mode)

When running in SSE mode, the server provides:

  • SSE Endpoint: http://localhost:4000/sse

Supported Chains

50+ chains supported, please refer to the Etherscan V2 Supported Chains for a complete list and their corresponding Chain IDs.

Note on Free Tier Limitations & RPC Fallback: According to Etherscan’s supported chains policy, some networks are not available under the Free API plan. These include (but are not limited to):

  • BNB Smart Chain (BSC) — Chain ID: 56
  • Base — Chain ID: 8453
  • Avalanche C-Chain — Chain ID: 43114
Открыть полный README на GitHub

Установка

This server does not publish a one-line install command.

Open the repository installation guide Новичок в MCP? Начните с руководства на mcpskill.org →

Конфигурация

{ "mcpServers": { "etherscan-mcp-server": { "command": "etherscan-mcp-server", "env": { "ETHERSCAN_API_KEY": "$your_api_key" } } } }