Token导航 LogoToken导航TokenDH.com
Task Graph MCP logo
AI代理未说明官方级别未说明来源级核验

Task Graph MCP

MCP Server

Task Graph是一个用于AI代理的结构化工作流管理工具,支持多代理协调、质量门控和任务跟踪。

工具数

41

提示词数

0

GitHub Stars

0

资源数

0
RustClaude任务跟踪Claude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

Oortonaut

提供方

Oortonaut

最后核验

2026/5/17 20:22

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

详细介绍

任务图MCP服务器

实际工作的代理任务工作流。

当你让人工智能代理处理复杂的任务时,事情很快就会出错。代理失去上下文,跳过步骤,忘记协调。任务图通过结构化的工作流解决了这个问题:指导工作的阶段、自动指导的提示、强制质量的门以及多代理场景的协调原语——所有这些都通过模型上下文协议实现。

为什么是任务图?

问题:你有复杂的任务需要结构化执行。可能是单个代理分阶段工作,也可能是多个代理并行协调。如果没有适当的工作流程,代理会失去跟踪、跳过步骤并产生不一致的结果。

你得到了什么:

  • 结构化工作流 --阶段(探索、实施、审查、测试)指导代理完成工作。过渡提示在每个步骤提供自动指导。
  • 质量门 --要求在转换之前通过测试、提交代码或完成审查。自动执行您的标准。
  • 即用型拓扑 --为单人工作、平行集群、专业中继或分层委托预先构建的工作流程。立即开始,稍后自定义。
  • 可配置的工作流 --定义自己的状态、阶段、提示和门。匹配你的流程,而不是我们的。
  • 多智能体协调 --咨询文件锁、DAG依赖关系、原子声明。不再有冲突或重复工作。
  • 代币高效 --专为LLM上下文限制而设计。紧凑的查询、最少的往返、结构化的输出。
  • 内置会计 --跟踪每个任务的令牌、成本和时间。确切地知道你的代理人在花什么。
  • 零基础设施 --带WAL模式的SQLite。没有要运行的数据库服务器。只需指向一个文件。

特性

特性描述
任务层次结构与父母/子女关系无限嵌套
DAG依赖关系带循环检测的键入边(块、跟随、包含)
阶段对工作类型进行分类(探索、实施、审查、测试、部署)
工作流命名工作流拓扑(单独、集群、中继、分层)
过渡提示状态/相位变化的自动代理指导
大门状态/阶段转换的退出要求
原子能索赔严格锁定限制和基于标签的路由
文件协调带有原因的咨询锁和更改轮询
成本跟踪令牌使用量和每项任务的美元成本
时间追踪状态转换的自动累积
实时状态其他代理可见的实时“当前想法”
全文搜索基于FTS5的跨任务和附件搜索
附件内联内容、文件引用或媒体存储
代理商反馈具有分类反馈的代理间通信(取决于配置)
动态覆盖通过添加/删除覆盖工具自定义运行时工作流

快速开始

# Install
cargo install task-graph-mcp

# Add to your MCP client (Claude Code, etc.)
{
  "mcpServers": {
    "task-graph": {
      "command": "task-graph-mcp"
    }
  }
}
# Agent workflow (worker_id auto-generated if omitted)
connect(workflow="swarm", tags=["code"])                 → "bright-lunar-swift-fox"
list_tasks(ready=true, agent="bright-lunar-swift-fox")   → claimable work
claim(worker_id="bright-lunar-swift-fox", task="add-auth")  → you own it
update(..., phase="implement")                           → enter implementation phase
thinking(agent="bright-lunar-swift-fox", thought="Adding JWT...")  → visible to others
update(worker_id="bright-lunar-swift-fox", task="add-auth",
       status="completed",
       attachments=[{type:"commit", content:"abc123"}])  → done

安装

来自crates.io(推荐)

cargo install task-graph-mcp

预构建二进制文件

从以下网址下载适用于您平台的最新版本 :

