Skip to main content
Glama

🐮 Moo Tasks

CI License: MIT Node: >=18.0.0 MCP Ready

智能体任务编排与管理引擎,专为 AI 编码智能体(Claude CodeCursorWindsurfAntigravityCopilot)以及人机协作结对编程而构建。

快速开始智能体配置智能体协议架构MCP 工具


🌟 为什么选择 Moo Tasks?

标准 AI 编码智能体常常存在以下问题:

  1. 范围漂移:偏离原始用户意图,陷入无休止的低价值重构。

  2. 过度规划:生成 40 个浅层任务却不执行其中任何一个。

  3. 循环/空转:反复尝试相同的失败修复而不停止。

  4. 不可验证的工作:声称代码已完成却不运行测试或提供证据。

  5. 反复争论决策:每次上下文重置时都重新争论已定案的架构选择。

Moo Tasks 通过提供本地 SQLite 引擎(WAL 模式)、丰富的实时 Web UI 以及一个在运行时强制执行严格企业级不变量的模型上下文协议(MCP)服务器来解决这些问题。


Related MCP server: agentloop

✨ 核心能力与功能矩阵

🎯 1. 目标与范围控制

  • 逐字保留人类提示词:位于任务之上,保留用户的原始请求原文。

  • 目标覆盖率与遗留事项:实时统计任务完成百分比和未关闭的遗留任务。

  • 范围漂移检测:自动识别并标记未关联任何目标的孤立任务。

  • 目标开放上限:每个目标的最大开放任务数硬性上限(默认:10),防止智能体过度规划。

  • 级联操作:原子化地删除、终止或重新打开目标下的所有任务,且必须提供原因。

📋 2. 任务生命周期与 DAG 依赖

  • 子任务嵌套约束:父任务下仅允许恰好 1 层子任务。

  • 有限状态机tododoingblocked-on-dependencywaiting-on-humandonedropped

  • DAG 依赖图:自动检测循环依赖,并自动解除下游任务的阻塞。

  • 父任务关闭保护:当任何子任务仍处于开放状态时,禁止关闭父任务。

  • 状态撤销与历史:利用完整的转换审计历史回滚意外的状态变更。

🛡️ 3. 完成、验证与工作证明

  • 验收标准:在开始工作之前必须以 Markdown 编写强制性的验收标准。

  • 证据要求:关闭任务需要可验证的证明(运行的命令、标准输出、测试证明)。

  • 两阶段验证:区分 agent_completed(智能体完成)与人工 verified_done(已验证完成)。

  • 带原因的拒绝:人工或同级智能体可以附上反馈拒绝已完成的工作;任务将回退到 todo 并递增重新打开计数器。

🙋 4. 人工协作与阻塞

  • 等待人工队列:智能体暂停阻塞项并附带问题(clarification(澄清)、approval(审批)、credential(凭据)、decision(决策))。

  • 响应式恢复:通过 Web UI 或 MCP 回答问题后,任务会自动转换回就绪队列,无需重启智能体。

  • 专属人工收件箱:实时展示所有需要人工关注的事项队列。

🔍 5. 发现的工作

  • 任务中途工作捕获:在不放弃当前任务认领的情况下,捕获执行过程中发现的新工作。

  • 必须修复与延期:标记为 must-fix-now(立即修复,作为阻塞项插入)或 deferred(延期,放入积压队列)。

🤖 6. 所有权、并发与租约

  • 独占任务认领:租约带自动超时(默认 5 分钟),智能体静默时自动释放。

  • 心跳机制:在长时间运行的任务期间延长租约。

  • 智能体并发限制:限制每个智能体同时持有的任务数(默认:1)。

  • 文件触碰冲突警告:声明的文件会与其他活跃认领的文件进行重叠检查。

🔄 7. 停滞与空转检测

  • 尝试计数器:每次认领/尝试时递增。

  • 自动升级:经过 $N$ 次尝试(默认:3)后,自动将任务暂停为 waiting-on-human,而不是无限循环。

  • 状态驻留时间追踪:审计在 doing 状态中花费的时间,并检测重复的重新打开。

🏛️ 8. 已定案的架构决策(ADR)

  • 项目级记录:保存超越任务生命周期的决策与理由。

  • 规划前咨询:智能体在规划之前先阅读已定案的决策。

  • 取代支持:以强制理由干净地更新并链接被取代的决策。


🚀 快速开始与安装

方案 A:全局安装(推荐用于 moo 命令)

