Get the FREE Ultimate OpenClaw Setup Guide →

etherscan

etherscan-mcp-server

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio wrldrelief-etherscan-mcp-server etherscan-mcp-server \
  --env ETHERSCAN_API_KEY="$your_api_key"

How to use

The Etherscan MCP Server is a Go-based implementation that exposes Etherscan API access via the Model Context Protocol (MCP). It enables large language model (LLM) applications to query Etherscan data across 50+ supported chains using a single API key. Available tools cover a wide range of blockchain data: account balances, blocks, contract ABI and source code, gas prices, token details, transactions, and various queryable views like token transfers and ERC721 activity. Clients interact with the server through MCP-compatible endpoints (stdin/stdout by default, or SSE mode if enabled) and receive structured data that LLMs can reason over.

To use the server, start it with your Etherscan API key configured in the environment. The default operation mode is stdin/stdout, which is ideal for direct integration with LLM applications. If you need real-time streaming responses, you can run the server in SSE mode and connect via the provided HTTP SSE endpoint. The MCP config demonstrates how to declare the server and pass the API key securely via environment variables for your deployment environment.

How to install

Prerequisites:

  • Go toolchain installed (to build from source) or prebuilt binaries if available
  • Git
  • Make (as per repository)
  • An Etherscan API key (to be set as an environment variable)

Installation steps:

  1. Clone the repository
git clone https://github.com/WrldRelief/etherscan-mcp-server.git
cd etherscan-mcp-server
  1. Set your Etherscan API key (example for shell)
export ETHERSCAN_API_KEY=your_api_key_here
  1. Build the server
make build
  1. (Optional) Install the server to /usr/local/bin
make install  # installs to /usr/local/bin
  1. Run the server (default stdin/stdout mode)
./bin/etherscan-mcp-server

Optionally, run in SSE mode for HTTP SSE support:

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

Additional notes

Tips and notes:

  • Provide your Etherscan API key via environment variable ETHERSCAN_API_KEY. In MCP config, you can reference it as shown in examples (e.g., "$your_api_key").
  • In SSE mode, the server exposes an HTTP endpoint (default port 4000, configurable via --port). Use the provided SSE MCP config snippet to connect to the HTTP URL.
  • The server supports a broad set of tools for complex queries, including getContractABI, getTransactionByHash, getTokenDetails, getGasOracle, and more. Refer to the Tools section in the README for parameter specifics.
  • Ensure your deployment environment restricts API key exposure; prefer using environment variable injection rather than hard-coding keys.
  • If you encounter rate limiting or errors from the Etherscan API, consider distributing requests across multiple chains or staggering queries, since the MCP layer will route per-tool requests to the Etherscan API.

Related MCP Servers

Sponsor this space

Reach thousands of developers