平台下载
Linux(x64)task-graph-mcp-x86_64-unknown-linux-gnu.tar.gz
macOS(英特尔)task-graph-mcp-x86_64-apple-darwin.tar.gz
macOS(苹果硅)task-graph-mcp-aarch64-apple-darwin.tar.gz
Windows(x64)task-graph-mcp-x86_64-pc-windows-msvc.zip

提取二进制文件并将其放置在PATH中。

源自源头

git clone https://github.com/Oortonaut/task-graph-mcp.git
cd task-graph-mcp
cargo build --release

二进制文件将位于 target/release/task-graph-mcp.

用法

作为MCP服务器

添加到MCP客户端配置中:

{
  "mcpServers": {
    "task-graph": {
      "command": "task-graph-mcp",
      "args": []
    }
  }
}

CLI选项

task-graph-mcp [OPTIONS]

Options:
  -c, --config      Path to configuration file
  -d, --database    Path to database file (overrides config)
  -v, --verbose           Enable verbose logging
  -h, --help              Print help
  -V, --version           Print version

配置

全参考:参见 docs/CONFIGURATION.md 获取完整的配置文档,包括工作流、提示、门、角色和标签。

创建 .task-graph/config.yaml:

server:
  db_path: .task-graph/tasks.db
  media_dir: .task-graph/media  # Directory for file attachments
  skills_dir: .task-graph/skills  # Custom skill overrides
  stale_timeout_seconds: 900
  default_format: json  # or markdown

paths:
  style: relative  # or project_prefixed

auto_advance:
  enabled: false        # Auto-transition unblocked tasks
  target_state: ready   # Target state (requires custom state in states config)

状态配置

任务状态是可配置的。默认状态: pending, working, completed, failed, cancelled.

要添加 ready 自动前进状态:

states:
  initial: pending
  disconnect_state: pending  # State for tasks when owner disconnects (must be untimed)
  blocking_states: [pending, working]
  definitions:
    pending:
      exits: [ready, working, cancelled]
    ready:
      exits: [working, cancelled]
    working:
      exits: [completed, failed, pending]
      timed: true    # Time in this state counts toward time_actual_ms
    completed:
      exits: []
    failed:
      exits: [pending]
    cancelled:
      exits: []

auto_advance:
  enabled: true
  target_state: ready

SCHEMA.md 关于州定义的完整文档。

依赖关系配置

依赖类型定义了任务之间的相互关系。默认类型: blocks, follows, contains, duplicate, see-also, relates-to.

dependencies:
  definitions:
    blocks:
      display: horizontal  # Same-level relationship
      blocks: start        # Blocks claiming the dependent task
    follows:
      display: horizontal
      blocks: start
    contains:
      display: vertical    # Parent-child relationship
      blocks: completion   # Blocks completing the parent
    duplicate:
      display: horizontal
      blocks: none         # Informational only
    see-also:
      display: horizontal
      blocks: none
    relates-to:
      display: horizontal
      blocks: none
属性描述
displayhorizontal, vertical视觉关系(同级vs亲子)
blocksnone, start, completion依赖性阻碍了什么

附件配置

预配置的附件密钥提供默认的MIME类型和模式,减少了附加常见内容类型时的样板。

attachments:
  unknown_key: warn  # allow | warn (default) | reject
  definitions:
    commit:
      mime: text/git.hash
      mode: append
    checkin:
      mime: text/p4.changelist
      mode: append
    meta:
      mime: application/json
      mode: replace
    note:
      mime: text/plain
      mode: append
属性描述
unknown_keyallow, warn, reject未定义附件键的行为
definitions..mimeMIME类型字符串此密钥的默认MIME类型
definitions..modeappend, replace默认模式(追加保持现有,替换覆盖)

内置默认值:

