Agent Tasks

io.github.keshrath由 GitHub 账号 keshrath 发布v2.1.0更新于 Oct 25, 2026

Pipeline task management for AI agents - stages, dependencies, artifacts, claiming

已验证STDIO仅桌面效率与工作流开发者工具

概览

AI 生成的概览

本地 MCP 服务器,为 AI 编码代理提供带阶段门禁、依赖、产物与认领机制的共享任务流水线。

可以做什么
  • 创建、读取、列出、搜索和删除流水线任务,包括子任务树与依赖关系
  • 更新任务元数据,如标题、描述、优先级、标签、项目、指派与依赖
  • 推动任务流转于可配置阶段(认领、指派、前进、回退、完成、失败、取消)
  • 附加产物与线程化评论:文档、决策记录、经验总结与讨论
  • 配置流水线、门禁、代理身份、清理策略与 IDE 规则文件
适用场景
适合多个 AI 代理在同一代码库上协作、需要带阶段、依赖和阶段门禁的共享看板而非扁平待办清单的场景。也适合希望把规格、计划、实现、测试、评审作为任务跟踪的单代理工作流。
运行要求
通过 npm(npx agent-tasks)或全局安装以 stdio 在本地运行,需要 Node.js 20.11 或更高版本。默认在用户主目录下创建 SQLite 数据库文件。可选环境变量可设置数据库路径、REST 端口与主机、操作者身份、保留期限,以及可选的 agent-comm 与 agent-knowledge 服务地址。未声明需要账号或 API 密钥。
安装前请注意
删除任务会级联删除其产物、评论和依赖,且无法撤销。任务还会在保留期后自动清除,停滞或无人认领的任务可能被自动标记失败或取消。首个进程会在 3422 端口提供仅限本机的 REST API;将主机设为 0.0.0.0 会将其暴露到网络。启用可选桥接后,经验与决策会推送到 agent-knowledge,通知会发送到 agent-comm。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Agent Tasks,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

agent-tasks

[License: MIT] [Node.js] [Tests] [MCP Tools] [REST Endpoints]

Pipeline-driven task management for AI coding agents. An MCP server with stage-gated pipelines, multi-agent collaboration, and a native Claude Code /pipeline pane. Tasks flow through configurable stages — backlog, spec, plan, implement, test, review, done — with dependency tracking, stage gates, artifact versioning, and threaded comments.

Built for AI coding agents (Claude Code, Codex CLI, Gemini CLI, Aider) but works equally well with any MCP client or REST consumer.

[/pipeline opens the board beside a Claude Code conversation; Tab and Enter open a task]

The user manual shows every view and action of the pane, with screenshots and short clips from the real CLI.

2.0 replaced the web dashboard with the /pipeline pane inside Claude Code; there is no browser UI, WebSocket or agent-desk plugin any more.

From 1.x

  • The dashboard on http://localhost:3422 is gone: open the board with /pipeline in Claude Code (install the plugin, below). The agent-desk Tasks tab is gone with it.
  • REST: GET /api/overview and PUT /api/tasks/:id/stage are gone (use GET /api/board and POST /api/tasks/:id/stage with {"action": "advance"}), and so are the routes nothing called; see the REST API.
  • A 1.x process still holding port 3422 is named by the pane (An older agent-tasks (1.10.13) holds the port) and in the status line (old server 1.10.13 on the port): end the Claude Code sessions still running it (or kill the old agent-tasks process) so a 2.x process takes the port, then Refresh.

Why agent-tasks?

When you run multiple AI agents on the same codebase, they need a shared task pipeline — not just a flat todo list. They need stages, dependencies, stage gates, and visibility.


Features

  • Pipeline stages — configurable per project: backlog > spec > plan > implement > test > review > done
  • Task dependencies — DAG with automatic cycle detection; blocks advancement until resolved
  • Multi-agent claiming — claim, assign, send back to an earlier stage with a reason
  • Subtask hierarchies — parent/child task trees with progress tracking
  • Threaded comments — async discussions between agents on any task
  • Artifact versioning — per-stage document attachments with automatic versioning
  • Full-text search — FTS5 search across task titles and descriptions
  • Claude Code /pipeline pane — the board beside the conversation, keyboard-first: tasks by stage, task detail with artifacts and comments, advance, send back, complete, fail, cancel, comment and delete, a status line entry
  • 2 transport layers — MCP (stdio) and a loopback REST API (HTTP) that the pane reads
  • TodoWrite bridge — intercepts Claude Code's built-in TodoWrite and syncs to the pipeline
  • Stage gates — configurable per-project gates with per-stage rules: require named artifacts, minimum artifact counts or a comment before advancing (the schema also has require_approval, but no MCP tool or REST route records an approval, so a stage with it set cannot be left; keep it off)
  • Decisions log — structured decision artifacts (chose X over Y because Z) via task_artifact(type: "decision")
  • Learnings propagation — task_artifact(type: "learning") captures insights (technique, pitfall, decision, pattern); auto-propagated to parent and sibling tasks on completion
  • Agent affinity — task_list(next: true) prefers routing tasks to agents with related history (parent, dependency, project) as a tie-breaker
  • Heartbeat-based cleanup — auto-fails tasks from dead agents using agent-comm heartbeat data
  • Task cleanup hooks — auto-fails orphaned tasks on session stop and cleans up stale tasks on session start
  • Agent bridge — notifies connected agents on task events (claim, advance, comment)
  • Knowledge bridge — auto-pushes learning and decision artifacts to agent-knowledge on task completion, with embedding indexing and auto-linking