全局安装 moo-tasks,以便在任何位置使用简短的 moo 命令:

npm install -g moo-tasks
# or: pnpm add -g moo-tasks | bun add -g moo-tasks

安装完成后,您可以直接使用 moo

moo init       # Initialize .moo workspace in current project
moo start      # Launch real-time Web UI (http://127.0.0.1:4242)
moo ws         # List registered global workspaces
moo status     # Show Where-Did-I-Leave-Off context
moo search     # Full-text SQLite search

💡 关于 moonpx 的说明

  • 通过 npm install -g moo-tasks 全局安装后,可直接使用 moo <command>

  • 如果未全局安装,请使用 npx moo-tasks <command>不要使用 npx moo,因为 npm 仓库中的 moo 是一个无关的包)。

  • 如果全局安装后出现 moo: command not found,请确保 npm 的全局 bin 目录已加入您的 $PATH

    export PATH="$(npm prefix -g)/bin:$PATH"

方案 B:通过 npx moo-tasks 按需使用

无需全局安装即可直接运行:

1. 初始化工作区与智能体协议

在项目根目录中运行:

npx moo-tasks init

此操作将:

  • 初始化 .moo/tasks.db SQLite 数据库(WAL 模式)。

  • 生成 AGENTS.mdCLAUDE.md.cursorrules.windsurfrules

2. 启动本地 Web UI

npx moo-tasks start

在浏览器中打开 http://127.0.0.1:4242

要从本地网络(LAN)中的其他设备或平板访问 Web UI:

npx moo-tasks start --lan
# Automatically logs: http://192.168.x.x:4242/

🔌 智能体与 MCP 配置

一键多智能体安装器

# Configure all detected agent IDEs at once:
npx moo-tasks install all

# Or configure specific clients:
npx moo-tasks install claude       # Updates ~/.claude.json
npx moo-tasks install cursor       # Generates .cursor/mcp.json
npx moo-tasks install windsurf     # Updates ~/.codeium/windsurf/mcp_config.json
npx moo-tasks install antigravity  # Generates .gemini/settings.json

手动配置

{
  "mcpServers": {
    "moo-tasks": {
      "command": "npx",
      "args": ["moo-tasks", "mcp"]
    }
  }
}

🤖 强制智能体协议

所有 AI 编码智能体都被指示遵循以下 6 步生命周期:

1. SESSION RESUME  → Call moo_session_resume() & moo_list_decisions()
2. ANCHOR GOAL     → Call moo_create_goal(title, verbatimPrompt)
3. PLAN & CRITERIA → Call moo_create_task() with markdown criteria BEFORE code
4. EXCLUSIVE CLAIM → Call moo_claim_task(taskId, agentId, sessionId)
5. IMPLEMENTATION  → If blocked, call moo_ask_human() or link blockers
6. VERIFIED PROOF  → Call moo_complete_task() with test proof & output snippet
7. ADR RECORD      → Call moo_record_decision() for architectural choices

🛠️ MCP 工具参考

工具名称

用途

moo_create_goal

记录人类的逐字提示词并设置开放任务上限

moo_list_goals

列出项目目标和状态

moo_get_goal_status

查看目标覆盖率、开放数与上限对比以及未了结事项

moo_kill_goal

删除目标并级联删除所有子任务(需注明原因)

moo_reopen_goal

重新打开目标及其任务

moo_create_task

在目标下创建任务,包含验收标准和声明文件

moo_create_tasks_batch

原子化批量创建多个任务

moo_quick_start

⚡ 一键快速工具:原子化创建并认领任务,包含租约和声明文件

moo_checkpoint

⚡ 快速进度检查点:追加尝试说明并延长心跳

moo_get_compact_context

🧠 超密集 token 优化上下文块(< 400 tokens),用于提示注入

moo_update_task

更新标题、标准、优先级、声明文件或目标

moo_link_dependencies

链接前置阻塞项并验证循环依赖

moo_unlink_dependencies

取消链接前置阻塞项

moo_get_next_task

自动显示下一个未阻塞的最高优先级任务

moo_get_task

获取完整任务详情、子任务、说明和依赖项

moo_list_tasks

按目标、状态、优先级、代理、延期筛选任务

moo_claim_task

独占认领任务(强制执行租约和冲突检查)

moo_heartbeat_task

在长时间运行的任务期间延长活动租约

moo_release_task

自愿将认领释放回待办

moo_handoff_task

将进行中的任务连同说明移交给另一个代理

moo_complete_task

标记任务完成,附上强制命令/证明证据

moo_verify_task

验证任务完成(人工或验证代理)

moo_reject_task

拒绝已完成的任务,必须注明原因

moo_ask_human

将问题升级给人类并暂停任务

moo_get_human_inbox

列出所有等待人工指导的任务

moo_answer_human

回答问题并自动恢复任务

moo_capture_discovered_work

添加工件中发现的新工作(必须修复或延期)

moo_add_task_note

追加带时间戳和归属的上下文/尝试说明

moo_list_task_notes

列出上下文历史和尝试日志

moo_drop_task

删除任务,必须注明原因

moo_reopen_task

重新打开任务而不丢失审计历史

moo_undo_status_change

撤销上次状态转换

moo_bulk_drop_tasks

单次操作删除多个任务

moo_bulk_reopen_tasks

单次操作重新打开多个任务

moo_record_decision

记录项目级架构决策

moo_list_decisions

在规划前列出已确定的决策

moo_supersede_decision

用新的理由取代决策

moo_merge_tasks

合并重复任务

moo_session_resume

“我上次进行到哪了?”会话摘要

moo_export_project

将项目导出为 Markdown、JSON 或纯文本

moo_archive_completed

将已完成/已删除的任务归档到活动列表之外


🏛️ 架构与整洁代码

src/
├── domain/                    # Pure Enterprise Domain Rules & Invariants
│   ├── types.ts              # Domain interfaces & value types
│   ├── errors.ts             # Domain-specific typed error classes
│   ├── dependency.ts         # DAG cycle detector & unblocked evaluator
│   ├── conflict.ts           # File touch overlap conflict detector
│   └── similarity.ts         # Duplicate task similarity detector
│
├── infrastructure/            # Persistence & External Integrations
│   ├── db/database.ts        # SQLite manager (WAL mode, busy timeout)
│   ├── db/migrations.ts      # Schema DDL and versioning
│   ├── git/git-context.ts    # Git branch, commit, dirty status extractor
│   └── repositories/         # SQLite Repository Implementations
│
├── services/                  # Application Services (Use Cases)
│   ├── goal-service.ts        # Goal lifecycle & cap enforcement
│   ├── task-lifecycle-service.ts # State machine, ready queue, undo
│   ├── claim-service.ts       # Exclusive claims, leases, dead-agent timeout
│   ├── verification-service.ts# Proof of work & two-phase verification
│   ├── human-collab-service.ts# Human Q&A queue & reactive resume
│   ├── discovered-work-service.ts # Mid-flight discovered work
│   ├── decision-service.ts    # ADR logs & supersede linking
│   ├── duplicate-merge-service.ts # Idempotency & task merging
│   ├── session-service.ts     # Where-did-I-leave-off session resume
│   ├── housekeeping-service.ts# Archiving & multi-format export
│   └── index.ts               # Dependency Injection Container
│
├── mcp/                       # Model Context Protocol Stdio Server
├── server/                    # Fastify HTTP + Server-Sent Events (SSE) Engine
├── cli/                       # CLI Commands (start, init, install, mcp)
└── ui/                        # Vanilla JS + Tailwind + Lucide Icons Web UI

🤝 贡献

欢迎贡献!请查看 CONTRIBUTING.md 了解开发环境搭建、测试和 PR 指南。


📄 许可证

本项目采用 MIT 许可证 授权。

A
license - permissive license
Not graded
quality - not tested
B
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    Not graded
    quality
    A
    maintenance
    Server-enforced workflow discipline for AI agents. An MCP server providing persistent work items, dependency graphs, quality gates, and actor attribution. Schemas define what agents must produce — the server blocks the call if they don't. Works with any MCP-compatible client.
    199
    MIT
  • A
    license
    Not graded
    quality
    A
    maintenance
    MCP server that enables AI agents to run a deterministic orchestration loop with decomposition, subagent execution, and review feedback across multiple LLM backends.
    54
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    MCP server for task management that enables AI agents to read, create, update tasks, and track work sessions, allowing agents and humans to collaborate on the same task board.
    2
    7
    MIT

View all related MCP servers

Related MCP Connectors

  • MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.

  • Control plane for autonomous software labor. Agents claim objectives over MCP with audit trail.

  • MCP server for generating rough-draft project plans from natural-language prompts.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/shekarsiri/moo-tasks'

If you have feedback or need assistance with the MCP directory API, please join our Discord server