内容
# agent-graph-mcp
**图灵架构的MCP服务器,用于编排LLM工作流程** — 25种类型工具、守护进程/代理架构、检查点/恢复、人工干预审批和HMAC认证执行回执。
[](https://crates.io/crates/agent-graph-mcp)
[](https://docs.rs/agent-graph-mcp)
[](https://lobehub.com/mcp/recursiveintell-agent-graph-mcp)
[](https://www.npmjs.com/package/@recursiveintell/agent-graph-mcp)
[](LICENSE-MIT)

> **通过MCP公开`ri-agent-graph`运行时引擎。** 编译声明式JSON工作流程规范,同步或异步执行,检查点/恢复,请求人工审批,捕获源证人,并获取加密回执 — 所有这些都通过25种类型MCP工具。
## 快速开始
### npx(推荐)
```bash
npx -y @recursiveintell/agent-graph-mcp --direct --base-url http://127.0.0.1:11434 --model glm-5.2:cloud
```
### Cargo安装
```bash
cargo install agent-graph-mcp --locked
agent-graph-mcp --direct --base-url http://127.0.0.1:11434 --model glm-5.2:cloud
```
### 守护进程模式(生产环境)
```bash
agent-graph-mcpd --data-dir ~/.local/share/agent-graph --socket /tmp/agent-graph.sock &
agent-graph-mcp --socket /tmp/agent-graph.sock
```
## 客户端配置
**Hermes Agent:**
```yaml
mcp_servers:
agent_graph:
command: agent-graph-mcp
args: [--socket, /tmp/agent-graph.sock]
```
**Claude Desktop:**
```json
{"mcpServers": {"agent-graph": {"command": "npx", "args": ["-y", "@recursiveintell/agent-graph-mcp", "--direct", "--base-url", "http://127.0.0.1:11434", "--model", "glm-5.2:cloud"]}}}
```
## 架构
```
MCP Client ──→ agent-graph-mcp (代理) ──Unix socket──→ agent-graph-mcpd (守护进程) ──→ SQLite
标准输入/输出 有帧 Tokio异步I/O
```
## 工具(25)
**图生命周期(4):** `graph_create`、`graph_list`、`graph_inspect`、`graph_render`
**执行(5):** `graph_execute`、`graph_run_start`、`graph_run_wait`、`graph_run_cancel`、`graph_run_get`
**状态和检查点(4):** `graph_run_state`、`graph_run_events`、`graph_run_checkpoint`、`graph_run_resume`
**人工干预审批(3):** `graph_approval_list`、`graph_approval_get`、`graph_approval_request`
**证据(2):** `graph_source_witness_capture`、`graph_source_witness_get`
**模板(4):** `graph_template_list`、`graph_template_instantiate`、`graph_template_candidates`、`graph_template_outcomes`
**回执和状态(3):** `graph_policy_check`、`graph_run_receipt`、`graph_status`
## 内置模板
| 模板 | 描述 |
|----------|-------------|
| `council_deliberation` | 3名分析师并行委员会 |
| `parallel_council` | 2人辩论 |
| `plan_critique_refine` | 计划 → 批评 → 改进 |
| `analysis_pipeline` | 计划者 → 研究人员 → 提取者 → 综合者 → 验证者 |
| `classifier_router` | LLM分类器 → 错误/功能/问题处理程序 |
## 生态系统
| 仓库 | 角色 |
|-------|------|
| [agent-graph-mcp](https://crates.io/crates/agent-graph-mcp) | MCP服务器(此仓库) |
| [ri-agent-graph](https://crates.io/crates/ri-agent-graph) | 核心图引擎 |
| [llm-pipeline](https://crates.io/crates/llm-pipeline) | LLM节点有效载荷 |
| [stack-ids](https://crates.io/crates/stack-ids) | 跟踪原语 |
## 验证
```bash
# 烟雾测试 — 25种工具
echo '{"jsonrpc":"2.0","id":2,"method":"tools/list","params":{}}' | \
npx -y @recursiveintell/agent-graph-mcp --direct --base-url http://127.0.0.1:11434 --model glm-5.2:cloud 2>/dev/null | \
python3 -c "import sys,json; msg=json.loads(sys.stdin.read()); print(f'{len(msg[\"result\"][\"tools\"])} tools')"
# 构建和测试
cargo build --release
cargo test --lib --test daemon_recovery --test mcp_integration
```
## 许可证
MIT © [递归智能](https://github.com/RecursiveIntell)