article
README
🚀 任务大师:Todoist MCP 对于 Cursor AI
这是一个专为 Cursor AI 开发的 Todoist 模型上下文协议(MCP)服务器实现。借助该服务器,Cursor AI 助手能够直接在您的编程环境中与您的 Todoist 任务进行交互。
🚀 快速开始
本项目是专为 Cursor AI 打造的 Todoist 模型上下文协议(MCP)服务器实现,能让您在编程环境中便捷地与 Todoist 任务交互。您可参考以下内容进行操作。
演示视频
✨ 主要特性
- 灵活的任务过滤:可运用 Todoist 强大的筛选语法进行任务过滤,具体包括:
- 按截止日期筛选,如今天、明天、逾期的任务。
- 按优先级水平(1 - 4,其中 1 为最高优先级)筛选。
- 支持使用复杂查询组合进行筛选。
- 丰富的任务格式化:每个任务会显示优先级、截止日期和其他相关信息,并配有清晰的图标。
- 与 Cursor AI 的集成:能够在您的 Cursor AI 编程环境中无缝使用 Todoist。
📦 安装指南
先决条件
- 需要 Python 3.10 或更高版本。
- 需安装 Poetry 用于依赖管理。
- 要有 Todoist 账户和 API 令牌。
设置步骤
- 克隆此仓库:
git clone https://github.com/mingolladaniele/todoist-mcp.git
cd todoist-mcp
- 安装依赖项:
pip install -r requirements.txt
- 将您的 Todoist API 令牌设置为环境变量:
# Linux/macOS
export TODOIST_API_TOKEN="your-api-token-here"
# Windows
set TODOIST_API_TOKEN="your-api-token-here"
您可以在 Todoist 设置 → 集成 → 开发者中找到您的 Todoist API 令牌。
💻 使用示例
运行服务器
python server.py
MCP 工具
服务器提供以下 MCP 工具:
get_tasks_tool
使用强大的筛选选项检索任务。
参数:
filter_string:Todoist 的高级过滤查询字符串,用于复杂筛选。priority:可选的优先级水平(1 - 4,其中 1 是最高优先级)。
示例筛选字符串:
"today"- 今天截止的任务。"overdue"- 逾期任务。"Jan 3"- 2024 年 1 月 3 日截止的任务。"due before: May 5"- 在 2024 年 5 月 5 日之前截止的任务。"due after: May 5"- 在 2024 年 5 月 5 日之后截止的任务。"due before: +4 hours"- 在接下来的四小时内截止以及所有逾期任务。"no date"- 没有截止日期的任务。"5 days"或"next 5 days"- 接下来的五天内截止的任务。"recurring"- 带有重复日期的任务。
使用 Cursor AI 设置
要在 Cursor AI 中使用,需创建或编辑 MCP 配置文件:
Windows:C:\Users\<username>\.cursor\mcp.json
{
"mcpServers": {
"todoist-mcp": {
"command": "C:/Users/<username>/path/to/todoist-mcp/.venv/Scripts/python.exe",
"args": [
"C:/Users/<username>/path/to/todoist-mcp/server.py"
],
"env": {
"TODOIST_API_TOKEN": "your-api-token-here"
}
}
}
}
请将 <username> 替换为您实际的用户名。完成编辑后,保存文件并重新启动 Cursor,此时您应该可以使用 Todoist 任务了!
🔧 技术细节
项目结构
api/- API 包裹器config/- 配置与设置models/- 模型相关文件tasks/- 任务处理逻辑utils/- 工具和辅助函数
📄 许可证
此项目使用 MIT 许可证。
扫码联系在线客服