
一台利用MCP SDK支持所有以太坊JSON-RPC调用的TypeScript MCP服务器,使AI模型能够与区块链数据交互。
概览
一台利用MCP SDK支持所有以太坊JSON-RPC调用的TypeScript MCP服务器,使AI模型能够与区块链数据交互。 该项目提供了一个模型上下文协议(MCP)服务器,允许像Cursor或Claude(或任何MCP客户端实现)这样的AI助手通过标准化的JSON-RPC接口与以太坊区块链数据交互。它作为AI模型与EVM区块链之间的桥梁,实现对链上数据和功能的无缝访问。 1. 在光标中,进入设置>光标设置>MCP 2.添加一个配置如下的新MCP服务器:- 名称:以太坊RPC - 类型:命令 - 命令:npx -y ethereum-rpc-mpc https://eth.llamarpc.com 以太坊或- 命令:node /path/to/ethereum-rpc-mpc/dist/server/index.js https://eth.llamarpc.com 以太坊 你还可以使用MCP Analytics中间件启用分析功能,以了解请求数量、请求时长以及所有工具和资源的错误报告。
概述(AI 翻译)
一台利用MCP SDK支持所有以太坊JSON-RPC调用的TypeScript MCP服务器,使AI模型能够与区块链数据交互。
概述
该项目提供了一个模型上下文协议(MCP)服务器,允许像Cursor或Claude(或任何MCP客户端实现)这样的AI助手通过标准化的JSON-RPC接口与以太坊区块链数据交互。它作为AI模型与EVM区块链之间的桥梁,实现对链上数据和功能的无缝访问。
安装
用途
与光标一起使用
使用该MPC服务器配合光标:
- 在光标中,进入设置>光标设置>MCP
- 添加一个配置如下的新MCP服务器:
- 名称:以太坊RPC
- 类型:命令
- 指令:
npx -y ethereum-rpc-mpc https://eth.llamarpc.com Ethereum或 - 指令:
node /path/to/ethereum-rpc-mpc/dist/server/index.js https://eth.llamarpc.com Ethereum
分析
你还可以使用MCP Analytics中间件启用分析功能,以了解请求数量、请求时长以及所有工具和资源的错误报告。
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
Ethereum RPC MPC Server
A TypeScript MCP server that leverages the MCP SDK to support all Ethereum JSON-RPC calls, enabling AI models to interact with blockchain data.
Overview
This project provides a Model Context Protocol (MCP) server that allows AI assistants like Cursor or Claude (or any MCP Client implementation) to interact with Ethereum blockchain data through standardized JSON-RPC interfaces. It acts as a bridge between AI models and EVM blockchains, enabling seamless access to on-chain data and functionality.
Installation
# Clone the repository
git clone [email protected]:Phillip-Kemper/ethereum-rpc-mpc.git
cd ethereum-rpc-mpc
# Install dependencies
yarn install
# Build the project
yarn build
# Start Inspector with default Ethereum RPC (you can change in the inspector settings on )
yarn inspector
Usage
Using with Cursor
To use this MPC server with Cursor:
- In Cursor, go to Settings > Cursor Settings > MCP
- Add a new MCP server with the following configuration:
- Name: Ethereum RPC
- Type: Command
- Command:
npx -y ethereum-rpc-mpc https://eth.llamarpc.com Ethereumor - Command:
node /path/to/ethereum-rpc-mpc/dist/server/index.js https://eth.llamarpc.com Ethereum
Analytics
You can also enable analytics using MCP Analytics Middleware to get an overview about number of requests, duration of requests as well as error reporting for all your tools and resources. To enable it, just pass the --analytics flag and additionally a path for the Sqlite File.
- Command:
npx -y ethereum-rpc-mpc https://eth.llamarpc.com Ethereum --analytics --db-path /Users/satoshi/Desktop/analytics.db
Starting the Server
You can start the server by providing an Ethereum RPC URL and an optional chain name:
yarn start [RPC_URL] [CHAIN_NAME]
# Using npx (without installing)
npx -y ethereum-rpc-mpc [RPC_URL] [CHAIN_NAME]
If no RPC URL is provided, it will default to “https://eth.llamarpc.com”.
Example:
# Connect to Ethereum mainnet
yarn start https://eth.llamarpc.com Ethereum
# Connect to Zircuit
yarn start https://mainnet.zircuit.com Zircuit
Examples
Here are some examples of how to use the Ethereum RPC MPC server with Claude:
Getting the Current Block Number
What's the current block number?
Checking an Address Balance
What's the ETH balance of 0x742d35Cc6634C0532925a3b844Bc454e4438f44e?
Getting Contract Information
安装
npx -y ethereum-rpc-mpc [RPC_URL] [CHAIN_NAME]