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.

GTasks MCP logo — retro desktop checklist window and terminal illustration
01

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.

terminal
# 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
02

MCP Clients & Docker

Works out of the box with Claude Code, Claude Desktop, Gemini CLI, OpenAI, Cursor, MCP Inspector, and slim Node 22 containers.

terminal
# 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
03

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)

tasklists_list List task lists with pagination (maxResults 1–100, default 20; pageToken). read-only
tasklists_get Fetch a single task list by taskListId (supports @default). read-only
tasklists_create Create a new task list (title 1–1,024 chars). mutation
tasklists_update Rename an existing task list (taskListId, title). mutation
tasklists_delete Delete a task list by taskListId (@default is refused locally). destructive

Tasks & Subtasks (8 Tools)

tasks_list List active tasks in @default (default maxResults: 20, includeCompleted: false), or pass taskListId, allLists: true, showAssigned, showDeleted, and dueMin/dueMax. read-only
tasks_get Fetch full details for a task (taskId, optional taskListId), including webViewLink and assignmentInfo. read-only
tasks_search Case-insensitive search across 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
tasks_create Create a task or 1-level subtask with calendar due date (YYYY-MM-DD, zero timezone drift), notes, parent, and previous. mutation
tasks_update Partial patch update (title, notes, due, status). Pass "" or null to clear notes/due; setting status: "needsAction" clears completed. mutation
tasks_move Reorder a task, nest under parent, place after previous, or move across lists via destinationTasklist. mutation
tasks_delete Permanently delete a task (taskId, optional taskListId). destructive
tasks_clear Clear all completed tasks from a list (optional taskListId, default @default). destructive

MCP Task Resources

Resource Template gtasks:///lists/{taskListId}/tasks/{taskId} for O(1) single-call resources/read. O(1) read
resources/list Enumerates active tasks across all lists (20 per page) with an opaque composite cursor and omits nextCursor on the final page. paginated
04

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.

gtasks auth login [--no-browser] [--read-only], status [--read-only], and logout. OAuth 2.0
gtasks lists list, get, create, update, and delete. 5 commands
gtasks tasks list, get, search, create, update, move, delete, and clear. 8 commands
--json / --read-only Output structured JSON or enforce local read-only refusal on any lists/tasks call. global flags
CLI examples
# 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>
05

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.

--http Enable stateless Streamable HTTP mode instead of default stdio. default: off
--host <addr> Bind address (requires --http). Non-loopback binds warn on stderr. 127.0.0.1
--port <n> Listen port 1–65535 (requires --http). 3000
GTASKS_ALLOWED_HOSTS Comma-separated allowed Host values for non-loopback deployments behind a proxy. non-loopback
GTASKS_ALLOWED_ORIGINS Comma-separated allowed Origin allowlist for browser clients on non-loopback binds. non-loopback
06

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.

--read-only Accepted by gtasks-mcp (stdio & --http) and gtasks auth login|status, lists, and tasks. CLI & MCP
GTASKS_READ_ONLY Strict boolean (true/1/false/0); any invalid value fails fast. env var
tasks.readonly Scope gtasks auth login --read-only requests only tasks.readonly; stored read-only tokens keep Access Mode read-only automatically. OAuth scope
Local Pre-Flight Guard Hides all 8 mutating tools from MCP 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
07

Security Model & Env Vars

SECURITY MODEL

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.

Read Invariants ↗
GTASKS_CLIENT_ID / SECRET Inline OAuth Desktop credentials (top precedence; fails explicitly if only one is set). inline auth
GTASKS_OAUTH_KEYS_PATH Explicit path to gcp-oauth.keys.json (no silent fallback if missing or invalid). keys file
GTASKS_CREDENTIALS_PATH Explicit path for stored 0600 OAuth credentials (default: OS config dir). 0600 tokens
Secret Redaction Client secrets, access/refresh tokens, and Bearer tokens are always redacted from errors and output (I6). redacted
Refresh Safety Proactive refresh within 60s of expiry merges onto stored credentials without clobbering refresh_token (I2). non-clobber
@default Guard Attempts to delete @default are refused locally before hitting Google Tasks API (I4). guarded
08

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.

Package & Binaries Published on npm as gtasks shipping gtasks (CLI) and gtasks-mcp (MCP). renamed
13 Namespaced Tools list/search/create/update/delete/clear replaced by tasklists_* and tasks_*; unused uri param removed. breaking
Scoped Defaults tasks_list and tasks_search default to @default, includeCompleted: false, and maxResults: 20 (opt in via allLists: true). safer
O(1) Resource URIs Changed from gtasks:///<taskId> to gtasks:///lists/<taskListId>/tasks/<taskId>. O(1)
OS Config Directory Move gcp-oauth.keys.json to ~/.config/gtasks-mcp/ (or set GTASKS_OAUTH_KEYS_PATH) and run gtasks auth login. Node 22+
09

More Projects

Other MCP servers and agent-friendly command-line tools I build and maintain.