mcp-otc
OfficialMCP Etherscan 服务器
一个 MCP(模型上下文协议)服务器,通过 Etherscan 的 API 提供以太坊区块链数据工具。功能包括查询 ETH 余额、查看交易历史记录、追踪 ERC20 转账、获取合约 ABI、监控 Gas 价格以及解析 ENS 域名。
特征
余额查询:获取任意以太坊地址的 ETH 余额
交易历史:查看最近交易的详细信息
代币转移:通过代币详细信息跟踪 ERC20 代币转移
合约 ABI :获取智能合约 ABI 以供开发
天然气价格:监控当前天然气价格(安全低、标准、快速)
ENS 解析:将以太坊地址解析为 ENS 名称
Related MCP server: Etherscan MCP Python
先决条件
Node.js >= 18
Etherscan API 密钥(从https://etherscan.io/apis获取)
安装
克隆存储库:
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 客户端兼容。
工作原理
该服务器实现了模型上下文协议 (MCP),以提供通过 Etherscan 的 API 与以太坊区块链数据交互的工具。每个工具都以 MCP 端点的形式公开,可供兼容的客户端调用。
可用工具
check-balance输入:以太坊地址
输出:以 Wei 和 ETH 为单位的 ETH 余额
get-transactions输入:以太坊地址,可选限制
输出:带有时间戳、值和地址的近期交易
get-token-transfers输入:以太坊地址,可选限制
输出:最近的 ERC20 代币转移及代币详细信息
get-contract-abi输入:合约地址
输出:JSON 格式的合约 ABI
get-gas-prices输入:无
输出:当前 Gwei 中的 gas 价格
get-ens-name输入:以太坊地址
输出:关联的 ENS 名称(如果可用)
与 Claude Desktop 一起使用
要将此服务器添加到 Claude Desktop:
使用
npm start启动服务器在 Claude Desktop 中:
前往“设置”
导航至 MCP 服务器部分
点击“添加服务器”
输入以下配置:
{ "name": "Etherscan Tools", "transport": "stdio", "command": "node /path/to/mcp-etherscan-server/build/index.js" }保存配置
Etherscan 工具现在将在您的 Claude 对话中可用
Claude 中的示例用法
您可以使用如下命令:
Check the balance of 0x742d35Cc6634C0532925a3b844Bc454e4438f44e或者
Show me recent transactions for vitalik.eth发展
要添加新功能或修改现有功能:
主服务器逻辑位于
src/server.tsEtherscan API 交互在
src/services/etherscanService.ts中处理更改后构建:
npm run build
执照
MIT 许可证 - 详情请参阅许可证文件
Available Tools
6 toolscheck-balanceB
Check the ETH balance of an Ethereum address
Inputs: address (required).
get-contract-abiC
Get the ABI for a smart contract
Inputs: address (required).
get-ens-nameB
Get the ENS name for an Ethereum address
Inputs: address (required).
get-gas-pricesA
Get current gas prices in Gwei
Inputs: no named parameters.
get-token-transfersC
Get ERC20 token transfers for an Ethereum address
Inputs: address (required), limit.
get-transactionsB
Get recent transactions for an Ethereum address
Inputs: address (required), limit.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Each tool has a clearly distinct purpose targeting different Ethereum-related functions: checking balances, retrieving contract ABIs, resolving ENS names, getting gas prices, fetching token transfers, and listing transactions. There is no overlap or ambiguity in their intended use cases.
All tool names follow a consistent verb_noun pattern using snake_case (e.g., check-balance, get-contract-abi, get-ens-name). The naming is uniform and predictable across all six tools.
With 6 tools, this server is well-scoped for its Ethereum/blockchain domain. Each tool serves a specific, essential function without redundancy, making the count appropriate and manageable.
The toolset covers key read-only operations for Ethereum interactions, including balance checks, contract data, ENS resolution, gas prices, token transfers, and transactions. A minor gap exists in write operations (e.g., sending transactions or interacting with contracts), but the provided tools are sufficient for common querying tasks.
Maintenance
Related MCP Connectors
Etherscan MCP — multichain block-explorer API (Etherscan V2)
Read-only Etherscan V2 blockchain data: balances, transactions, transfers, tokens, contracts, logs.
Etherscan Api - 71 tools for data, metrics, and on-chain analytics
Keyless, read-only BNB Chain and Ethereum data: transactions by hash, tokens with a lookalike check
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables comprehensive blockchain data analysis and exploration through the BlockScout API. Provides 56+ tools for transaction analysis, address exploration, token management, smart contract analysis, and market research across multiple blockchain networks.-
- AlicenseNot gradedqualityDmaintenanceProvides comprehensive access to Ethereum blockchain data through the Etherscan API, including account, block, contract, transaction, token, gas, statistics, logs, and RPC proxy tools.4MIT
- AlicenseAqualityDmaintenanceA read-only MCP server that queries multichain EVM on-chain data through Blockscout REST API, providing tools for address info, transactions, logs, and more.1621 npmMIT
- AlicenseNot gradedqualityBmaintenanceProvides multichain block-explorer data from Etherscan via MCP tools for token balances, contract ABI, and source code.101 npmMIT