使用说明
Dysnomia生态导航器——MCP服务器
MCP(模型上下文协议)服务器,使AI助手可以直接访问PulseChain上的Dysnomia/Atropa区块链生态系统。向Claude询问合约状态、调试事务、跟踪创建者和映射整个生态系统图——所有这些都是用自然语言编写的。
工具
| 工具 | 说明 |
|---|---|
list_ecosystem |
列出所有已注册的合同及其类别和描述 |
get_contract_state |
读取链上状态——余额、供应、所有权、铸造状态 |
trace_minter |
在所有生态系统合同中追踪铸币厂地址 |
query_qing |
查询青岛地区数据——所有权、元数据 |
debug_call |
在消耗天然气之前,模拟地面恢复的合约调用 |
map_relationships |
绘制合同之间的所有权和依赖关系图 |
search_events |
按合约、事件、区块范围过滤的链事件日志查询 |
设置
# Install dependencies
npm install
# Build
npm run build
配置
1.添加合同地址
编辑 src/config.ts 并填写已部署的地址:
META: { address: "0x...", category: "core", description: "Root coordination contract" },
RING: { address: "0x...", category: "core", description: "Ring structure / orbital mechanics" },
// etc.
更改后重建: npm run build
2.自定义RPC
设置 PULSECHAIN_RPC 用于覆盖默认RPC的环境变量:
export PULSECHAIN_RPC="https://your-rpc-endpoint.com"
3.扩展ABI
中的每个工具文件 src/tools/ 有自己的ABI定义。随着合约的发展添加函数签名——模式是人类可读的ABI字符串:
const MY_ABI = [
"function MyNewFunction(uint256) view returns (address)",
];
连接到克劳德桌面
将此添加到您的Claude Desktop配置中(~/Library/Application Support/Claude/claude_desktop_config.json 在Mac上):
{
"mcpServers": {
"dysnomia": {
"command": "node",
"args": ["/absolute/path/to/dysnomia-navigator/build/index.js"],
"env": {
"PULSECHAIN_RPC": "https://rpc.pulsechain.com"
}
}
}
}
连接到克劳德代码
claude mcp add dysnomia node /absolute/path/to/dysnomia-navigator/build/index.js
使用MCP检查员进行测试
npm run inspector
建筑
src/
├── index.ts # Entry point — creates server, registers tools
├── config.ts # RPC config, contract registry, ABIs, helpers
└── tools/
├── listEcosystem.ts # list_ecosystem
├── getContractState.ts # get_contract_state
├── traceMinter.ts # trace_minter
├── queryQing.ts # query_qing
├── debugCall.ts # debug_call
├── mapRelationships.ts # map_relationships
└── searchEvents.ts # search_events
延伸
要添加新工具,请执行以下操作:
- 创建
src/tools/myNewTool.ts - 出口A
registerMyNewTool(server: McpServer)功能 - 导入并调用它
src/index.ts - 重建:
npm run build
服务器使用stdio传输,因此可以与任何兼容MCP的客户端配合使用。
阶段(供参考)
- 地:形成造币厂数据——根据QING构建造币厂代币数据的物理行为
- 公司:个人GWAT建立领土
- 生命:物联网硬件+YUE扩展创建真实世界的活动沙盒