关键字MIME类型模式用例
committext/git.hashappendgit提交哈希
checkintext/p4.changelistappend执行更改列表
changelisttext/plainappend文件已更改
metaapplication/json替换结构化元数据
notetext/plainappend一般注释
logtext/plainappend日志输出
errortext/plainappend错误消息
outputtext/plainappend命令/工具输出
difftext/x-diffappend补丁和差异
plantext/markdown替换计划和规格
resultapplication/json替换结构化结果
contexttext/plain替换当前上下文/状态

用法:

# MIME and mode auto-filled from config:
attach(task="123", name="commit", content="abc1234")
# → mime=text/git.hash, mode=append

attach(task="123", name="meta", content='{"v":1}')
# → mime=application/json, mode=replace (overwrites existing meta)

# Explicit values override defaults:
attach(task="123", name="commit", mime="text/plain", content="override")

环境变量:

  • TASK_GRAPH_CONFIG_PATH:配置文件的路径(优先于 .task-graph/config.yaml)
  • TASK_GRAPH_DB_PATH:数据库文件路径(如果没有配置文件,则回退)
  • TASK_GRAPH_MEDIA_DIR:文件附件的媒体目录(如果没有配置文件,则回退)
  • TASK_GRAPH_LOG_DIR:日志目录路径(如果没有配置文件,则回退)

MCP工具

工人管理

工具说明
connect(worker_id?, tags?, workflow?, force?, db_path?, media_dir?, log_dir?, config_path?, overlays?: str[])注册一名工人。可选的 workflow 选择命名工作流(单独、群集、中继、分层)。退货 worker_id 并且活跃 paths.
disconnect(worker_id: worker_str, final_status?: status_str = "pending")注销worker并释放所有声明/锁。
list_agents(tags?: str[], file?: filename, task?: task_str, depth?: int, stale_timeout?: int)使用筛选器列出已连接的工作者。
cleanup_stale(timeout?: int, final_status?: status_str)开除不称职的员工,并释放他们的索赔。
add_overlay(worker_id: str, overlay: str)为已连接的工作者添加动态工作流覆盖。
remove_overlay(worker_id: str, overlay: str)从连接的worker中删除工作流覆盖。

任务CRUD

工具说明
create(description: str, id?: task_str, parent?: task_str, priority?: int = 5, points?: int, time_estimate_ms?: int, tags?: str[])创建任务。优先级0-10(较高=更重要)。
create_tree(tree, parent?, child_type?, sibling_type?)创建嵌套任务树。 child_type (默认值:“包含”)为父级→儿童deps, sibling_type 对于兄弟姐妹deps。
get(task: task_str)使用附件元数据和计数按ID获取任务。
list_tasks(status?: status_str[], ready?: bool, blocked?: bool, claimed?: bool, owner?: worker_str, parent?: task_str, recursive?: bool, agent?: worker_str, tags_any?: str[], tags_all?: str[], sort_by?: str, sort_order?: str, limit?: int, offset?: int)使用筛选器查询任务。使用 ready=true 对于可索赔的任务。
update(worker_id: worker_str, task: task_str, status?: status_str, phase?: str, assignee?: worker_str, title?: str, description?: str, priority?: int, points?: int, tags?: str[], needed_tags?: str[], wanted_tags?: str[], time_estimate_ms?: int, reason?: str, force?: bool, attachments?: object[])更新任务。状态/阶段更改自动管理所有权并触发提示。包含 attachments 记录提交/更改列表。
delete(worker_id: worker_str, task: task_str, cascade?: bool, reason?: str, obliterate?: bool, force?: bool)删除任务。默认软删除; obliterate=true 永久。
scan(task: task_str, before?: int, after?: int, above?: int, below?: int)从多个方向扫描任务图。深度:0=无,N=水平,-1=全部。
search(query: str, limit?: int = 20, include_attachments?: bool, status_filter?: status_str)FTS5搜索。支持短语、前缀\*、AND/OR/NOT、标题:单词。
rename(worker_id: worker_str, task: task_str, new_id: task_str)在所有引用表中原子重命名任务ID。

任务索赔

工具说明
claim(worker_id: worker_str, task: task_str, force?: bool)申请一项任务。如果deps不满意、达到极限或缺少标签,则失败。使用 force 偷窃。

