gtasks-mcp
gtasks-mcp
一个用于 Google Tasks 的 Model Context Protocol 服务器——可从 Claude(或任何兼容 MCP 的客户端)列出、搜索、创建、更新、删除和清除任务。
改编自 zcaceres/gtasks-mcp(MIT 许可),改用纯 Node/TypeScript 而非 Bun 重建,并将凭据完全移出仓库(见下文安全部分),同时附带完整的测试套件。
设置
1. 创建 Google Cloud OAuth 客户端
前往 Google Cloud Console,创建项目(或复用现有项目)。
启用 Google Tasks API(API 和服务 → 库)。
配置 OAuth 同意屏幕(个人使用选择“外部”即可——你将是唯一的测试用户)。
创建凭据 → OAuth 客户端 ID → 应用类型选择 桌面应用。
下载 JSON 文件。
2. 安装 OAuth 客户端文件
mkdir -p ~/.gtasks-mcp
mv ~/Downloads/client_secret_*.json ~/.gtasks-mcp/oauth-keys.json在 Windows 上:%USERPROFILE%\.gtasks-mcp\oauth-keys.json。
3. 构建并认证
npm install
npm run build
npm run auth这将打开浏览器窗口进行 Google 同意流程。成功后,credentials.json(你的刷新/访问令牌)会被写入 ~/.gtasks-mcp/ 中 oauth-keys.json 的旁边。
4. 向 Claude Code 注册服务器
claude mcp add gtasks -- node /absolute/path/to/gtasks-mcp/dist/index.jsRelated MCP server: google-task-mcp
暴露的工具
工具 | 描述 |
| 列出任务(所有列表,或通过 |
| 按标题/备注搜索任务 |
| 列出所有任务列表 |
| 创建任务( |
| 更新任务( |
| 删除任务( |
| 清除列表中的已完成任务 |
安全
凭据永远不会存放在此仓库中。
oauth-keys.json(你的 Google Cloud OAuth 客户端)和credentials.json(由npm run auth生成的个人访问/刷新令牌)都存储在~/.gtasks-mcp/下——即操作系统用户配置区域,而非项目目录。仓库内没有需要git add -f的 gitignore 文件;这些机密完全无法从仓库的工作树中访问。具体路径请参阅src/config.ts。credentials.json等同于你 Google Tasks 的密码——任何拥有该文件的人都能读写你的任务。请妥善保管(不要通过电子邮件发送、不要在聊天中粘贴、不要备份到共享位置)。依赖项:仅包含
@google-cloud/local-auth、googleapis和@modelcontextprotocol/sdk——均为官方(Google / Anthropic)包。无遥测、无第三方网络调用;每个请求都直接发送到 Google 自己的 API。已知且已接受的传递性漏洞(
npm audit,检查于 2026-08-25):esbuild/vite(仅开发工具,不属于运行时)和uuid(通过gaxios/googleapis,本服务器实际使用中不存在不可信缓冲区输入路径)存在中等级别问题。两者都需要上游进行破坏性主版本升级才能清除;建议在下次定期依赖审计时重新评估,而非强制进行未经测试的升级。
开发
npm test # vitest
npm run lint # eslint (narrow scope — see eslint.config.js)
npm run typecheck
npm run buildThis server cannot be deployed
Maintenance
Related MCP Connectors
Task management for people and AI agents, with scoped OAuth access to issues, projects, and docs.
Task management for people and AI agents, with scoped OAuth access to issues, projects, and docs.
Read and edit your Tasks boards: create and update tasks, comment, and track time.
Local-first task manager: create, edit, and complete tasks, projects, and checklists via MCP.
Related MCP Servers
- AlicenseAqualityDmaintenanceMCP server for Google Tasks that enables reading, creating, editing, completing, reordering, and deleting tasks via the Google Tasks API.1418 npm1MIT
- AlicenseAqualityCmaintenanceEnables managing Google Tasks (list, create, update, complete, uncomplete, delete) via OAuth 2.0 authorization.8MIT
- AlicenseNot gradedqualityCmaintenanceEnables MCP clients to manage Google Tasks, including creating, updating, deleting, and listing tasks and task lists, with optional due dates and subtasks.46 npmMIT
- AlicenseNot gradedqualityAmaintenanceEnables full read/write access to Google Tasks from any MCP client, including creating, updating, completing, deleting, and moving tasks and task lists with real due dates.93 npm3MIT