MCP任务管理工具是一款高效的任务管理工具。它旨在减少工具使用的复杂性,最大程度提高大语言模型(LLM)的预算使用效率。同时,它具备强大的搜索、过滤和组织功能,支持多种文件格式,如Markdown、JSON和YAML。
将以下内容添加到 ~/.cursor/mcp.json(适用于Cursor)或 ~/.config/claude_desktop_config.json(适用于Claude Desktop)中。
{
"mcpServers": {
"mcp-tasks": {
"command": "npx",
"args": ["-y", "mcp-tasks"]
}
}
}
{
"mcpServers": {
"mcp-tasks": {
"command": "docker",
"args": [
"run",
"--rm",
"-i",
"flesler/mcp-tasks"
]
}
}
}
.md)、JSON(.json)和YAML(.yml)任务文件。{
"mcpServers": {
"mcp-tasks": {
"command": "npx",
"args": ["-y", "mcp-tasks"],
"env": {
"STATUS_WIP": "In Progress",
"STATUS_TODO": "To Do",
"STATUS_DONE": "Done",
"STATUS_REMINDERS": "Reminders",
"STATUS_NOTES": "Notes",
"STATUSES": "In Progress,To Do,Done,Backlog,Reminders,Notes",
"AUTO_WIP": "true",
"PREFIX_TOOLS": "true",
"KEEP_DELETED": "true",
"TRANSPORT": "stdio",
"PORT": "4680",
"INSTRUCTIONS": "Use mcp-tasks tools when the user mentions new or updated tasks"
}
}
}
}
首先启动服务器:
TRANSPORT=http PORT=4680 npx mcp-tasks
然后:
{
"mcpServers": {
"mcp-tasks": {
"type": "streamableHttp",
"url": "http://localhost:4680/mcp"
}
}
}
| 扩展名 | 格式 | 适用场景 | 自动创建 |
|---|---|---|---|
.md |
Markdown | 人类可读的任务列表 | ✅ |
.json |
JSON | 结构化数据、API | ✅ |
.yml |
YAML | 配置文件 | ✅ |
格式会根据文件扩展名自动检测。所有格式都支持相同的功能,并且可以在同一项目中混合使用。
推荐:使用Markdown(.md)格式,以便于人类阅读和编辑。
⚠️ 重要提示
建议从新文件开始使用,而不是使用现有的任务文件,以避免丢失非任务内容。
当 PREFIX_TOOLS=true(默认设置)时,所有工具都会以 tasks_ 为前缀:
| 工具 | 描述 | 参数 |
|---|---|---|
tasks_setup |
初始化任务文件(如果文件不存在则创建,支持 .md、.json、.yml) |
source_path, workspace? |
tasks_search |
搜索任务并进行过滤 | source_id, statuses?, terms?, ids? |
tasks_add |
向某个状态添加新任务 | source_id, texts[], status, index? |
tasks_update |
通过ID更新任务 | source_id, ids[], status, index? |
tasks_summary |
获取任务数量和进行中任务的信息 | source_id |
ID格式:source_id(来自文件路径)和任务 id(来自任务文本)都是4个字符的字母数字字符串(例如,"xK8p"、"m3Qw")。
tasks_setup({
workspace: "/path/to/project",
source_path: "tasks.md" // 相对于工作空间或绝对路径
// source_path: "tasks.json"
// source_path: "tasks.yml"
})
// 返回: {"source":{"id":"xK8p","path":"/path/to/project/tasks.md"},"Backlog":0,"To Do":0,"In Progress":0,"Done":0,"inProgress":[]}
// 源ID(4个字符的字母数字字符串)将用于所有后续操作
tasks_add({
source_id: "xK8p", // 来自初始化响应
texts: ["Implement authentication", "Write tests"],
status: "To Do",
index: 0 // 添加到顶部(可选)
})
// 返回: {"source":{"id":"xK8p","path":"/absolute/path/to/tasks.md"},"Backlog":0,"To Do":2,"In Progress":0,"Done":0,"inProgress":[],"tasks":[{"id":"m3Qw","text":"Implement authentication","status":"To Do","index":0},{"id":"p9Lx","text":"Write tests","status":"To Do","index":1}]}
tasks_search({
source_id: "xK8p", // 来自初始化响应
terms: ["auth", "deploy"], // 搜索词(文本或状态,使用OR逻辑)
statuses: ["To Do"], // 按状态过滤
ids: ["m3Qw", "p9Lx"] // 按特定任务ID过滤
})
// 返回: [{"id":"m3Qw","text":"Implement authentication","status":"To Do","index":0}]
tasks_update({
source_id: "xK8p", // 来自初始化响应
ids: ["m3Qw", "p9Lx"], // 来自添加/搜索响应的任务ID
status: "Done" // 使用 "Deleted" 来删除任务
})
// 返回: {"source":{"id":"xK8p","path":"/absolute/path/to/tasks.md"},"Backlog":0,"To Do":0,"In Progress":0,"Done":2,"inProgress":[],"tasks":[{"id":"m3Qw","text":"Implement authentication","status":"Done","index":0},{"id":"p9Lx","text":"Write tests","status":"Done","index":1}]}
tasks_summary({
source_id: "xK8p" // 来自初始化响应
})
// 返回: {"source":{"id":"xK8p","path":"/absolute/path/to/tasks.md"},"Backlog":0,"To Do":0,"In Progress":1,"Done":2,"inProgress":[{"id":"r7Km","text":"Fix critical bug","status":"In Progress","index":0}]}
| 变量 | 默认值 | 描述 |
|---|---|---|
TRANSPORT |
stdio |
传输模式:stdio 或 http |
PORT |
4680 |
HTTP服务器端口(当 TRANSPORT=http 时) |
PREFIX_TOOLS |
true |
在工具名称前添加 tasks_ 前缀 |
STATUS_WIP |
In Progress |
进行中任务的状态名称 |
STATUS_TODO |
To Do |
待办任务的状态名称 |
STATUS_DONE |
Done |
已完成任务的状态名称 |
STATUS_REMINDERS |
Reminders |
给人工智能的提醒(空字符串表示禁用) |
STATUS_NOTES |
Notes |
备注/非可操作任务(空字符串表示禁用) |
STATUSES |
Backlog |
以逗号分隔的其他状态 |
AUTO_WIP |
true |
当没有进行中任务时,将一个待办任务移动到进行中状态,并将其他进行中任务移动到待办状态 |
KEEP_DELETED |
true |
保留已删除的任务(确保人工智能不会丢失你的任务!) |
INSTRUCTIONS |
... |
包含在所有工具响应中,供人工智能遵循 |
SOURCES_PATH |
./sources.json |
存储源注册表的文件(内部使用) |
DEBUG |
false |
如果为 true,则启用 tasks_debug 工具 |
可选地,可以包含进行中/待办/已完成状态,以控制它们的顺序。
{
"env": {
"STATUSES": "WIP,Pending,Archived,Done,To Review",
"STATUS_WIP": "WIP",
"STATUS_TODO": "Pending",
"AUTO_WIP": "false"
}
}
.md) - 人类可读# 任务 - 文件名
## 进行中
- [ ] 编写用户注册功能
## 待办
- [ ] 实现身份验证
- [ ] 设置CI/CD管道
## 积压
- [ ] 规划架构
- [ ] 设计数据库架构
## 已完成
- [x] 设置项目结构
- [x] 初始化仓库
## 提醒
- [ ] 在确认功能正常工作之前,不要将任务标记为已完成
- [ ] 将任务标记为已完成后,提交所有更改,并使用任务名称作为提交消息
## 备注
- [ ] 任务管理工具使用起来非常棒!
.json) - 结构化数据{
"groups": {
"In Progress": [
"Write user registration"
],
"To Do": [
"Implement authentication",
"Set up CI/CD pipeline"
],
"Backlog": [
"Plan architecture",
"Design database schema"
],
"Done": [
"Set up project structure",
"Initialize repository"
],
"Reminders": [
"Don't move to Done until you verified it works",
"After you move to Done, commit all the changes, use the task name as the commit message"
],
"Notes": [
"The task tools were really great to use!"
]
}
}
.yml) - 适合配置groups:
"In Progress":
- Write user registration
"To Do":
- Implement authentication
- Set up CI/CD pipeline
Backlog:
- Plan architecture
- Design database schema
Done:
- Set up project structure
- Initialize repository
Reminders:
- Don't move to Done until you verified it works
- After you move to Done, commit all the changes, use the task name as the commit message
# 显示帮助信息
mcp-tasks --help
# 默认:使用stdio传输
mcp-tasks
# 使用HTTP传输
TRANSPORT=http mcp-tasks
TRANSPORT=http PORT=8080 mcp-tasks
# 自定义配置
STATUS_WIP="Working" AUTO_WIP=false mcp-tasks
你也可以将 mcp-tasks(或 npx mcp-tasks)作为命令行工具,进行快速任务管理:
# 初始化任务文件
mcp-tasks setup tasks.md $PWD # 带工作空间的初始化
# 添加任务
mcp-tasks add "Implement authentication" # 默认添加到 "To Do" 状态
mcp-tasks add "Write tests" "Backlog" # 添加到指定状态
mcp-tasks add "Fix critical bug" "In Progress" 0 # 添加到顶部(索引为0)
# 搜索任务
mcp-tasks search # 搜索所有任务
mcp-tasks search "" "auth,login" # 搜索特定关键词
mcp-tasks search "To Do,Done" "" # 按状态过滤
mcp-tasks search "In Progress" "bug" # 按状态和关键词过滤
# 更新任务状态(ID以逗号分隔)
mcp-tasks update m3Qw,p9Lx Done
# 获取概览信息
mcp-tasks summary
# 添加提醒(必须启用提醒功能,设置 REMINDERS=true)
mcp-tasks add "Don't move to Done until you verified it works" Reminders
# 克隆并设置项目
git clone https://github.com/flesler/mcp-tasks
cd mcp-tasks
npm install
# 开发模式(自动重启)
npm run dev # 使用STDIO传输
npm run dev:http # 使用HTTP传输,端口为4680
# 构建和测试
npm run build # 编译TypeScript代码
npm run lint # 检查代码风格
npm run lint:full # 构建 + 检查代码风格
npx-tasks 时出现 ERR_MODULE_NOT_FOUND 错误npx mcp-tasks 时出现类似 Cannot find module '@modelcontextprotocol/sdk/dist/esm/server/index.js' 的错误。npx clear-npx-cache
npx mcp-tasks
tasks_setup 中指定的文件路径中。source.path 的形式返回。read_file、grep_search、sed 来定位和修改正确的部分。我们欢迎贡献!请按照以下步骤进行:
git checkout -b feature-namenpm run lint:full本项目采用MIT许可证 - 详情请参阅 LICENSE 文件。