任务管理服务器

一个本地任务管理MCP服务器,用于Claude Code,提供项目任务创建、更新和查询功能,支持Web UI仪表板。

  • by TheDavidGilbert
  • TypeScript
  • 本地部署
  • 更新于
在 GitHub 查看 TheDavidGilbert/claude-task-mcp

使用说明

克劳德任务mcp

Claude Code的本地任务管理MCP服务器。将其视为本地Jira——无需注册,无需平台,只需存储库中的SQLite文件。

任务范围为当前项目目录,并存储在 .claude-tasks/tasks.db (忽略了)。Claude Code通过stdio连接到服务器,可以在工作时创建、更新和查询任务。

为什么?

Claude Code每次会话都会冷启动。在一个真实的项目中,这意味着你要么烧毁上下文,重新解释你在哪里,尝试了什么,被阻止了什么——要么你不费心,在会话之间失去连续性。

claude任务mcp为claude提供了一个结构化存储,它可以在会话开始时查询:正在进行什么,什么阻碍了什么,为什么做出决定。Claude可以询问任务服务器并返回结构化事实,而不是从git历史和内存中重建状态。

审计历史记录特别有用。每个阶段的更改、字段更新和注释都会记录下来,并注明是谁做的以及何时做的。你可以问克劳德“为什么我们改变了这项任务的方法?”并从记录的上下文中得到一个真实的答案,而不是猜测。

web UI使它变得有形——大多数MCP工具都是不可见的,但有一个你可以实际查看的仪表板会鼓励你保持任务状态的准确性,这就是让整个事情工作的原因。

主要警告:只有任务状态保持最新,它才能提供价值。在实践中,Claude在工作时会自动完成大部分工作——创建任务、更新阶段、添加注释——因此开销很低。

特性

  • 从您的仓库名称导出的人类可读任务ID(CTM-0001, LOT-0042)
  • 工作流程阶段: ideation → design → refinement → estimated → planned → in-progress → complete → deployed
  • 与常规提交一致的任务类型: feat, fix, docs, refactor, test, chore, perf, ci
  • 优先级: low, medium, high
  • 受让人和到期日字段
  • 评论、任务链接(块/依赖/相关)
  • 完整的审计历史记录——每一项更改都记录了更改的人和时间
  • 具有板视图和日历视图的Web UI仪表板
  • 零配置——首次使用时自动初始化

安装

git clone https://github.com/TheDavidGilbert/claude-task-mcp
cd claude-task-mcp
npm install
npm run build

Claude代码配置

使用 claude mcp add CLI用于注册服务器。MCP服务器存储在 ~/.claude.json --做 不 添加 mcpServers 到 ~/.claude/settings.json,该字段无效。

全球 (一个服务器,跨所有repos-pass工作 project_path 每次通话):

claude mcp add --scope user tasks node "/absolute/path/to/claude-task-mcp/dist/index.js"

每次回购 (无需通过 project_path 在每次调用时——从仓库内部运行):

claude mcp add --scope local tasks node "/absolute/path/to/claude-task-mcp/dist/index.js" \
  -e CLAUDE_TASKS_CWD="/absolute/path/to/your/repo"

注: 默认范围为 claude mcp add 是 local (项目层面)。始终指定 --scope user 对于全球注册,否则它将仅适用于当前项目。

添加后,重新启动Claude Code并运行 /mcp 确认 tasks 服务器已连接。

CLAUDE.md惯例

只有当Claude遵循一致的任务卫生时,服务器才能提供全部价值。将以下内容添加到您的项目中 CLAUDE.md 制定这些公约:

## Task management

This project uses claude-task-mcp for task tracking. Follow these conventions on every session and every piece of work.

### Session start

Call `list_tasks` filtered to `stage: in-progress` before doing anything else. Use the results to understand what is currently in flight and whether any prior context is relevant to the current request.

### Working on a task

