etherscan
etherscan-mcp-server
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:
- Clone the repository
git clone https://github.com/WrldRelief/etherscan-mcp-server.git
cd etherscan-mcp-server
- Set your Etherscan API key (example for shell)
export ETHERSCAN_API_KEY=your_api_key_here
- Build the server
make build
- (Optional) Install the server to /usr/local/bin
make install # installs to /usr/local/bin
- 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
trpc-agent-go
trpc-agent-go is a powerful Go framework for building intelligent agent systems using large language models (LLMs) and tools.
station
Station is our open-source runtime that lets teams deploy agents on their own infrastructure with full control.
tiger-cli
Tiger CLI is the command-line interface for Tiger Cloud. It includes an MCP server for helping coding agents write production-level Postgres code.
gopls
MCP server for golang projects development: Expand AI Code Agent ability boundary to have a semantic understanding and determinisic information for golang projects.
kubernetes
A Model Context Protocol (MCP) server for the Kubernetes API.
gcp-cost
💰 An MCP server that enables AI assistants to estimate Google Cloud costs, powered by Cloud Billing Catalog API and built with Genkit for Go