AO模型上下文协议服务器

AO MCP Server是一个支持AO/Arweave的模型上下文协议服务器,允许Claude Desktop、Cursor和其他MCP客户端与AO进程进行交互。

  • by credentum
  • TypeScript
  • 本地部署
  • 更新于
在 GitHub 查看 credentum/ao-mcp-server

使用说明

AO MCP服务器

AO/Arweave的MCP(模型上下文协议)服务器,允许Claude Desktop、Cursor和其他MCP客户端与AO进程交互。

特性

  • ao_query_process -查询进程状态(只读,无需钱包)
  • ao_send_message -向进程发送消息(需要钱包)
  • ao_spawn_process -创建新的AO流程(需要钱包)
  • ao_eval_lua -在进程中执行Lua代码(需要钱包)
  • ao_list_结果 -查看进程消息历史记录

安装

npm install -g ao-mcp-server

或者直接使用npx运行:

npx ao-mcp-server

配置

克劳德桌面

添加到您的 ~/.config/claude/claude_desktop_config.json (Linux/Mac)或 %APPDATA%\Claude\claude_desktop_config.json (Windows):

{
  "mcpServers": {
    "ao": {
      "command": "npx",
      "args": ["ao-mcp-server"]
    }
  }
}

光标

添加到光标MCP设置中:

{
  "mcpServers": {
    "ao": {
      "command": "npx",
      "args": ["ao-mcp-server"]
    }
  }
}

使用示例

查询进程(不需要钱包)

查询任何AO进程状态:

Use ao_query_process with:
- process_id: <43-character-arweave-tx-id>
- action: Info

发送消息(需要钱包)

Use ao_send_message with:
- process_id: <your-process-id>
- action: Transfer
- data: {"Recipient": "...", "Quantity": "100"}
- wallet_json: <your-wallet-json>

生成一个进程(需要钱包)

Use ao_spawn_process with:
- name: MyProcess
- wallet_json: <your-wallet-json>

执行Lua代码(需要钱包)

Use ao_eval_lua with:
- process_id: <your-process-id>
- code: return State
- wallet_json: <your-wallet-json>

钱包配置

对于需要签名的操作(send、spawn、eval),您需要提供JSON格式的Arweave JWK钱包。你可以:

  1. 直接通过 -将钱包JSON包含在 wallet_json 参数
  2. 使用文件 -从钱包文件中读取并传递内容

钱包结构示例:

{
  "kty": "RSA",
  "n": "...",
  "e": "AQAB",
  "d": "...",
  ...
}

AO网络默认值

  • 模块: Do_Uc2Sju_ffp6Ev0AnLVdPtot15rvMjP-a9VVaA5fM (aos Lua 5.3)
  • 调度器: _GQ33BkPtZrqxA84vM8Zk-N2aO0toNNu_C-l-rawrBA (AO主网)

发展

# Clone the repository
git clone https://github.com/credentum/ao-mcp-server
cd ao-mcp-server

# Install dependencies
npm install

# Build
npm run build

# Run locally
npm start

建筑

ao-mcp-server/
├── src/
│   ├── index.ts           # Entry point
│   ├── server.ts          # MCP server class
│   ├── config.ts          # AO constants
│   └── tools/
│       ├── index.ts       # Tool registry
│       ├── query-process.ts
│       ├── send-message.ts
│       ├── spawn-process.ts
│       ├── eval-lua.ts
│       └── list-results.ts
├── package.json
├── tsconfig.json
└── README.md

相关项目

许可证

麻省理工学院