task-manager-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@task-manager-mcp 列出所有进行中的任务"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Task Manager MCP Server
任务管理 MCP(Model Context Protocol,模型上下文协议)Server,纯 JavaScript 实现,无原生模块依赖。
配合 Electron 任务管理桌面应用 使用,让 AI 能够直接操作你的任务数据库。
为什么选择纯 JS 实现?
原方案使用 better-sqlite3(C++ 原生模块),该模块编译绑定特定 Node.js ABI 版本:
Electron 33.x → NODE_MODULE_VERSION 130
Node.js 20.x → NODE_MODULE_VERSION 127
两者不兼容,导致安装后用户无法用普通 node 运行 MCP Server。
本方案使用 sql.js(SQLite 的 WebAssembly 编译),零原生依赖,任何 Node.js 版本直接运行。
Related MCP server: MCP Project Manager
特性
零原生依赖:使用
sql.js,无需 rebuild,开箱即用与桌面应用共享数据库:读写同一个 SQLite 文件,数据实时同步
15 个 MCP Tools:覆盖任务、标签、分类、项目的完整 CRUD 操作
参数校验:使用
zod严格校验输入参数完整的错误处理:操作失败返回清晰的错误信息
项目结构
task-manager-mcp/
├── src/
│ ├── index.ts # MCP Server 入口(stdio 传输)
│ ├── database.ts # sql.js 数据库管理(核心适配层)
│ ├── types.ts # 数据类型定义
│ └── tools/ # MCP Tools(按模块组织)
│ ├── task.tools.ts # 6 个任务 tools
│ ├── tag.tools.ts # 3 个标签 tools
│ ├── category.tools.ts # 3 个分类 tools
│ └── project.tools.ts # 3 个项目 tools
│
├── package.json
├── tsconfig.json
└── README.md安装
环境要求
Node.js >= 18
npm >= 8
安装依赖
cd task-manager-mcp
npm install无需 rebuild!
sql.js是纯 JavaScript,直接安装即可使用。
使用方式
开发模式(tsx 直接运行)
npm run dev生产模式
npm run build # TypeScript 编译到 dist/
npm start # node dist/index.js数据库路径
MCP Server 通过环境变量 TASK_MANAGER_DB_PATH 指定数据库文件位置。
操作系统 | 默认路径 |
Windows |
|
macOS |
|
注意:首次使用前需要先运行一次 Electron 桌面应用(xx-task),让主进程初始化数据库表结构。MCP Server 不会自动建表。
数据同步策略
MCP Server 与 Electron 应用共享同一个 SQLite 文件,采用以下策略确保数据一致性:
每次工具调用:
读取文件 → 加载到内存(sql.js) → 执行操作 → 写回文件(如有写操作) → 关闭每次操作都从磁盘读取最新数据,避免缓存过期
写操作完成后立即导出到磁盘
任务管理数据量小(通常 < 1MB),性能无影响
SQLite WAL(Write-Ahead Logging)模式支持并发读写
测试
使用 MCP Inspector(推荐)
npx @modelcontextprotocol/inspector npm run dev会打开 Web UI,可以:
查看所有注册的 tools 列表
手动调用每个 tool 并查看返回结果
测试参数校验
手动 stdio 测试
npm run dev
# 然后在另一个终端输入 JSON-RPC 消息:
echo '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}' | npx tsx src/index.ts配置到 AI 客户端
Claude Desktop
编辑配置文件 %APPDATA%\Claude\claude_desktop_config.json:
生产模式(推荐):
{
"mcpServers": {
"task-manager": {
"command": "node",
"args": ["C:/Users/<你的用户名>/task-manager-mcp/dist/index.js"],
"env": {
"TASK_MANAGER_DB_PATH": "C:/Users/<你的用户名>/AppData/Roaming/task-manager/taskmanager.db"
}
}
}
}开发模式:
{
"mcpServers": {
"task-manager": {
"command": "npx",
"args": ["tsx", "C:/Users/<你的用户名>/task-manager-mcp/src/index.ts"],
"env": {
"TASK_MANAGER_DB_PATH": "C:/Users/<你的用户名>/AppData/Roaming/task-manager/taskmanager.db"
}
}
}
}Cursor / Windsurf
找到 MCP 设置入口,添加上述配置即可。
可用 Tools 列表
任务管理(6 个)
Tool | 参数 | 说明 |
| status?, project_id?, tag_id?, keyword? | 获取任务列表,支持多种筛选 |
| id | 获取任务详情(含标签和项目) |
| title, description?, status?, ... | 添加新任务 |
| id, title?, description?, ... | 更新任务(只需传修改字段) |
| id, status | 变更任务状态 |
| id | 删除任务(不可恢复) |
标签管理(3 个)
Tool | 参数 | 说明 |
| 无 | 获取所有标签 |
| name, color? | 创建标签 |
| id | 删除标签 |
分类管理(3 个)
Tool | 参数 | 说明 |
| 无 | 获取所有分类(含项目列表) |
| name, description? | 创建分类 |
| id | 删除分类(级联删除项目) |
项目管理(3 个)
Tool | 参数 | 说明 |
| category_id?, keyword? | 获取项目列表,支持按名称关键词搜索 |
| name, category_id, description? | 创建项目 |
| id | 删除项目 |
示例对话
配置好后,你可以对 AI 说:
任务操作:
"帮我创建一个任务:完成项目报告,截止日期下周五"
"列出所有进行中的任务"
"把'完成项目报告'的状态改为进行中"
"删除任务 ID 为 5 的任务"
标签操作:
"创建一个标签:紧急,颜色红色 #ff0000"
"显示所有标签"
分类和项目:
"新建一个分类叫'工作'"
"在'工作'分类下创建一个'Q4 规划'项目"
"显示所有分类和项目"
技术栈
技术 | 用途 |
Node.js | 运行环境 |
TypeScript | 类型安全 |
sql.js | SQLite 数据库(纯 JS/WASM) |
@modelcontextprotocol/sdk | MCP 协议 SDK |
zod | 参数校验 |
tsx | 开发模式 TypeScript 运行 |
与 xx-task 的关系
项目 | 职责 | 数据库驱动 |
Electron 桌面应用,UI 交互 | better-sqlite3(原生模块) | |
task-manager-mcp(本仓库) | MCP Server,AI 操作接口 | sql.js(纯 JS/WASM) |
两个项目共享同一个 SQLite 数据库文件,通过 WAL 模式实现并发安全。
构建脚本
命令 | 说明 |
| 开发模式(tsx 直接运行) |
| 编译 TypeScript 到 dist/ |
| 生产模式运行 |
License
MIT
Available Tools
15 toolscategory_createC
创建新分类
Inputs: name (required), description.
category_deleteA
删除指定分类(会级联删除其下所有项目,但不会删除任务)
Inputs: id (required).
category_listA
获取所有分类列表,每个分类包含其下的项目列表
Inputs: no named parameters.
project_createB
创建新项目,需要指定所属分类ID
Inputs: name (required), category_id (required), description.
project_deleteA
删除指定项目(项目下的任务不会被删除,但会失去项目关联)
Inputs: id (required).
project_listA
获取项目列表。可选按分类ID、名称关键词筛选,不传则返回所有项目。
Inputs: keyword, category_id.
tag_createA
创建新标签。name 必填,color 可选(hex 颜色值,默认 #6366f1)
Inputs: name (required), color.
tag_deleteA
删除指定标签(不会删除已关联的任务)
Inputs: id (required).
tag_listA
获取所有标签列表
Inputs: no named parameters.
task_addB
添加一个新任务。标题为必填,其他字段可选。tag_ids 用于关联标签。
Inputs: title (required), status, tag_ids, end_time, +3 more.
task_change_statusC
变更任务状态。可选状态: not_started(未开始), paused(暂停), in_progress(进行中), completed(完成), archived(归档)
Inputs: id (required), status (required).
task_deleteA
删除指定任务(不可恢复)
Inputs: id (required).
task_getB
获取指定任务的详细信息,包含标签和项目信息
Inputs: id (required).
task_listA
获取任务列表。支持按状态、项目ID、标签ID、关键词筛选。不传参数则返回所有任务。
Inputs: status, tag_id, keyword, project_id.
task_updateA
更新任务信息。只需传入要修改的字段。tag_ids 传入新列表会覆盖原有标签。
Inputs: id (required), title, tag_ids, end_time, +3 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 15 tools
Tools are clearly separated by resource (task, project, category, tag). The only potential confusion is task_update and task_change_status, since status could be considered a task field, and category_list versus project_list when retrieving projects with category context. Descriptions help disambiguate, but there is minor overlap.
Most tools follow a consistent entity_action pattern (category_create, project_delete, tag_list). However, task_add deviates from the create convention used elsewhere, and task_change_status is a multi-word verb unlike the simple single-action names.
15 tools for a task manager with tasks, projects, categories, and tags is well-scoped. Each tool covers a distinct need and none feel redundant or unnecessary.
Tasks have full lifecycle coverage (create/read/update/delete/status), but categories, projects, and tags lack update operations entirely. There is no way to rename a project or recolor a tag without delete/recreate, which is a notable gap in the resource management surface.
Maintenance
Related MCP Connectors
Local-first task manager: create, edit, and complete tasks, projects, and checklists via MCP.
Shared memory for your AI tools: tasks, notes and context every tool can read and write over MCP.
Manage Superlist tasks and lists in plain language from any MCP-compatible AI agent.
Task management your AI agents can actually run. One line becomes a context-ready task over MCP.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants to manage tasks with full lifecycle support including due dates, priorities, tags, subtasks, and project lists via 19 SQLite-backed MCP tools.5-
- FlicenseAqualityDmaintenanceEnables task management (create, list, update tasks with priority and status) using SQLite storage via MCP tools.3-
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to manage and query SQLite databases through MCP tools, supporting CRUD operations, schema management, and saved views.4 npmMIT
- AlicenseAqualityBmaintenanceEnables AI agents to manage projects, roadmaps, periods, and tasks through MCP tools, backed by a local SQLite database with schema validation.20MIT