Manage Google Tasks from AI agents or your terminal.
A lightweight, agent-friendly MCP server (gtasks-mcp, supporting stdio and
2025-11-25 Streamable HTTP) and local CLI (gtasks) for Google Task Lists, tasks,
and 1-level subtasks—with safe scoped defaults, O(1) Task Resources, and defense-in-depth read-only mode.
Supports Node.js >= 22 LTS and Bun.
Quickstart & Auth
Save your Google Cloud Desktop OAuth keys JSON to ~/.config/gtasks-mcp/gcp-oauth.keys.json
(or %APPDATA%\gtasks-mcp\gcp-oauth.keys.json on Windows), log in once with
gtasks auth login, and connect any MCP client or run the local CLI.
# Authenticate once via local 127.0.0.1 loopback OAuth 2.0 (PKCE S256, 0600 credentials)
npx gtasks auth login
# Optional: print URL without opening a browser, or request least-privilege read-only scope
npx gtasks auth login --no-browser
npx gtasks auth login --read-only
{
"mcpServers": {
"gtasks": {
"command": "npx",
"args": ["-y", "-p", "gtasks", "gtasks-mcp"]
}
}
}
# Start stateless MCP 2025-11-25 Streamable HTTP on http://127.0.0.1:3000/mcp
npx -y -p gtasks gtasks-mcp --http --host 127.0.0.1 --port 3000
# Install globally or run via npx
npm install -g gtasks
gtasks lists list
gtasks tasks create "Ship v2.0" --due 2026-06-01 --notes "Publish npm package"
gtasks tasks list --all-lists --json
MCP Clients & Docker
Works out of the box with Claude Code, Claude Desktop, Gemini CLI, OpenAI, Cursor, MCP Inspector, and slim Node 22 containers.
# Register Google Tasks MCP in Claude Code
claude mcp add gtasks -- npx -y -p gtasks gtasks-mcp
{
"mcpServers": {
"gtasks-readonly": {
"command": "npx",
"args": ["-y", "-p", "gtasks", "gtasks-mcp", "--read-only"],
"env": {
"GTASKS_READ_ONLY": "true"
}
}
}
}
# Terminal 1 — launch Streamable HTTP server
npx -y -p gtasks gtasks-mcp --http --port 3000
# Terminal 2 — connect with MCP Inspector
npx @modelcontextprotocol/inspector --url http://127.0.0.1:3000/mcp
docker build -t gtasks-mcp .
# stdio mode (mount your config dir read-write for token refresh)
docker run --rm -i \
-v ~/.config/gtasks-mcp:/home/node/.config/gtasks-mcp \
gtasks-mcp
MCP Tools & Resources
Every tool conforms to MCP 2025-11-25 with strict additionalProperties: false,
flat JSON Schemas for Claude/Gemini/OpenAI, accurate annotations, and lazy credential checks on call.
Task Lists (5 Tools)
maxResults 1–100, default 20; pageToken).
read-only
taskListId (supports @default).
read-only
title 1–1,024 chars).
mutation
taskListId, title).
mutation
taskListId (@default is refused locally).
destructive
Tasks & Subtasks (8 Tools)
@default (default maxResults: 20,
includeCompleted: false), or pass taskListId, allLists: true,
showAssigned, showDeleted, and dueMin/dueMax.
read-only
taskId, optional taskListId), including
webViewLink and assignmentInfo.
read-only
title and notes (scoped to
@default by default; opt-in allLists: true and
includeCompleted: true; 20-page / 2,000-task per-list scan cap with truncation note).
read-only
YYYY-MM-DD, zero timezone drift),
notes, parent, and previous.
mutation
title, notes, due, status).
Pass "" or null to clear notes/due; setting
status: "needsAction" clears completed.
mutation
parent, place after previous, or move across lists
via destinationTasklist.
mutation
taskId, optional taskListId).
destructive
taskListId, default @default).
destructive
MCP Task Resources
gtasks:///lists/{taskListId}/tasks/{taskId} for O(1) single-call resources/read.
O(1) read
nextCursor on the final page.
paginated
Local CLI
Run the exact same domain core from your shell or scripts via gtasks. Every operational command
prints clean text by default, supports --json for machine-readable JSON on stdout,
and writes redacted errors to stderr with exit code 1.
login [--no-browser] [--read-only], status [--read-only], and logout.
OAuth 2.0
list, get, create, update, and delete.
5 commands
list, get, search, create, update,
move, delete, and clear.
8 commands
lists/tasks call.
global flags
# Check auth status & active Access Mode
gtasks auth status
# List active tasks across all lists as JSON
gtasks tasks list --all-lists --json
# Create a task with calendar due date, then add a subtask
gtasks tasks create "Launch v2" --due 2026-06-01 --notes "Check npm + GitHub Pages"
gtasks tasks create "Smoke test Docker" --parent <taskId>
# Clear optional fields or move a task to another list
gtasks tasks update <taskId> --clear-due --status completed
gtasks tasks move <taskId> --destination-list <listId>
Streamable HTTP
Launch gtasks-mcp --http to serve stateless MCP 2025-11-25 Streamable HTTP on
POST /mcp. Loopback listeners validate both Host and Origin headers
(403 on mismatch). Unknown paths (including legacy /sse) return 404,
and non-POST methods return 405 with Allow: POST.
stdio.
default: off
--http). Non-loopback binds warn on stderr.
127.0.0.1
1–65535 (requires --http).
3000
Host values for non-loopback deployments behind a proxy.
non-loopback
Origin allowlist for browser clients on non-loopback binds.
non-loopback
Read-Only Mode
Give AI agents safe read-only access to your tasks without risking accidental edits or deletions. Read-only mode layers least-privilege OAuth scopes, MCP tool hiding, and local pre-flight refusal across all three form factors.
gtasks-mcp (stdio & --http) and gtasks auth login|status, lists, and tasks.
CLI & MCP
true/1/false/0); any invalid value fails fast.
env var
gtasks auth login --read-only requests only tasks.readonly; stored read-only
tokens keep Access Mode read-only automatically.
OAuth scope
tools/list when started with --read-only
or GTASKS_READ_ONLY=true, and blocks every mutation locally whenever effective Access Mode
is read-only (including tasks.readonly credentials).
Invariant I1
Security Model & Env Vars
Least privilege, strict redaction, zero surprises.
Credentials stay in owner-only 0600 files outside the package directory, headless MCP runs
never open a browser, tokens are redacted everywhere, and destructive edge cases are guarded locally.
gcp-oauth.keys.json (no silent fallback if missing or invalid).
keys file
0600 OAuth credentials (default: OS config dir).
0600 tokens
I6).
redacted
refresh_token (I2).
non-clobber
@default are refused locally before hitting Google Tasks API (I4).
guarded
v2.0 Migration Guide
Version 2.0.0 is a ground-up breaking rewrite replacing legacy
@modelcontextprotocol/server-gtasks with a minimal dependency tree, clean tool names, and full
Google Tasks API v1 coverage.
gtasks shipping gtasks (CLI) and gtasks-mcp (MCP).
renamed
list/search/create/update/delete/clear
replaced by tasklists_* and tasks_*; unused uri param removed.
breaking
tasks_list and tasks_search default to @default,
includeCompleted: false, and maxResults: 20 (opt in via allLists: true).
safer
gtasks:///<taskId> to gtasks:///lists/<taskListId>/tasks/<taskId>.
O(1)
gcp-oauth.keys.json to ~/.config/gtasks-mcp/ (or set GTASKS_OAUTH_KEYS_PATH) and run gtasks auth login.
Node 22+
More Projects
Other MCP servers and agent-friendly command-line tools I build and maintain.