备注:通过发布 update(status="pending").通过完成 update(status="completed")。状态更改自动管理所有权。

依赖项

工具说明
`link(from: task_str\task_str[], to: task_str\task_str[], type?: dep_str = "blocks")`创建依赖关系。类型:块、跟随、包含、重复,另请参见,相关
`unlink(from: task_str\"*", to: task_str\"*", type?: dep_str)`删除依赖项。使用 * 作为通配符。
relink(prev_from: task_str[], prev_to: task_str[], from: task_str[], to: task_str[], type?: dep_str = "contains")原子移动依赖关系(先取消链接,然后再链接)。

追踪

工具说明
thinking(worker_id: worker_str, thought: str, tasks?: task_str[])直播状态。对其他工人可见。恢复心跳。
task_history(task: task_str, states?: status_str[])通过时间跟踪获取状态转换历史记录。
project_history(from?: datetime_str, to?: datetime_str, states?: status_str[], limit?: int = 100)带有日期范围过滤器的项目范围历史记录。
log_metrics(worker_id: worker_str, task: task_str, cost_usd?: float, values?: int[8])记录指标(汇总)。
`get_metrics(task: task_str\task_str[])`获取任务的指标。
give_feedback(message: str, category?: str, sentiment?: str, agent_id?: str, tool_name?: str, task_id?: str)记录有关工具、工作流程或用户体验的反馈。默认启用;拒绝超过大小限制的写入(默认值:1MB)。
list_feedback()阅读反馈标记文件。

文件协调

工具说明
`mark_file(worker_id: worker_str, file: filename\filename[], task?: task_str, reason?: str)`标记文件以表示意图。咨询,非阻塞。
`unmark_file(worker_id: worker_str, file?: filename\filename[]\"*", task?: task_str, reason?: str)`去除标记。使用 * 为了所有人。
list_marks(files?: filename[], worker_id?: worker_str, task?: task_str)获取当前文件标记。
mark_updates(worker_id: worker_str)轮询自上次通话以来的标记更改。

附件

工具说明
`attach(task: task_str\task_str[], name: str, content?: str, mime?: mime_str, file?: filename, store_as_file?: bool, mode?: str)`添加附件。使用 file 作为参考, store_as_file 用于媒体存储。
attachments(task: task_str, name?: str, mime?: mime_str)获取附件元数据。名称支持Glob模式。
detach(worker_id: worker_str, task: task_str, name: str, delete_file?: bool)按名称删除附件。

高级

工具说明
check_gates(task: task_str)在状态/相位转换之前检查闸门要求。返回未满足的门,状态为通过/警告/失败。
get_advisory(topic?: str, task?: task_str, worker_id?: worker_str)获取治理咨询指导。无主题:列出所有主题。使用topic:通过模板扩展返回完整的咨询内容。
query(sql: str, params?: str[], limit?: int = 100, format?: str)执行只读SQL。仅选择。需要许可。
get_schema(table?: str, include_sql?: bool)获取数据库架构。返回表名、列、类型和外键。
get_prompts(status?: str, phase?: str, task?: task_str, worker_id?: worker_str)获取工作流提示。没有参数:列表触发器。使用状态/阶段:返回该转换的扩展提示。
list_workflows()列出可用的工作流配置(单独、群集、中继、分层等)。
list_skills()列出可用的捆绑技能及其描述。
get_skill(name: str)获取捆绑技能的全部内容。

MCP资源

