RouteMesh MCP服务器
@routemesh/mcp 是一个本地stdio MCP服务器,用于通过RouteMesh查询区块链数据。
概览
- 从一个MCP服务器查询多个EVM链。
- 快速提取有用的链上数据(区块、交易、日志、余额、费用)。
- 当您需要内置工具之外的方法时,请使用通用JSON-RPC。
- 通过RouteMesh路由+故障转移减少RPC端点管理开销。
- 将Cursor作为按需命令插入,而不是后台守护进程。
提示示例
- “列出匹配的链
base给我看看他们的链ID。" - “获取BSC上的最新块,并汇总时间戳+tx计数。”
- “获取tx收据
0x...在以太坊上,告诉我它是否成功。" - “获取区块X和Y之间Arbitrum上此合约的日志。”
- “使用这些参数估计在Base上调用此方法的气体。”
- “跑
eth_getCode地址在链8453上0x...."
工具
rpc_list_chains-发现并过滤支持的链rpc_call-通用JSON-RPC逃逸口rpc_get_block-按数字/标签/哈希提取rpc_get_transaction-按哈希值获取交易rpc_get_transaction_receipt-通过哈希获取收据rpc_get_logs-使用块/主题过滤器查询日志rpc_get_balance-地址的本机令牌余额rpc_call_contract-只读eth_callrpc_estimate_gas-天然气估算rpc_get_fee_data-天然气价格+EIP-1559提示rpc_trace_transaction-尽最大努力跟踪/调试事务
先决条件
- Node.js 20+
- RouteMesh API密钥(注册)
快速开始
安装和构建:
npm install
npm run build为本地开发设置API密钥:
cp .env.example .env运行本地构建:
ROUTEMESH_API_KEY=your_key_here node dist/index.js在开发模式下运行:
ROUTEMESH_API_KEY=your_key_here npm run dev运行已发布的包:
ROUTEMESH_API_KEY=your_key_here npx -y @routemesh/mcp光标MCP配置
将其中一个添加到 ~/.cursor/mcp.json.
本地构建:
{
"mcpServers": {
"routemesh": {
"command": "node",
"args": ["/ABSOLUTE/PATH/TO/PROJECT/dist/index.js"],
"env": {
"ROUTEMESH_API_KEY": "replace-with-your-routemesh-key"
}
}
}
}已发布的包通过 npx:
{
"mcpServers": {
"routemesh": {
"command": "npx",
"args": ["-y", "@routemesh/mcp"],
"env": {
"ROUTEMESH_API_KEY": "replace-with-your-routemesh-key"
}
}
}
}开发命令
npm run typecheck-静态类型检查npm run test-运行一次测试npm run test:watch-监视模式npm run build-编译到dist/
发布
npm run test
npm run build
npm version patch
npm publish --access public备注
- 服务器是只读的。
- 请求使用
ROUTEMESH_BASE_URL首先,然后ROUTEMESH_BACKUP_BASE_URL关于可重试的失败。 rpc_list_chains解析来自的链数据https://routeme.sh/llms.txt.
参考文献
- RouteMesh链列表: https://routeme.sh/llms.txt
- RouteMesh文档: https://routeme.sh/docs