Quick Start

Install from npm

bash
npm install -g agent-tasks

Or clone from source

bash
git clone https://github.com/keshrath/agent-tasks.gitcd agent-tasksnpm installnpm run build

Option 1: MCP server (for AI agents)

Add to your MCP client config (Claude Code, Cline, etc.):

json
{  "mcpServers": {    "agent-tasks": {      "command": "npx",      "args": ["agent-tasks"]    }  }}

The first MCP process to start also serves the REST API on http://localhost:3422; the others retry every 5 s and take over when it exits.

Option 2: Claude Code plugin (MCP server + /pipeline pane)

bash
claude plugin marketplace add keshrath/agent-tasksclaude plugin install agent-tasks@agent-tasks

The plugin runs the MCP server and adds a Claude Code mod (function hooks, Claude Code 2.1.289+): /pipeline opens the board beside the conversation. The tutorial walks through it. Remove any hand-written agent-tasks entry from ~/.claude.json so tools do not appear twice.

Option 3: Standalone REST server

bash
node dist/server.js --port 3422

Claude Code Integration

Once configured (see Quick Start above), Claude Code can use all 8 MCP tools directly — creating tasks, advancing stages, adding artifacts, commenting, and more. With the plugin installed, /pipeline opens the board in a pane beside the conversation (Claude Code 2.1.289+). See the Setup Guide for detailed integration steps.


MCP Tools (8)

CategoryTools
Task CRUD (4)task_create, task_get (include subtasks/artifacts/comments/transitive_deps), task_list (search, next), task_delete
Metadata (1)task_update (title, description, priority, tags, project, assignment, dependencies)
Lifecycle (1)task_stage (claim, assign, advance, regress, complete, fail, cancel)
Artifacts (1)task_artifact (general, decision, learning, comment)
Config & utils (1)task_config (pipeline, session, cleanup, rules)

See full API reference for detailed descriptions of every tool and endpoint.

REST API (8 endpoints)

All endpoints return JSON. Loopback only: a foreign Host gets 403, so does any request carrying an Origin header (no browser calls this API), and request bodies must be application/json. Everything else goes through the MCP tools. See full API reference for details.

GET    /health                        Health check with version + uptimeGET    /api/tasks/:id                 One task, as task_get (?include=subtasks,comments,transitive_deps)GET    /api/pipeline                  Pipeline stage configurationGET    /api/board                     Open and recently closed tasks (what the pane polls)
POST   /api/tasks                     Create a taskPOST   /api/tasks/:id/stage           Lifecycle action (claim, assign, advance, regress, complete, fail, cancel)POST   /api/tasks/:id/comments        Add a commentDELETE /api/tasks/:id                 Delete a task

Testing

bash
npm test              # vitest: 472 tests across 25 filesnpm run test:watch    # Watch modenpm run test:coverage # Coverage reportnpm run check         # Full CI: typecheck + lint + format + testnpm run plugin:check  # the /pipeline pane: claude plugin validate + its tests (needs the claude CLI)npm run e2e:claude    # the pane in the real Claude Code CLI (see CONTRIBUTING.md)

Environment variables

