使用说明
RustChain MCP服务器
RustChain的MCP(模型上下文协议)服务器,允许Claude Code和其他支持MCP的客户端直接从终端查询区块链并执行核心操作。
特性
所需工具(已实施)
- ✅
rustchain_balance-获取任何地址的RTC余额 - ✅
rustchain_miners-列出网络上的活跃矿工 - ✅
rustchain_epoch-获取当前纪元信息 - ✅
rustchain_health-检查所有节点的运行状况 - ✅
rustchain_transfer-传输RTC(需要私钥)
奖金工具(已实施)
- ✅
rustchain_ledger-查看最近的交易 - ✅
rustchain_bounties-获取公开的赏金信息
安装
先决条件
- Node.js 18+
- npm或纱线
从源代码安装
# Clone the repository
git clone https://github.com/Async777/rustchain-mcp-server.git
cd rustchain-mcp-server
# Install dependencies
npm install
# Build the project
npm run build
配置
添加到克劳德代码
# Add the MCP server to Claude Code
claude mcp add rustchain node /path/to/rustchain-mcp-server/dist/index.js
或者手动编辑您的Claude Code配置:
{
"mcpServers": {
"rustchain": {
"command": "node",
"args": ["/path/to/rustchain-mcp-server/dist/index.js"]
}
}
}
使用示例
配置后,您可以在Claude Code中使用这些工具:
# Check your balance
What is my RTC balance for address RTCc29259460d01e6aca70b16f044852dddd0369c0d?
# List miners
Show me the top 5 miners on RustChain
# Check network health
Is the RustChain network healthy?
# Get epoch info
What is the current epoch?
# View recent transactions
Show me the last 10 ledger entries
节点配置
服务器使用以下节点优先级:
- 主要的,重要的:
https://50.28.86.131 - 回退1:
https://rustchain.org - 回退2:
https://node2.rustchain.org
如果主节点不可用,服务器会自动尝试回退节点。
使用的API端点
| 工具 | 端点 |
|---|---|
| 防锈链平衡 | GET /wallet/balance?miner_id={address} |
| 铁链固定器 | GET /miners?limit={n} |
| 防锈链_产品 | GET /epoch/current |
| 防锈链_健康 | GET /health |
| 铁链转移 | POST /wallet/transfer |
| 铁链磨边机 | GET /ledger?limit={n} |
安全说明
- 私钥:The
rustchain_transfer该工具需要您的私钥。仅在安全环境中使用。 - 节点验证:服务器在执行敏感操作之前验证节点运行状况。
- 后备保护:如果所有节点都无法访问,操作将优雅地失败,并显示清晰的错误消息。
发展
# Run in development mode (auto-rebuild)
npm run dev
# Build for production
npm run build
# Start the server
npm start
赏金信息
该项目是为RustChain Bounty#1152建造的:
- 赏金:75-100 RTC
- 范围:RustChain的MCP服务器
- 仓库: https://github.com/Scottcjn/rustchain-bounties/issues/1152
许可证
麻省理工学院
作者
异步777
- 钱包:RTCc29259460d01e6aca70b16f044852ddd0369c0d