Ethereum RPC MPC Server

Ethereum RPC MPC Server

site icon
2025.03.28 11
TypeScript区块链交互AI 模型支持金融服务
Ethereum RPC MPC Server 是一个基于 TypeScript 的 MCP 服务器,利用 MCP SDK 支持所有 Ethereum JSON-RPC 调用,使 AI 模型能够与区块链数据进行交互。该服务器充当 AI 模型与 EVM 区块链之间的桥梁,提供对链上数据和功能的无缝访问。
View on GitHub

Overview

基本能力

产品定位

Ethereum RPC MPC Server 是一个连接 AI 模型与区块链数据的中间件,主要用于支持 AI 模型通过 JSON-RPC 接口与 Ethereum 区块链进行交互。

核心功能

  1. 支持所有 Ethereum JSON-RPC 调用
  2. 提供与 EVM 区块链的无缝交互
  3. 支持 Zircuit 特定的 RPC 方法(如 zirc_isQuarantinedzirc_getQuarantined
  4. 支持多链和多 RPC 端点(未来版本)
  5. 提供服务器分析功能(未来版本)

适用场景

  1. AI 模型需要查询区块链数据(如区块号、地址余额等)
  2. 开发者需要构建与区块链交互的 AI 应用
  3. 监控交易隔离状态(特别是 Zircuit 链)
  4. 获取智能合约信息
  5. 查询交易详情

工具列表

  1. MCP Analytics Middleware:用于获取请求数量、请求持续时间以及错误报告的概览。
  2. Zircuit SLS Methods:用于检查特定交易是否被隔离以及查询所有隔离交易。

常见问题解答

  1. 如何更改默认的 Ethereum RPC URL? 可以在 inspector 设置中更改,或者在启动服务器时提供 RPC URL。
  2. 如何启用分析功能? 使用 --analytics 标志并提供 Sqlite 文件的路径。
  3. 如何连接到不同的区块链? 在启动服务器时提供相应的 RPC URL 和链名称。

使用教程

使用依赖

  1. 确保已安装 Node.js 和 yarn。
  2. 克隆仓库并安装依赖: bash git clone [email protected]:Phillip-Kemper/ethereum-rpc-mpc.git cd ethereum-rpc-mpc yarn install

安装教程

  1. 构建项目: bash yarn build
  2. 启动 Inspector(使用默认 Ethereum RPC): bash yarn inspector
  3. 启动服务器(可指定 RPC URL 和链名称): bash yarn start [RPC_URL] [CHAIN_NAME] 或使用 npx(无需安装): bash npx -y ethereum-rpc-mpc [RPC_URL] [CHAIN_NAME]

调试方式

  1. 检查服务器是否正常运行: bash yarn start https://eth.llamarpc.com Ethereum
  2. 使用 Cursor 进行调试:
  3. 在 Cursor 中,转到 Settings > Cursor Settings > MCP
  4. 添加新的 MCP 服务器,配置如下:
    • Name: Ethereum RPC
    • Type: Command
    • Command: npx -y ethereum-rpc-mpc https://eth.llamarpc.com Ethereum
    • Command: node /path/to/ethereum-rpc-mpc/dist/server/index.js https://eth.llamarpc.com Ethereum
  5. 启用分析功能进行调试: bash npx -y ethereum-rpc-mpc https://eth.llamarpc.com Ethereum --analytics --db-path /Users/satoshi/Desktop/analytics.db

许可证

该项目遵循 MIT 开源许可条款。