任务管理服务器

Google Tasks MCP服务器,支持通过自然语言管理任务列表和任务,适用于Claude Desktop等MCP客户端。

  • by alvinjchoi
  • JavaScript
  • 本地部署
  • 10 星标
  • 更新于
在 GitHub 查看 alvinjchoi/gtasks-mcp

使用说明

谷歌任务MCP服务器

用于Google任务的模型上下文协议(MCP)服务器。在Claude Desktop和其他MCP客户端中通过自然语言管理任务列表和任务。

源自 zcaceres/gtasks mcp 具有更强的身份验证选项、多列表支持、分页和层次结构工具。

注册表名称: io.github.alvinjchoi/gtasks-mcp
npm: @alvincrave/gtasks-mcp

特性

  • 列出和搜索任务(可选范围为一个任务列表)
  • 完成所有任务(无100个无声任务上限)
  • 创建、更新、删除和清除已完成的任务
  • 发现任务列表(list_task_lists)
  • 查看父/子层次结构(list_with_tree)
  • 在列表中重新排序、嵌套或移动任务(move)
  • OAuth2通过环境变量、凭据文件或交互式身份验证 auth
  • Docker支持

安装

推荐(Claude Desktop/任何MCP客户端)-运行最新发布的npm包:

npx -y @alvincrave/gtasks-mcp

或全局安装:

npm install -g @alvincrave/gtasks-mcp

来源

git clone https://github.com/alvinjchoi/gtasks-mcp.git
cd gtasks-mcp
npm install
npm run build

设置

选项A——环境变量(Claude Desktop)

  1. 创建Google Cloud项目并启用 谷歌任务API.
  2. 创建OAuth 2.0桌面凭据并获取刷新令牌(具有作用域的OAuth Playground https://www.googleapis.com/auth/tasks 作品)。
  3. 配置Claude桌面(~/Library/Application Support/Claude/claude_desktop_config.json 在macOS上):
{
  "mcpServers": {
    "gtasks": {
      "command": "npx",
      "args": ["-y", "@alvincrave/gtasks-mcp"],
      "env": {
        "GOOGLE_CLIENT_ID": "your_client_id_here",
        "GOOGLE_CLIENT_SECRET": "your_client_secret_here",
        "GOOGLE_REFRESH_TOKEN": "your_refresh_token_here"
      }
    }
  }
}

选项B——凭证文件(本地/与其他Google MCP服务器共享)

  1. 下载OAuth客户端JSON(gcp-oauth.keys.json).
  2. 验证一次:
export GTASKS_CREDENTIALS_PATH=/path/to/gcp-oauth.keys.json
export GTASKS_TOKEN_PATH=/path/to/.gtasks-server-credentials.json
node dist/index.js auth
  1. 使用相同的env变量集(或位置)运行服务器 gcp-oauth.keys.json 在项目根目录中,使用默认值)。

别名也被接受:

目的 首选 别名
OAuth客户端密钥 GTASKS_CREDENTIALS_PATH GOOGLE_OAUTH_KEYS_PATH
已保存的令牌 GTASKS_TOKEN_PATH GOOGLE_TASKS_CREDENTIALS_PATH

选项C——主配置文件

创建 ~/.gtasks-credentials.json:

{
  "clientId": "your_client_id",
  "clientSecret": "your_client_secret",
  "refreshToken": "your_refresh_token"
}

工具

工具 说明
search 按标题/注释搜索任务。可选的 taskListId.
list 列出任务(所有列表,或一个通过 taskListId).完全分页。
list_task_lists 列出任务列表名称和ID。
list_with_tree 一个列表的树视图(父/子、位置顺序)。
move 重新排序、嵌套/取消嵌套或在列表中移动。
create 创建任务(title 必修的;可选备注/到期/taskListId).
update 修补任务(仅提供字段更改)。
delete 删除任务。
clear 从列表中清除已完成的任务。

使用示例

show my task lists
list tasks in list <id>
search for tasks containing "meeting"
create a task named "Prepare presentation" due 2026-07-20
show the task tree for list <id>
move task <id> under parent <parentId>
mark task <id> completed

码头工人

docker build -t gtasks-mcp .
docker run -i \
  -e GOOGLE_CLIENT_ID=your_client_id \
  -e GOOGLE_CLIENT_SECRET=your_client_secret \
  -e GOOGLE_REFRESH_TOKEN=your_refresh_token \
  gtasks-mcp

发展

npm install
npm run build
npm start

身份验证/交互式登录:

npm run build
node dist/index.js auth

安全说明

  • 将刷新令牌视为密码
  • 更喜欢env变量或忽略的凭据文件——永远不要提交它们
  • 如果凭据泄漏,请进行轮换

贡献者

  • ArtyMcLabin --分页, taskListId 过滤, list_task_lists, list_with_tree, move,以及基于文件的身份验证(#1)
  • Zcaceres --原始Google Tasks MCP服务器
  • 阿维尼乔伊 --叉子维护,Smithery/npm包装

看 贡献者.md.

许可证

麻省理工学院