以太坊智能合约交互服务器

一个专注于代币操作和智能合约交互的MCP服务器,集成Etherscan API功能。

  • by git-alice
  • Python
  • 本地部署
  • 2 星标
  • 更新于
在 GitHub 查看 git-alice/human_eth_call_mcp

使用说明

人类ETH呼叫MCP服务器

专注于MCP(模型上下文协议)服务器,用于代币操作和与Etherscan API的智能合约交互。

🚀 快速开始

获取免费的Etherscan API密钥:

  • 访问:https://etherscan.io/apis
  • 创建帐户并获取API密钥

🎯 安装方法

用于游标IDE

选择以下方法之一将MCP服务器添加到游标:

方法1:UVX(推荐)

添加到您的 ~/.cursor/mcp.json:

{
  "mcpServers": {
    "human-eth-call": {
      "command": "uvx",
      "args": [
        "--from",
        "git+https://github.com/git-alice/human_eth_call_mcp.git",
        "human-eth-call-mcp"
      ],
      "env": {
        "ETHERSCAN_API_KEY": "your_api_key_here"
      }
    }
  }
}

方法二:Docker

添加到您的 ~/.cursor/mcp.json:

{
  "mcpServers": {
    "human-eth-call": {
      "command": "docker",
      "args": [
        "run","--rm","-i",
        "-e","ETHERSCAN_API_KEY",
        "ghcr.io/git-alice/human_eth_call_mcp:latest"
      ],
      "env": {
        "ETHERSCAN_API_KEY": "your_api_key_here"
      }
    }
  }
}

方法3:就地安装

git clone https://github.com/git-alice/human_eth_call_mcp.git
cd human_eth_call_mcp
bash scripts/cursor-install-mcp.sh

🔧 可用工具

  1. getTokenBalance -获取任何地址的令牌余额
  2. getTokenDetails -获取全面的令牌信息(名称、符号、小数、总供应量)
  3. getContractABI -获取已验证合约的合约ABI
  4. getContractSourceCode -获取合约源代码
  5. executeContractMethod -使用自动编码/解码执行合约方法
  6. getContractCreation -获取合约部署者地址和创建交易哈希(最多5个合约)
  7. ethGetTransactionReceipt -获取包含状态、天然气使用情况和日志的单笔交易收据
  8. ethGetTransactionReceipts -获取多个交易收据(最多20笔交易),包括状态、天然气使用情况和日志
  9. getEventLogs -使用主题筛选获取事件日志(支持事件签名和十六进制主题,可选主题1用于高级筛选,返回最新示例)
  10. getTimestamperByBlockNumber -获取块号的UNIX时间戳