etherscan-mcp-python

FLock-io/etherscan-mcp-python

3.3

If you are the rightful owner of etherscan-mcp-python and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

The Etherscan MCP Python Server is a comprehensive solution for accessing Ethereum blockchain data through the Etherscan API, implemented using the Model Context Protocol (MCP).

The Etherscan MCP Python Server is a robust implementation designed to provide seamless access to Ethereum blockchain data via the Etherscan API. This server offers a wide array of tools, over 53 in total, that cater to various aspects of blockchain data retrieval and analysis. These tools are categorized into several groups, including account, block, contract, transaction, token, gas, statistics, RPC, and logs tools. Each category is tailored to provide specific functionalities, such as checking account balances, retrieving transaction histories, accessing block data, and more. The server is built to support multiple Ethereum networks, including the mainnet and testnets like Goerli and Sepolia, through the use of the `chainid` parameter. It also includes features for error handling, performance optimization, and security best practices, ensuring reliable and efficient operation. The server is compatible with the Agno Framework, allowing for easy integration and extended functionality.

Features

  • Comprehensive Access: Provides over 53 tools for accessing various Ethereum blockchain data.
  • Multi-Chain Support: Supports multiple Ethereum networks via the `chainid` parameter.
  • Error Handling: Includes comprehensive error handling for missing API keys, invalid parameters, and more.
  • Performance Optimization: Features efficient JSON parsing, response formatting, and proper timeout handling.
  • Security Best Practices: Emphasizes API key management, rate limiting, and data validation.

Usages

usage with standalone server

python server.py

usage with mcp tools agno framework

python
from agno.tools.mcp import MCPTools

etherscan_mcp = MCPTools(
    command="python etherscan-mcp-python/server.py",
    env={"ETHERSCAN_API_KEY": "your_api_key"},
    timeout_seconds=120
)

Tools

  1. account_balance

    Get ETH balance for a single address.

  2. block_getblockreward

    Get block mining reward and uncle rewards.

  3. contract_getabi

    Get contract ABI for verified contracts.