Skip to main content
Glama

Google Tasks MCP

一个 MCP 服务器,允许 AI 代理读取和管理用户的 Google Tasks。它使用 Google 官方的 Tasks API、OAuth 2.0 桌面应用凭据,以及基于 stdio 的 MCP TypeScript SDK。

功能

  • 列出、查看、创建、重命名和删除任务列表

  • 使用 API 分页列出和筛选任务

  • 创建、编辑、完成、重新打开、移动、重新排序和删除任务

  • 使用 parentprevious 创建和移动子任务

  • 清除已完成的任务

  • MCP 安全注释以及对破坏性操作的明确确认

  • OAuth 刷新令牌存储在仓库之外,并具有仅所有者权限

要求

  • Node.js 20 或更高版本

  • 一个 Google 账户

  • 一个启用了 Google Tasks API 的 Google Cloud 项目

1. 配置 Google Cloud

  1. 打开 Google Cloud Console

  2. 创建或选择一个项目。

  3. APIs & Services → Library 下启用 Google Tasks API

  4. 配置 OAuth 同意屏幕。

  5. APIs & Services → Credentials 下,创建一个 OAuth 客户端 ID,应用程序类型为 Desktop app

  6. 将 OAuth 桌面客户端 JSON 下载为 client_secret.json,并将其保护在此仓库之外。

2. 安装、构建和授权

npm install
npm run build
npm run auth -- --client-secret /secure/google/client_secret.json

auth 命令仅接受包含顶层 installed 对象的 Google OAuth 桌面客户端 JSON。它会打开浏览器同意流程,并将 Tasks 刷新令牌保存到:

~/.config/google-tasks-mcp/token.json

需要时覆盖生成的令牌位置:

GOOGLE_TOKEN_FILE=/secure/google/tasks-token.json \
npm run auth -- --client-secret /secure/google/client_secret.json

对于已安装的包,运行:

google-tasks-mcp-auth --client-secret /secure/google/client_secret.json

服务器请求完整的 https://www.googleapis.com/auth/tasks 范围,因为它同时提供读和写操作。后续的 MCP 服务器运行会使用存储的令牌并自动刷新访问权限;仅在授权或重新授权项目时再次提供 client_secret.json。切勿提交任一 JSON 文件。

3. 连接 MCP 主机

直接使用此检出中的构建服务器。将路径替换为您机器上的绝对路径。

Codex (~/.codex/config.toml)

[mcp_servers.google_tasks]
command = "node"
args = ["/absolute/path/google-task-mcp/dist/index.js"]

[mcp_servers.google_tasks.env]
GOOGLE_TOKEN_FILE = "/Users/you/.config/google-tasks-mcp/token.json"

使用 JSON 配置的主机

{
  "mcpServers": {
    "google_tasks": {
      "command": "node",
      "args": ["/absolute/path/google-task-mcp/dist/index.js"],
      "env": {
        "GOOGLE_TOKEN_FILE": "/Users/you/.config/google-tasks-mcp/token.json"
      }
    }
  }
}

更改配置后重启 MCP 主机。

可用工具

Tool

Purpose

list_task_lists

列出任务列表

get_task_list

获取一个任务列表

create_task_list

创建一个任务列表

update_task_list

重命名一个任务列表

delete_task_list

删除一个任务列表;需要 confirm: true

list_tasks

使用分页列出/筛选任务

get_task

获取一个任务

create_task

创建一个任务或子任务

update_task

修补标题、备注、截止日期或状态

complete_task

将任务标记为已完成

reopen_task

将任务标记为需要操作

move_task

重新排序、重新设置父级或将任务移动到另一个列表

delete_task

删除一个任务;需要 confirm: true

clear_completed_tasks

清除已完成的任务;需要 confirm: true

Google Tasks 仅存储截止时间戳的日期部分。通过 API 发送的当天时间会被丢弃。任务标题限制为 1,024 个字符,备注限制为 8,192 个字符。

使用 MCP Inspector 进行测试

npm run build
npm run inspect

stdio 协议仅使用 stdout。因此,运行时诊断信息会写入 stderr。

打包以进行分发

创建可安装的 npm tarball:

npm pack

发布包后,主机可以使用以下命令启动它:

{
  "command": "npx",
  "args": ["-y", "google-tasks-mcp@0.1.0"],
  "env": {
    "GOOGLE_TOKEN_FILE": "/secure/google/tasks-token.json"
  }
}

对于单用户单工作站,stdio 加本地令牌是最简单、最安全的部署方式。对于多用户或托管服务,请使用 MCP Streamable HTTP,并实现每用户 OAuth 会话和加密的服务器端令牌存储;不要在用户之间共享刷新令牌。

参考

-
license - not tested
Not graded
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

  • Calendar API for AI agents: events, availability, Google/Microsoft setup, scheduling, and iCal.

  • Task manager your agent can fully operate: boards, tasks, sprints, roles, worklogs, day planner.

  • Manage your MakeMeBetter AI tasks, habits, and goals from your AI assistant.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/phamviet86/google-task-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server