一个通过 Etherscan 的 API 提供以太坊区块链数据工具的 MCP(Model Context Protocol)服务器。功能包括检查 ETH 余额、查看交易历史记录、跟踪 ERC20 转账、获取合约 ABI、监控 gas 价格和解析 ENS 名称。
git clone [your-repo-url]
cd mcp-etherscan-server

npm install
.env
文件:ETHERSCAN_API_KEY=your_api_key_here
npm run build
启动服务器:
npm start
服务器将在 stdio 上运行,使其与 Claude Desktop 等 MCP 客户端兼容。
此服务器实现了 Model Context Protocol (MCP),通过 Etherscan 的 API 提供与以太坊区块链数据交互的工具。每个工具都作为 MCP 端点公开,可以由兼容的客户端调用。
check-balance
get-transactions
get-token-transfers
get-contract-abi
get-gas-prices
get-ens-name
要将此服务器添加到 Claude Desktop:
使用 npm start
启动服务器
在 Claude Desktop 中:
{
"name": "Etherscan Tools",
"transport": "stdio",
"command": "node /path/to/mcp-etherscan-server/build/index.js"
}

Etherscan 工具现在将在您的 Claude 对话中可用
您可以使用如下命令:
Check the balance of 0x742d35Cc6634C0532925a3b844Bc454e4438f44e
或
Show me recent transactions for vitalik.eth
要添加新功能或修改现有功能:
src/server.ts
中src/services/etherscanService.ts
中处理npm run build
MIT 许可证 - 有关详细信息,请参阅 LICENSE 文件