EVM多链服务服务器
支持30+条EVM兼容网络的区块链服务服务器,提供统一接口供AI代理交互。
快速入门
安装依赖
使用以下命令克隆并安装依赖:
git clone https://github.com/chulanpro5/evm-mcp-server.git
cd evm-mcp-server
bun install # 或使用 npm install
启动服务
使用 stdio 模式运行
bun start # 正常模式
bun dev # 开发模式(自动重载)
使用 HTTP 模式运行
bun start:http # 正常模式
bun dev:http # 开发模式(自动重载)
配置
默认配置如下:
- 默认链ID:1(以太坊主网)
- 服务器端口:3001
- 服务器主机:0.0.0.0
修改配置请编辑以下文件:
src/core/chains.ts
(链配置)src/server/http-server.ts
(服务器配置)
测试连接
使用 MCP Inspector 测试和调试服务器。
示例
查询ERC20代币余额:
const mcp = new McpClient("http://localhost:3000");
const result = await mcp.invokeTool("get-token-balance", {
tokenAddress: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
ownerAddress: "vitalik.eth",
network: "ethereum"
});
console.log(result);