- When you begin work on a task, update its stage to `in-progress`
- Reference the task ID in commit messages: `feat: add login page [CTM-0012]`
- When work is complete, update the stage to `complete`
- If the work has been deployed or merged to main, update to `deployed`

### When to add a comment

Add a comment to the task whenever:
- Significant progress has been made — summarise what changed and why
- A non-obvious decision was made — record the reasoning so future sessions have context
- The approach changed — explain why the original plan was abandoned
- You hit a blocker — describe what is blocking and link any related tasks

Comments are the primary way context survives across sessions. Prefer a brief comment over none.

### Linking tasks

Use `link_tasks` to record relationships:
- `blocks` / `blocked-by` — one task cannot proceed until another is resolved
- `relates-to` — tasks share context or affect the same area of the codebase

会话开始查询是最重要的习惯,它使Claude能够连贯地继续工作,而无需重新解释当前状态。

网页用户界面

服务器会自动启动MCP服务器旁边的本地web仪表板:

http://localhost:7654

端口默认为 7654 并且可以用以下命令覆盖 CLAUDE_TASKS_PORT 环境变量。

董事会视图

默认视图位于 / 显示可筛选列表中的所有任务。您可以使用顶部的控件按阶段、类型和优先级进行筛选。单击任务ID打开详细信息页面,其中显示了描述、注释、链接的任务和完整的审核历史记录。

日历视图

日历视图位于 /calendar 在月度网格中按截止日期绘制任务。使用“上一页/下一页”控件在月份之间导航。任务在到期日显示为颜色编码的芯片(按阶段),每个芯片都链接到任务详细信息页面。

http://localhost:7654/calendar?path=/your/repo&year=2025&month=12

工具

工具 必需 可选
create_task title, type description, priority, stage, estimate, assignee, due_date, actor, project_path
get_task task_id project_path
update_task task_id +≥1个字段 title, description, type, priority, stage, estimate, assignee, due_date, actor, project_path
list_tasks — stage, type, priority, project_path
add_comment task_id, body actor, project_path
link_tasks from_task_id, to_task_id, link_type actor, project_path
get_project_info — project_path

任务字段

字段 类型 描述
assignee string 负责人的自由文本用户名或显示名称
due_date string ISO 8601日期,例如。 2025-12-31 --用于在日历视图中绘制任务
actor string 在审核历史记录中将操作归因于的用户名

任务历史记录

每个突变都记录在任务附带的审计日志中:

事件 记录时间
created 任务首先创建
stage_changed The stage 字段已更新--显示新旧阶段
field_changed 任何其他字段都会更新——显示字段名称、旧值、新值
comment_added 附加评论
link_added 在两个任务之间创建链接

传递可选 actor 任何变异工具的参数,以将更改归因于特定用户。历史记录在web UI的任务详细信息页面上可见。

工作流阶段

ideation → design → refinement → estimated → planned → in-progress → complete → deployed

项目前缀生成

前缀来源于首次使用时仓库的目录名:

目录名称 前缀
claude-task-mcp CTM
language-server LS
my-awesome-project MAP

发展

npm run dev    # run with tsx (no build step)
npm run build  # compile to dist/
npm run clean  # remove dist/

MCP检验员测试

npx @modelcontextprotocol/inspector node dist/index.js

打开 http://localhost:5173 以交互方式驱动所有工具。

微笑。

添加 .claude-tasks/ 到 每个项目 它使用此服务器。SQLite数据库由MCP服务器进程保持开放,这意味着:

  • Git在锁定状态下的操作 .db 文件将在Windows上失败或行为不可预测
  • SQLite也写 -wal 和 -shm 数据库打开时,将日志文件与数据库放在一起——在会话中期提交这些日志文件会损坏快照
  • 数据库是本地状态(任务ID、历史记录),在计算机之外没有意义
.claude-tasks/

此回购属于自己 .gitignore 已经包含此条目作为示例。如果您忘记并意外暂存文件,请运行:

git rm --cached .claude-tasks/tasks.db
echo '.claude-tasks/' >> .gitignore

许可证

麻省理工学院