VariableDefaultDescription
AGENT_TASKS_DB~/.agent-tasks/agent-tasks.dbSQLite database file path
AGENT_TASKS_PORT3422REST API port (the /pipeline pane reads it)
AGENT_TASKS_HOST127.0.0.1REST bind address (0.0.0.0 exposes it to the network)
AGENT_TASKS_USERthe OS userWho the /pipeline pane acts as (created_by, comment author, by)
AGENT_TASKS_INSTRUCTIONSenabledSet to 0 to disable response-embedded instructions
AGENT_TASKS_RETENTION_DAYS30Days the cleanup keeps resolved approval records
AGENT_TASKS_COMPLETED_RETENTION_DAYS7Days a completed task is kept (and listed under the pane's Done) before purge
AGENT_TASKS_FAILED_RETENTION_DAYS7Days a failed task is kept before purge
AGENT_TASKS_CANCELLED_RETENTION_DAYS1Days a cancelled task is kept before purge
AGENT_TASKS_ORPHAN_TIMEOUT_MINUTES360Minutes before an in-progress task with no assignee is cancelled
AGENT_TASKS_COMM_TIMEOUT_MS5000Timeout of the cleanup's agent-comm requests
AGENT_TASKS_DEAD_SESSION_GRACE_MINUTES60task-cleanup-start.js: idle minutes before a dead session's task is failed
AGENT_TASKS_HEARTBEAT_FRESH_MINUTES15task-cleanup-start.js: an agent with a heartbeat this recent counts as alive
AGENT_COMM_URLhttp://localhost:3421Agent-comm REST URL for bridge notifications
AGENT_KNOWLEDGE_URLhttp://localhost:3423Agent-knowledge REST URL for knowledge bridge

Dependencies

Required: Node.js >= 20.11, better-sqlite3 (bundled)

Optional (soft dependencies — fail-open, HTTP-only, no npm dep):

  • agent-comm — Heartbeat-based task cleanup and event notifications. agent-comm tracks heartbeats → agent-tasks checks heartbeats → auto-fails tasks from dead agents. Also sends direct messages on claim/advance and posts to a channel on comments. Without agent-comm, stale agent detection and notifications are skipped gracefully.

  • agent-knowledge — Knowledge persistence for task learnings and decisions. On task completion, the KnowledgeBridge pushes learning and decision artifacts to agent-knowledge via POST /api/knowledge. Entries are auto-indexed with embeddings, auto-linked to similar entries, and git-synced. Without agent-knowledge, artifacts stay in agent-tasks only.


Documentation

  • Tutorial — the /pipeline pane step by step, recorded from the real CLI
  • User Manual — the /pipeline pane view by view (screenshots and GIFs), every tool, the pipeline, gates, cleanup
  • API Reference — all 8 MCP tools and the REST endpoints
  • Hooks — the Claude Code command hooks scripts/setup.js installs
  • Architecture — source structure, design principles, database schema
  • Setup Guide — installation, client setup (Claude Code, OpenCode, Cursor, Windsurf), hooks
  • Contributing — development, tests, the e2e run in the real CLI
  • Changelog

License

MIT — see LICENSE

来源:README.md,提交 13a69dd

工具

8

task_create

Create a pipeline task. Tasks start in "backlog" and move through stages: backlog → spec → plan → implement → test → review → done. Use parent_id to create subtasks under an existing task.

输入参数tagsstagetitle必填projectpriorityassign_toparent_iddescription

task_get

Get a single task by ID. By default returns task with artifacts, comment count, dependencies (blockers/blocking = `blocks` edges; links = `related`/`duplicate`, with direction), claim status and collaborators. Use "include" to inline full subtasks, artifacts (filterable by stage), comments (with limit), or transitive_deps (full upstream + downstream closure of the dependency graph in one call — answers questions like "what depends on this task transitively?" and "what is its critical path depth?" without forcing the caller to BFS the graph).

输入参数limitstageincludetask_id必填

task_list

List, search, or pick tasks. Without params: returns all tasks. With filters: narrow by status/stage/project/assignee. With "query": full-text search across titles and descriptions. With "next": true: returns the single highest-priority unassigned task with all dependencies met (uses affinity scoring when agent is provided).

输入参数nexttagsagentlimitquerystageoffsetstatusprojectassign_toparent_idroot_only另有 1 个

task_update

Update task metadata — title, description, priority, tags, project, assignment, or dependencies. Does not change stage or status (use task_stage for that).

输入参数tagstitleprojecttask_id必填priorityassign_todependencydescription

task_delete

Delete a task and all its artifacts, comments, and dependencies (cascading delete). Cannot be undone.

输入参数task_id必填

task_stage

Move a task through its lifecycle. Actions: "claim" → assign to you and advance from backlog to spec, "assign" → assign to you WITHOUT advancing the stage (use for custom pipelines where the first stage is itself a do-work stage), "advance" → next stage (or jump to a specific one), "regress" → earlier stage (requires reason), "complete" → marks done with result, "fail" → marks failed with error, "cancel" → cancels with reason.

输入参数stageaction必填reasonresultclaimercommenttask_id必填

task_artifact

Attach artifacts or comments to a task. Types: "general" → document (spec, test-results, review-notes), "decision" → structured decision record (chose/over/because), "learning" → insight that auto-propagates to parent and sibling tasks on completion, "comment" → discussion comment (supports threading via parent_comment_id, satisfies stage-gate require_comment checks).

输入参数nameovertype必填chosestagebecausecontenttask_id必填categoryparent_comment_id

task_config

Configuration and admin. Actions: "session" → set agent identity (call this first), "pipeline" → get/set pipeline stages and gate config for a project, "cleanup" → purge old completed tasks, "rules" → generate IDE rule files (.mdc or CLAUDE.md).

输入参数idmodenameaction必填formatstagesprojectgate_configtimeout_minutes

版本历史

4
  1. v2.1.0最新Oct 24, 2026
  2. v2.0.0Oct 23, 2026
  3. v1.10.13Oct 1, 2026
  4. v1.10.11Sep 16, 2026

评分

已满足适用检查项的 90%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分
  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分