
Ethereum RPC MPC Server

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 区块链进行交互。
核心功能
- 支持所有 Ethereum JSON-RPC 调用
- 提供与 EVM 区块链的无缝交互
- 支持 Zircuit 特定的 RPC 方法(如
zirc_isQuarantined
和zirc_getQuarantined
) - 支持多链和多 RPC 端点(未来版本)
- 提供服务器分析功能(未来版本)
适用场景
- AI 模型需要查询区块链数据(如区块号、地址余额等)
- 开发者需要构建与区块链交互的 AI 应用
- 监控交易隔离状态(特别是 Zircuit 链)
- 获取智能合约信息
- 查询交易详情
工具列表
- MCP Analytics Middleware:用于获取请求数量、请求持续时间以及错误报告的概览。
- Zircuit SLS Methods:用于检查特定交易是否被隔离以及查询所有隔离交易。
常见问题解答
- 如何更改默认的 Ethereum RPC URL? 可以在 inspector 设置中更改,或者在启动服务器时提供 RPC URL。
- 如何启用分析功能?
使用
--analytics
标志并提供 Sqlite 文件的路径。 - 如何连接到不同的区块链? 在启动服务器时提供相应的 RPC URL 和链名称。
使用教程
使用依赖
- 确保已安装 Node.js 和 yarn。
- 克隆仓库并安装依赖:
bash git clone [email protected]:Phillip-Kemper/ethereum-rpc-mpc.git cd ethereum-rpc-mpc yarn install
安装教程
- 构建项目:
bash yarn build
- 启动 Inspector(使用默认 Ethereum RPC):
bash yarn inspector
- 启动服务器(可指定 RPC URL 和链名称):
bash yarn start [RPC_URL] [CHAIN_NAME]
或使用 npx(无需安装):bash npx -y ethereum-rpc-mpc [RPC_URL] [CHAIN_NAME]
调试方式
- 检查服务器是否正常运行:
bash yarn start https://eth.llamarpc.com Ethereum
- 使用 Cursor 进行调试:
- 在 Cursor 中,转到 Settings > Cursor Settings > MCP
- 添加新的 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
- 启用分析功能进行调试:
bash npx -y ethereum-rpc-mpc https://eth.llamarpc.com Ethereum --analytics --db-path /Users/satoshi/Desktop/analytics.db