TODO MCP服务器
一个模型上下文协议(MCP)服务器,用于使用Bun和TypeScript构建的webhook通知管理todo列表和项目。
特性
待办事项列表管理
- 创建 带有名称和描述的新待办事项列表
- 阅读 单个列表或获取所有列表
- 更新 列出名称和描述
- 删除 列表(级联到所有项目)
待办事项管理
- CRUD操作:创建、读取、更新、删除待办事项
- 受让人支持:将待办事项分配给特定人员
- 优先级:无、低、中、高
- 状态跟踪:待定、正在进行、已完成、已取消
- 标签:灵活的分类标签系统
- 到期日:为任务设定截止日期
- Snooze功能:暂时隐藏项目,直到特定时间
高级功能
- 复发:每日、每周、每月或特定工作日
- 搜索:按标题、描述或关键字查找待办事项
- 过滤:按受让人、标签、状态、优先级、截止日期筛选
- 排序:按时间、优先级、创建日期或更新日期排序
- 分页:大型数据集的限制和偏移
- 通知:临近截止日期的Webhook通知
安装
先决条件
- 包子 运行时
- SQLite3(包含在大多数系统中)
设置
# Clone the repository
git clone
cd mcp-todo
# Install dependencies
bun install
# Set up environment variables
cp .env.example .env
# Edit .env with your configuration环境变量
# webhook URL for task notifications (optional)
NOTIFICATION_WEBHOOK=http://localhost:3000/api/webhooks/your-webhook-url
# Database configuration
DATABASE_PATH=./todo.db
# Server configuration
MCP_SERVER_NAME=mcp-todo
MCP_SERVER_VERSION=1.0.0用法
发展
# Start in development mode with auto-reload
bun run dev
# Run type checking
bun run typecheck
# Run tests
bun test生产
# Start the server
bun run start
# Or build and run with Docker
docker-compose up -dMCP工具
服务器提供以下MCP工具:
待办事项列表操作
createTodoList-创建新的待办事项列表getTodoList-按ID获取待办事项列表getAllTodoLists-获取所有待办事项列表updateTodoList-更新待办事项列表deleteTodoList-删除待办事项列表
待办事项操作
createTodoItem-创建新的待办事项getTodoItem-按ID获取待办事项searchTodoItems-搜索和筛选待办事项updateTodoItem-更新待办事项markTodoDone-将待办事项标记为已完成deleteTodoItem-删除所有项目
使用示例
创建待办事项列表
{
"name": "Work Tasks",
"description": "Tasks related to work projects"
}创建待办事项
{
"list_id": "list-uuid",
"title": "Complete project documentation",
"description": "Write comprehensive docs for the new feature",
"assignee": "john.doe@example.com",
"priority": "high",
"tags": ["documentation", "urgent"],
"due_date": "2024-12-31T23:59:59Z",
"recurrence": {
"type": "weekly",
"weekdays": [1, 3, 5]
}
}搜索所有项目
{
"query": "documentation",
"status": ["pending", "in_progress"],
"priority": ["high", "medium"],
"assignee": "john.doe@example.com",
"due_before": "2024-12-31T23:59:59Z",
"sort_field": "due_date",
"sort_order": "asc",
"limit": 10
}数据库模式
服务器使用SQLite和下表:
- 所有列表:存储待办事项列表信息
- 所有项目:存储单个待办事项
- 标签:存储唯一的标记名称
- 所有_标签:待办事项和标签之间的多对多关系
- 复发:存储待办事项的重复模式
Docker部署
使用Docker Compose
# Start the service
docker-compose up -d
# View logs
docker-compose logs -f
# Stop the service
docker-compose down直接使用Docker
# Build the image
docker build -t mcp-todo .
# Run the container
docker run -d \
--name mcp-todo \
-v todo-data:/data \
-e NOTIFICATION_WEBHOOK=your-webhook-url \
mcp-todo通知
当a NOTIFICATION_WEBHOOK 如果已配置,服务器将:
- 每5分钟检查一次下一小时内到期的任务
- 发送即将到来的截止日期的webhook通知
- 自动暂停通知1小时以避免垃圾邮件
- 包括任务详细信息,如标题、受让人、优先级和标签
Webhook有效载荷格式
{
"content": "Task deadline approaching!",
"data": {
"id": "string";
"list_id": "string";
"title": "string";
"description": "string";
"assignee": "string";
"priority": "none"; // none, low, medium, high
"status": "completed"; // pending, in_progress, completed, cancelled
"tags": [];
"due_date": Date;
"snoozed_until": Date;
"recurrence": {
"type": "daily"; // daily, weekly, monthly, weekdays
"weekdays": []; // 0-6 for Sunday-Saturday
"day_of_month": 1; // 1-31
"next_due": Date;
};
"completed_at"?: Date;
"created_at": Date;
"updated_at": Date;
"metadata": {};
}
}api参考
重复类型
daily:每天重复weekly:在特定工作日重复(0=星期日,6=星期六)monthly:在一个月的特定日期重复weekdays:仅在工作日(周一至周五)重复
优先级
none:未设置优先级low:低优先级medium:中等优先级high:高优先级
状态选项
pending:任务未启动in_progress:正在处理任务completed:任务已完成cancelled:任务已取消
发展
项目结构
src/
├── db/ # Database connection and schema
├── models/ # Repository classes for data access
├── server/ # MCP server implementation
├── types/ # TypeScript type definitions
└── utils/ # Utility functions测试
# Run all tests
bun test
# Run with coverage
bun test --coverage
# Run specific test file
bun test tests/todo-list.repository.test.ts贡献
- 分叉存储库
- 创建要素分支
- 进行更改
- 添加新功能的测试
- 确保所有测试通过
- 提交拉取请求
许可证
该项目根据MIT许可证获得许可。
故障排除
常见问题
- 数据库锁定错误:确保只有一个服务器实例正在运行
- 权限不足:检查数据库路径的文件权限
- Webhook 无法工作:验证webhook URL是否正确且可访问
调试模式
集 NODE_ENV=development 以启用额外的日志记录。
支持
如有疑问,请:
- 检查上面的故障排除部分
- 在GitHub上搜索现有问题
- 创建包含详细信息的新问题