URI描述
query://tasks/all带有依赖关系的完整任务图
query://tasks/ready准备索赔的任务
query://tasks/blocked被依赖项阻止的任务
query://tasks/claimed所有声称的任务
query://tasks/agent/{id}代理拥有的任务
query://tasks/tree/{id}所有子代的任务
query://files/marks所有文件标记
query://agents/all注册代理人
query://stats/summary汇总统计数据
config://current一次响应中的所有配置
config://states任务状态定义
config://phases阶段定义
config://dependencies依赖类型定义
config://tags标签定义
docs://index列出所有可用的文档文件
docs://search/{query}文档全文搜索
docs://skills/list列出可用技能
docs://skills/{name}获取特定技能内容
docs://workflows/list列出可用工作流
docs://workflows/{name}获取工作流详细信息
docs://overlays/list列出可用覆盖层
docs://overlays/{name}获取叠加细节
docs://{path}具体文档文件内容

任务树结构

使用创建分层任务 create_tree:

{
  "tree": {
    "title": "Implement auth",
    "children": [
      { "title": "Design schema" },
      { "title": "Write migrations" },
      { "title": "Implement endpoints", "children": [
        { "title": "Login endpoint" },
        { "title": "Logout endpoint" },
        { "title": "Refresh endpoint" }
      ]},
      { "title": "Write tests" }
    ]
  },
  "sibling_type": "follows"
}

树节点字段

字段描述
title任务标题(新任务需要)
description任务描述
id自定义任务ID(如果省略,则生成UUID 7)
ref按ID引用现有任务(设置时忽略其他字段)
priority优先级0-10(默认值5)
points故事点/复杂性估计
time_estimate_ms估计持续时间(毫秒)
tags任务的分类标签
needed_tags代理人必须拥有所有这些标签才能索赔(AND)
wanted_tags代理人必须至少拥有其中一个标签才能索赔(或)
children嵌套子节点

顶层参数

参数默认值说明
tree必需任务树的根节点
parentnull将树根附加到现有父任务
child_type“包含”从父级到子级的依赖关系类型
sibling_typenull兄弟姐妹之间的依赖类型(“follows”表示顺序,null表示并行)

引用现有任务

使用 ref 将现有任务整合到树结构中:

{
  "tree": {
    "title": "Sprint 5",
    "children": [
      { "title": "New feature" },
      { "ref": "existing-task-id" },
      { "title": "Another task" }
    ]
  },
  "sibling_type": "follows"
}

基于标签的亲和力

连接时,工人通过标签声明能力。任务可能需要特定的标签来控制哪些工人可以领取它们。

标签类别示例:

  • 模型功能: image-in, audio-out, video-in, code, bulk
  • 访问级别: prod-access, admin, external
  • 专业: rust, python, frontend, database

*注意:协调员/审阅者/部署者等角色最好使用阶段来表示。*

任务要求:

  • needed_tags (AND):代理人必须拥有所有这些
  • wanted_tags (或):代理人必须至少有一个
{
  "title": "Analyze screenshot and generate code",
  "needed_tags": ["image-in", "code"],
  "wanted_tags": ["bulk"]
}
{
  "title": "Deploy to production",
  "phase": "deploy",
  "needed_tags": ["prod-access"],
  "wanted_tags": ["aws", "gcp"]
}

工作流程和阶段

阶段

任务可以有 phase 对正在执行的工作类型进行分类:

{
  "title": "Add authentication",
  "phase": "implement"
}

内置阶段: explore, implement, review, test, security, deploy, triage, diagnose, design, plan, doc, integrate, monitor, optimize

阶段实现:

  • 过渡提示 --进入/退出阶段时的自动引导
  • 大门 --相变前必须满足的要求
  • 基于角色的路由 --在中继工作流程中,专家拥有特定的阶段

命名工作流

预构建的工作流拓扑针对不同的协调模式进行了优化:

工作流描述最适合
solo单代理,完全自主简单任务,原型制作
swarm并行多面手,基于拉取高吞吐量,独立任务
relay连续专家、交接复杂任务、领域专业知识
hierarchical领导/工人代表团大型项目,团队协调
push基于推送的任务分布拓扑集中分配、负载平衡
kanban具有WIP限制的板式任务管理连续流程,视觉跟踪
sprint时间框迭代计划Scrum团队,固定节奏

在连接时选择工作流:

connect(worker_id="agent-1", workflow="swarm")

