MCP 以太坊地址信息服务器
提供基于多链的以太坊地址信息服务,支持实时更新。
快速入门
-
克隆仓库并安装依赖:
git clone <repository-url> cd mpc-0x-address npm install
-
创建
.env
文件并设置端口:MCP_PORT=3002
-
启动服务器:
npm run start:http
-
测试 SSE 功能:
- 连接到 SSE 端点:
curl -N http://localhost:3002/sse
- 获取客户端 ID 并订阅地址更新:
curl -X POST http://localhost:3002/sse/subscribe/<client-id> \ -H "Content-Type: application/json" \ -d '{"addresses": ["<address>"]}'
- 触发地址更新:
curl -X POST http://localhost:3002/mcp \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": {"name": "get-address-info", "arguments": {"address": "<address>"}}}'
- 连接到 SSE 端点: