C

Claude Task Master

q343959872/claude-task-master
0 Stars 261 次浏览 更新于 2026-08-23

Task Master 是一个与 Claude 一起用于 AI 驱动开发的任务管理系统,旨在与 Cursor AI 无缝协作。它需要来自各种 AI 提供商的 API 密钥,并可以通过 MCP(模型控制协议)或命令行进行配置。

MCP 服务配置

复制以下 JSON 到 OPClaw 或其他 MCP 客户端的配置文件中即可使用

{
  "mcpServers": {
    "taskmaster-ai": {
      "args": [
        "-y",
        "--package=task-master-ai",
        "task-master-ai"
      ],
      "command": "npx"
    }
  }
}

该服务需要配置环境变量:ANTHROPIC_API_KEY、GOOGLE_API_KEY、OPENAI_API_KEY、OPENROUTER_API_KEY

可用工具 (25 个)

该服务在 MCP 协议中暴露的工具,AI 可按需调用

initialize_project 4 个参数 需填 1 项

Initializes a new Task Master project structure by calling the core initialization logic. Creates necessary folders and configuration files for Task Master in the current directory.

必填参数:projectRoot

models 7 个参数 需填 1 项

Get information about available AI models or set model configurations. Run without arguments to get the current model configuration and API key status for the selected model providers.

必填参数:projectRoot

parse_prd 7 个参数 需填 1 项

Parse a Product Requirements Document (PRD) text file to automatically generate initial tasks. Reinitializing the project is not necessary to run this tool. It is recommended to run parse-prd after initializing the project and creating/importing a prd.txt file in the project root's .taskmaster/docs directory.

必填参数:projectRoot

get_tasks 5 个参数 需填 1 项

Get all tasks from Task Master, optionally filtering by status and including subtasks.

必填参数:projectRoot

get_task 5 个参数 需填 1 项

Get detailed information about a specific task

必填参数:id

next_task 3 个参数 需填 1 项

Find the next task to work on based on dependencies and status

必填参数:projectRoot

complexity_report 2 个参数 需填 1 项

Display the complexity analysis report in a readable format

必填参数:projectRoot

set_task_status 5 个参数 需填 3 项

Set the status of one or more tasks or subtasks.

必填参数:id、status、projectRoot

generate 3 个参数 需填 1 项

Generates individual task files in tasks/ directory based on tasks.json

必填参数:projectRoot

add_task 10 个参数 需填 1 项

Add a new task using AI

必填参数:projectRoot

add_subtask 10 个参数 需填 2 项

Add a subtask to an existing task

必填参数:id、projectRoot

update 5 个参数 需填 2 项

Update multiple upcoming tasks (with ID >= 'from' ID) based on new context or changes provided in the prompt. Use 'update_task' instead for a single specific task or 'update_subtask' for subtasks.

必填参数:from、prompt

update_task 5 个参数 需填 3 项

Updates a single task by ID with new information or context provided in the prompt.

必填参数:id、prompt、projectRoot

update_subtask 5 个参数 需填 3 项

Appends timestamped information to a specific subtask without replacing existing content. If you just want to update the subtask status, use set_task_status instead.

必填参数:id、prompt、projectRoot

remove_task 4 个参数 需填 2 项

Remove a task or subtask permanently from the tasks list

必填参数:id、projectRoot

remove_subtask 5 个参数 需填 2 项

Remove a subtask from its parent task

必填参数:id、projectRoot

clear_subtasks 4 个参数 需填 1 项

Clear subtasks from specified tasks

必填参数:projectRoot

move_task 4 个参数 需填 3 项

Move a task or subtask to a new position

必填参数:from、to、projectRoot

analyze_project_complexity 8 个参数 需填 1 项

Analyze task complexity and generate expansion recommendations.

必填参数:projectRoot

expand_task 7 个参数 需填 2 项

Expand a task into subtasks for detailed implementation

必填参数:id、projectRoot

expand_all 6 个参数

Expand all pending tasks into subtasks based on complexity or defaults

该工具无需必填参数,直接调用即可

add_dependency 4 个参数 需填 3 项

Add a dependency relationship between two tasks

必填参数:id、dependsOn、projectRoot

remove_dependency 4 个参数 需填 3 项

Remove a dependency from a task

必填参数:id、dependsOn、projectRoot

validate_dependencies 2 个参数 需填 1 项

Check tasks for dependency issues (like circular references or links to non-existent tasks) without making changes.

必填参数:projectRoot

fix_dependencies 2 个参数 需填 1 项

Fix invalid dependencies in tasks automatically

必填参数:projectRoot

服务介绍

任务大师 GitHub stars

CI npm version Discord

作者:@eyaltoledano & @RalphEcom

Twitter Follow
Twitter Follow

一个与Claude配合使用的人工智能驱动开发的任务管理系统,旨在与Cursor AI无缝协作。

要求

任务大师在多个命令中利用了人工智能,并且这些功能需要单独的API密钥。你可以通过添加你的API密钥来使用来自不同AI提供商的各种模型。例如,如果你想使用Claude 3.7,你需要一个Anthropic API密钥。

你可以定义三种类型的模型供使用:主模型、研究模型和回退模型(当主模型或研究模型失败时使用)。无论你使用哪种模型,其提供商的API密钥必须存在于mcp.json.env文件中。

至少需要以下之一:

  • Anthropic API密钥 (Claude API)
  • OpenAI API密钥
  • Google Gemini API密钥
  • Perplexity API密钥(用于研究模型)
  • xAI API密钥(用于研究或主模型)
  • OpenRouter API密钥(用于研究或主模型)

使用研究模型是可选的但强烈推荐。你至少需要一个API密钥。添加所有API密钥可以让你根据需要无缝切换模型提供商。

快速开始

选项1:MCP(推荐)

MCP(模型控制协议)允许你直接从编辑器运行任务大师。

1. 根据你的编辑器,在以下路径添加你的MCP配置

编辑器 范围 Linux/macOS 路径 Windows 路径
Cursor 全局 ~/.cursor/mcp.json %USERPROFILE%\.cursor\mcp.json mcpServers
项目 <project_folder>/.cursor/mcp.json <project_folder>\.cursor\mcp.json mcpServers
Windsurf 全局 ~/.codeium/windsurf/mcp_config.json %USERPROFILE%\.codeium\windsurf\mcp_config.json mcpServers
VS Code 项目 <project_folder>/.vscode/mcp.json <project_folder>\.vscode\mcp.json servers
Cursor & Windsurf (mcpServers)

jsonc
{
"mcpServers": {
"taskmaster-ai": {
"command": "npx",
"args": ["-y", "--package=task-master-ai", "task-master-ai"],
"env": {
"ANTHROPIC_API_KEY": "YOUR_ANTHROPIC_API_KEY_HERE",
"PERPLEXITY_API_KEY": "YOUR_PERPLEXITY_API_KEY_HERE",
"OPENAI_API_KEY": "YOUR_OPENAI_KEY_HERE",
"GOOGLE_API_KEY": "YOUR_GOOGLE_KEY_HERE",
"MISTRAL_API_KEY": "YOUR_MISTRAL_KEY_HERE",
"OPENROUTER_API_KEY": "YOUR_OPENROUTER_KEY_HERE",
"XAI_API_KEY": "YOUR_XAI_KEY_HERE",
"AZURE_OPENAI_API_KEY": "YOUR_AZURE_KEY_HERE",
"OLLAMA_API_KEY": "YOUR_OLLAMA_API_KEY_HERE",
},
},
},
}

🔑 将YOUR_…_KEY_HERE替换为你的实际API密钥。你可以移除不需要的密钥。

VS Code (servers + type)

jsonc
{
"servers": {
"taskmaster-ai": {
"command": "npx",
"args": ["-y", "--package=task-master-ai", "task-master-ai"],
"env": {
"ANTHROPIC_API_KEY": "YOUR_ANTHROPIC_API_KEY_HERE",
"PERPLEXITY_API_KEY": "YOUR_PERPLEXITY_API_KEY_HERE",
"OPENAI_API_KEY": "YOUR_OPENAI_KEY_HERE",
"GOOGLE_API_KEY": "YOUR_GOOGLE_KEY_HERE",
"MISTRAL_API_KEY": "YOUR_MISTRAL_KEY_HERE",
"OPENROUTER_API_KEY": "YOUR_OPENROUTER_KEY_HERE",
"XAI_API_KEY": "YOUR_XAI_KEY_HERE",
"AZURE_OPENAI_API_KEY": "YOUR_AZURE_KEY_HERE",
},
"type": "stdio",
},
},
}> 🔑 请将 YOUR_…_KEY_HERE 替换为您的真实 API 密钥。您可以删除不需要使用的密钥。

2. (仅光标)启用 Taskmaster MCP

打开光标设置(Ctrl+Shift+J) ➡ 点击左侧的 MCP 选项卡 ➡ 使用切换按钮启用 task-master-ai

3. (可选)配置您想使用的模型

在编辑器的 AI 聊天面板中,输入:

txt
将主模型、研究模型和备用模型分别更改为 <model_name>, <model_name> 和 <model_name>。

可用模型表

4. 初始化 Task Master

在编辑器的 AI 聊天面板中,输入:

txt
在我的项目中初始化 taskmaster-ai

5. 确保您有一个 PRD(推荐)

对于新项目:在 .taskmaster/docs/prd.txt 创建您的 PRD
对于现有项目:您可以使用 scripts/prd.txt 或通过 task-master migrate 进行迁移

初始化后,在 .taskmaster/templates/example_prd.txt 可以找到一个示例 PRD 模板。

[!NOTE]
尽管对于复杂的项目推荐使用 PRD,但您也可以通过在聊天中询问“你能帮我实现[描述您想要做的事情]吗?”来创建单独的任务。

始终从详细的 PRD 开始。

您的 PRD 越详细,生成的任务就会越好。

6. 常用命令

使用您的 AI 助手执行以下操作:

  • 解析需求:Can you parse my PRD at scripts/prd.txt?
  • 规划下一步:What's the next task I should work on?
  • 实现任务:Can you help me implement task 3?
  • 扩展任务:Can you help me expand task 4?

更多关于如何在聊天中使用 Task Master 的示例

选项 2:使用命令行

安装

bash

全局安装

npm install -g task-master-ai

或者在您的项目中本地安装

npm install task-master-ai

初始化新项目

bash

如果全局安装

task-master init

如果本地安装

npx task-master init

这将提示您输入项目详细信息,并设置包含必要文件和结构的新项目。

常用命令

bash

初始化新项目

task-master init

解析 PRD 并生成任务

task-master parse-prd your-prd.txt

列出所有任务

task-master list

显示下一个要处理的任务

task-master next

生成任务文件

task-master generate

文档

有关更详细的信息,请查看 docs 目录中的文档:

故障排除

如果 task-master init 没有响应:

尝试直接使用 Node 运行:

bash
node node_modules/claude-task-master/scripts/init.js

或者克隆仓库并运行:

bash
git clone https://github.com/eyaltoledano/claude-task-master.git
cd claude-task-master
node scripts/init.js

贡献者

Star 历史

Star History Chart

许可

Task Master 根据 MIT 许可证与 Commons Clause 发布。这意味着您可以:

允许

  • 用于任何目的(个人、商业、学术)
  • 修改代码
  • 分发副本
  • 创建并销售使用 Task Master 构建的产品

不允许:- 销售 Task Master 本身

  • 提供 Task Master 托管服务
  • 基于 Task Master 创建竞争产品

请参阅 LICENSE 文件以获取完整的许可文本,并参阅 许可详情 以获取更多信息。

相关 MCP 服务