每个工作流程都提供量身定制的提示和协调指导。看 工作流程_拓扑.md 查看详细图案。

过渡提示

当状态或阶段发生变化时,代理会收到自动指导:

# workflows.yaml
states:
  working:
    prompts:
      enter: |
        You are now working on this task.
        From {{current_status}} you can transition to: {{valid_exits}}
      exit: |
        Before leaving:
        - [ ] Attach results
        - [ ] Log costs

提示支持模板变量: {{current_status}}, {{valid_exits}}, {{current_phase}}, {{valid_phases}}

大门

闸门是状态或阶段转换前必须满足的要求:

gates:
  status:working:
    - type: gate/tests
      enforcement: warn
      description: "Tests must pass"

通过附上证据来满足大门:

attach(task="123", type="gate/tests", content="All tests passing")

执行级别: allow (咨询), warn (除非 force=true), reject (硬块)

文件协调

代理可以使用带有更改跟踪的咨询标记来协调文件编辑:

Worker A: connect() -> "worker-a"
Worker A: mark_file("worker-a", "src/main.rs", "refactoring")
Worker B: connect() -> "worker-b"
Worker B: mark_updates("worker-b") -> sees worker-a's mark
Worker A: unmark_file("worker-a", "src/main.rs", "ready for review")
Worker B: mark_updates("worker-b") -> sees removal with reason
Worker B: mark_file("worker-b", "src/main.rs", "adding tests")

建筑

┌─────────────┐     ┌─────────────┐     ┌─────────────┐
│  Agent A    │     │  Agent B    │     │  Agent C    │
│  (Claude)   │     │  (GPT-4)    │     │  (Worker)   │
└──────┬──────┘     └──────┬──────┘     └──────┬──────┘
       │ stdio             │ stdio             │ stdio
       ▼                   ▼                   ▼
┌─────────────┐     ┌─────────────┐     ┌─────────────┐
│ task-graph  │     │ task-graph  │     │ task-graph  │
│    MCP      │     │    MCP      │     │    MCP      │
└──────┬──────┘     └──────┬──────┘     └──────┬──────┘
       │                   │                   │
       └───────────────────┼───────────────────┘
                           ▼
                  ┌─────────────────┐
                  │   SQLite + WAL  │
                  │  .task-graph/   │
                  │    tasks.db     │
                  └─────────────────┘
  • 运输:Stdio--每个工作进程都生成自己的服务器进程
  • 数据库:SQLite具有WAL模式,可跨进程并发访问
  • 部署:单个二进制文件,无外部依赖,脱机工作

与替代方案相比

任务图线性任务列表自定义数据库
工作流阶段✓ 内置提示✗ 手动跟踪DIY
质量门✓ 可配置的执行DIY
多代理安全✓ 原子声明、文件锁✗ 比赛条件也许,DIY
依赖跟踪✓ 带循环检测的DAG✗ 手动订购DIY
MCP本地✓ 头等舱✗ 需要包装✗ 需要包装
代币会计✓ 内置DIY
需要安装数据库服务器

文档

文档描述
配置.md完整的配置参考(config.yaml、工作流、提示、门、标签)
SCHEMA.md数据库模式和状态机文档
设计.md架构和设计决策
工作流程_拓扑.md多代理工作流模式(单独、集群、中继、分层)
出口_进口.md数据导出和导入功能
进程.md发布流程、变更日志维护
GATES.md工作流入口条件和执行
METRIC.md实验指标定义和SQL示例

许可证

Apache 2.0

______________________________________________________________________

专为需要结构化工作流程和可靠协调的AI代理而构建。

目录标签

目录标签

RustClaude任务跟踪任务管理本地部署工作流引擎多代理协调质量门控

支持客户端

Claude

接入字段

传输方式(transport,传输协议)

未说明

鉴权方式(authType,认证方式)

session

工具数量(toolCount,工具数)

41

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

未说明session部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

仍需确认:installCommand

来源信息

继续浏览同类 MCP