Skip to main content
Glama

mcp-otc

Official
by otc-ai

MCP Etherscan 服务器

一个 MCP(模型上下文协议)服务器,通过 Etherscan 的 API 提供以太坊区块链数据工具。功能包括查询 ETH 余额、查看交易历史记录、追踪 ERC20 转账、获取合约 ABI、监控 Gas 价格以及解析 ENS 域名。

特征

  • 余额查询:获取任意以太坊地址的 ETH 余额
  • 交易历史:查看最近交易的详细信息
  • 代币转移:通过代币详细信息跟踪 ERC20 代币转移
  • 合约 ABI :获取智能合约 ABI 以供开发
  • 天然气价格:监控当前天然气价格(安全低、标准、快速)
  • ENS 解析:将以太坊地址解析为 ENS 名称

先决条件

安装

  1. 克隆存储库:
git clone [your-repo-url] cd mcp-etherscan-server
  1. 安装依赖项:
npm install
  1. 在根目录中创建一个.env文件:
ETHERSCAN_API_KEY=your_api_key_here
  1. 构建项目:
npm run build

运行服务器

启动服务器:

npm start

该服务器将在 stdio 上运行,使其与 Claude Desktop 等 MCP 客户端兼容。

工作原理

该服务器实现了模型上下文协议 (MCP),以提供通过 Etherscan 的 API 与以太坊区块链数据交互的工具。每个工具都以 MCP 端点的形式公开,可供兼容的客户端调用。

可用工具

  1. check-balance
    • 输入:以太坊地址
    • 输出:以 Wei 和 ETH 为单位的 ETH 余额
  2. get-transactions
    • 输入:以太坊地址,可选限制
    • 输出:带有时间戳、值和地址的近期交易
  3. get-token-transfers
    • 输入:以太坊地址,可选限制
    • 输出:最近的 ERC20 代币转移及代币详细信息
  4. get-contract-abi
    • 输入:合约地址
    • 输出:JSON 格式的合约 ABI
  5. get-gas-prices
    • 输入:无
    • 输出:当前 Gwei 中的 gas 价格
  6. get-ens-name
    • 输入:以太坊地址
    • 输出:关联的 ENS 名称(如果可用)

与 Claude Desktop 一起使用

要将此服务器添加到 Claude Desktop:

  1. 使用npm start启动服务器
  2. 在 Claude Desktop 中:
    • 前往“设置”
    • 导航至 MCP 服务器部分
    • 点击“添加服务器”
    • 输入以下配置:
      { "name": "Etherscan Tools", "transport": "stdio", "command": "node /path/to/mcp-etherscan-server/build/index.js" }
    • 保存配置
  3. Etherscan 工具现在将在您的 Claude 对话中可用

Claude 中的示例用法

您可以使用如下命令:

Check the balance of 0x742d35Cc6634C0532925a3b844Bc454e4438f44e

或者

Show me recent transactions for vitalik.eth

发展

要添加新功能或修改现有功能:

  1. 主服务器逻辑位于src/server.ts
  2. Etherscan API 交互在src/services/etherscanService.ts中处理
  3. 更改后构建: npm run build

执照

MIT 许可证 - 详情请参阅许可证文件

Install Server
A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

来自 Etherscan 的分叉,专用于 chain-id 175

  1. 特征
    1. 先决条件
      1. 安装
        1. 运行服务器
          1. 工作原理
            1. 可用工具
          2. 与 Claude Desktop 一起使用
            1. Claude 中的示例用法
          3. 发展
            1. 执照

              Related MCP Servers

              • -
                security
                A
                license
                -
                quality
                Fork of @cyanheads toolkit MCP server. Added encoding functions, removed system network functions.
                Last updated -
                6
                2
                TypeScript
                Apache 2.0
              • -
                security
                A
                license
                -
                quality
                A comprehensive MCP server for tooling interactions(40+) and resource accessibility(60+) with Algorand blockchain, plus many useful prompts.
                Last updated -
                31
                31
                TypeScript
                MIT License
                • Linux
                • Apple
              • A
                security
                F
                license
                A
                quality
                MCP Server for running Bruno Collections
                Last updated -
                1
                18
                9
                JavaScript
                • Apple
              • A
                security
                A
                license
                A
                quality
                An MCP server that enables Cline to analyze binaries using Binary Ninja with a Personal License through a bridge implementation.
                Last updated -
                4
                4
                Python
                GPL 3.0

              View all related MCP servers

              MCP directory API

              We provide all the information about MCP servers via our MCP API.

              curl -X GET 'https://glama.ai/api/mcp/v1/servers/otc-ai/mcp-otc'

              If you have feedback or need assistance with the MCP directory API, please join our Discord server