Get the FREE Ultimate OpenClaw Setup Guide →

etherscan-v2

Etherscan V2 MCP Server exposes a curated set of Etherscan V2 endpoints as Model Context Protocol (MCP) tools.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio denizumutdereli-etherscan-v2-mcp-server node dist/index.js \
  --env HOST="default 0.0.0.0" \
  --env PORT="default 5009" \
  --env REDIS_HOST="optional, Redis host for cache" \
  --env REDIS_PORT="optional, Redis port for cache" \
  --env ETHERSCAN_PRO="optional, enable pro features if available" \
  --env OPENAI_API_KEY="optional, enables NL routing for ethv2_nl_query" \
  --env REDIS_PASSWORD="optional, Redis password for cache" \
  --env ETHERSCAN_API_KEY="Your Etherscan (or supported explorer) API key"

How to use

Etherscan V2 MCP Server exposes a curated set of Etherscan V2 endpoints as MCP tools. It can run as a standard streamable HTTP MCP endpoint or in stdio mode for MCP-aware clients. The server is built with native ESM and provides a broad catalog of tools for accounts, blocks, transactions, contracts, logs, tokens, gas, stats, and JSON-RPC proxies, all designed to be consumed via MCP sessions or REST-like endpoints. To use MCP clients, you can start the server in stdio mode for MCP tooling or through the HTTP MCP interface to leverage the tool catalog and per-tool inputs. The server caches responses (Redis-backed if you supply Redis, otherwise in-memory) and requires a valid Etherscan API key.

How to install

Prerequisites:

  • Node.js 20+ (recommended 22+)
  • npm, yarn, or pnpm

Installation steps:

  1. Install dependencies npm i

  2. Create environment file (example) cp .env.example .env

    Edit .env with your keys and settings

  3. Build and run (production) npm run build npm start

  4. Run in MCP stdio mode (for MCP clients) node dist/index.js --stdio

  5. Optional: run in development mode npm run dev

Notes:

  • Ensure ETHERSCAN_API_KEY is set in the environment for API access.
  • If you enable REDIS_HOST/PORT/PASSWORD, the server will use Redis for caching; otherwise it will use an in-memory cache.

Additional notes

Tips and common issues:

  • Always include chainid in tool inputs and use pagination (page/offset) for list endpoints.
  • When using logs, apply address/topic filters and block windows to control result scope.
  • If you encounter cache misses or Redis connection issues, verify REDIS_HOST/PORT/PASSWORD and network accessibility.
  • For NL routing, you can enable OPENAI_API_KEY to allow ethv2_nl_query to interpret simple intents; otherwise the endpoint provides guidance.
  • The MCP server uses a streamable HTTP transport under /mcp and also supports a plain HTTP health/tools API under /health and /api/tools respectively.

Related MCP Servers

Sponsor this space

Reach thousands of developers