zcaceres/gtasks-mcp
Acerca de
Agent-friendly Google Tasks MCP server (stdio & 2025-11-25 Streamable HTTP) and local CLI for task lists, tasks, and subtasks
IA y aprendizaje automáticoWhat you can do
- Three form factors over one core: MCP stdio (gtasks-mcp), stateless MCP 2025-11-25 Streamable HTTP (gtasks-mcp --http), and a full local CLI (gtasks auth|lists|tasks with human-readable text or --json).
- Full Google Tasks API v1 coverage: 13 Terminology-aligned tools covering full Task List CRUD (@default delete-guarded), Task CRUD, search, clear, tasks_move (reordering, cross-list moves, and 1-level subtasks), server-side list filters (dueMin, dueMax, showAssigned, showDeleted), webViewLink, and assignmentInfo.
- Defense-in-depth Read-Only Mode: pass --read-only, set GTASKS_READ_ONLY=true, or log in with gtasks auth login --read-only (https://www.googleapis.com/auth/tasks.readonly) to hide mutating MCP tools and block all 8 mutations locally before any API call across MCP and CLI.
- Minimal dependency footprint: replaced googleapis and @google-cloud/local-auth with google-auth-library, Zod, native fetch, and @modelcontextprotocol/sdk 1.32+, clearing legacy Dependabot CVEs and fixing Windows/spaces-in-path credential bugs.
Crecimiento de estrellas medido
- in 24h
- +1
- in 7 days
- Recopilando historial
- in 15 days
- Recopilando historial
- in 1 month
- Recopilando historial
Cambios netos en períodos que se solapan, no totales diarios. Los datos no disponibles se dejan en blanco. Las estrellas indican interés, no calidad.
README.md
OriginalGoogle Tasks MCP

Manage Google Tasks lists, tasks, and subtasks 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) backed by a shared domain core and a minimal Google Tasks API v1 REST client—with safe scoped defaults, calendar due dates, 1-level subtasks, O(1) MCP Task Resources, and defense-in-depth read-only mode. Supports Node.js >= 22 LTS and Bun.
Docs: gtasks.zach.dev · LLM-friendly docs: gtasks.zach.dev/llms.txt
What's New & Breaking Changes in v2.0.0
Highlights
- Three form factors over one core: MCP
stdio(gtasks-mcp), stateless MCP2025-11-25Streamable HTTP (gtasks-mcp --http), and a full local CLI (gtasks auth|lists|taskswith human-readable text or--json). - Full Google Tasks API v1 coverage: 13 Terminology-aligned tools covering full Task List CRUD (
@defaultdelete-guarded), Task CRUD, search, clear,tasks_move(reordering, cross-list moves, and 1-level subtasks), server-side list filters (dueMin,dueMax,showAssigned,showDeleted),webViewLink, andassignmentInfo. - Defense-in-depth Read-Only Mode: pass
--read-only, setGTASKS_READ_ONLY=true, or log in withgtasks auth login --read-only(https://www.googleapis.com/auth/tasks.readonly) to hide mutating MCP tools and block all 8 mutations locally before any API call across MCP and CLI. - Minimal dependency footprint: replaced
googleapisand@google-cloud/local-authwithgoogle-auth-library, Zod, nativefetch, and@modelcontextprotocol/sdk1.32+, clearing legacy Dependabot CVEs and fixing Windows/spaces-in-path credential bugs. - Cross-vendor MCP
2025-11-25conformance: strictadditionalProperties: false, flat JSON Schemas, accuratereadOnlyHint/destructiveHint/idempotentHint/openWorldHintannotations, lazy auth on tool/resource calls, and O(1) Task Resources (gtasks:///lists/<taskListId>/tasks/<taskId>).
Breaking Changes
- Package & binary names: npm package is now
gtasks(replacing legacy@modelcontextprotocol/server-gtasks), shipping two binaries:gtasks(CLI) andgtasks-mcp(MCP server). - Aligned MCP tool names: legacy
list,search,create,update,delete,clearare replaced by 13 namespaced tools (tasklists_*andtasks_*). The unused legacyuriparameter on task updates is removed. - Scoped
tasks_list&tasks_searchdefaults: both now default to the@defaulttask list, hide completed tasks by default (includeCompleted: false), and cap pages atmaxResults: 20(passallLists: trueto scan every list). - MCP Resource URIs: changed from
gtasks:///<taskId>togtasks:///lists/<taskListId>/tasks/<taskId>with Resource Templategtasks:///lists/{taskListId}/tasks/{taskId}for O(1) reads, andresources/listomitsnextCursoron the final page (never returningnull). - Credential storage & auth lifecycle: keys and tokens now default to the OS user config directory (
~/.config/gtasks-mcp/on macOS/Linux,%APPDATA%\gtasks-mcp\on Windows) with0600permissions rather than the repo/package install directory. Authentication runs explicitly viagtasks auth login(never auto-launched on MCP startup). - Runtime floor: requires Node.js
>= 22LTS or Bun.
Setup & Authentication
1. Create Google OAuth 2.0 Desktop credentials
- Open Google Cloud Console and create or select a project.
- Enable the Google Tasks API.
- Configure the OAuth consent screen (adding your Google account as a Test User if External) and add scope
https://www.googleapis.com/auth/tasks(and/orhttps://www.googleapis.com/auth/tasks.readonlyfor read-only use). - Create an OAuth 2.0 Client ID of type Desktop app and download the JSON keys file.
- Save the keys file to your OS config directory (or point to it with
GTASKS_OAUTH_KEYS_PATH, or pass inlineGTASKS_CLIENT_ID+GTASKS_CLIENT_SECRET):- macOS / Linux:
~/.config/gtasks-mcp/gcp-oauth.keys.json(respects$XDG_CONFIG_HOME) - Windows:
%APPDATA%\gtasks-mcp\gcp-oauth.keys.json
- macOS / Linux:
2. Authenticate once via the CLI
npx gtasks auth login
This runs a local 127.0.0.1 loopback OAuth 2.0 flow with PKCE (S256) and CSRF state, writing credentials with 0600 permissions to ~/.config/gtasks-mcp/credentials.json (or GTASKS_CREDENTIALS_PATH).
# Headless / remote terminal (prints consent URL without auto-opening browser)
npx gtasks auth login --no-browser
# Least-privilege read-only OAuth scope (tasks.readonly)
npx gtasks auth login --read-only
# Inspect configuration, Access Mode, and token status (never prints secrets)
npx gtasks auth status
# Revoke token (best-effort) and remove local credentials
npx gtasks auth logout
Headless MCP servers (gtasks-mcp over stdio or --http) proactively refresh expired access tokens without clobbering your refresh_token, and never auto-launch a browser.
Installation
As an MCP server (stdio)
Add to your MCP client configuration (Claude Code, Claude Desktop, Gemini CLI, Cursor, etc.):
{
"mcpServers": {
"gtasks": {
"command": "npx",
"args": ["-y", "-p", "gtasks", "gtasks-mcp"]
}
}
}
Or with Claude Code:
claude mcp add gtasks -- npx -y -p gtasks gtasks-mcp
As a Streamable HTTP MCP server (2025-11-25)
Start the stateless Streamable HTTP server (defaults to 127.0.0.1:3000 on POST /mcp):
npx -y -p gtasks gtasks-mcp --http --host 127.0.0.1 --port 3000
| Flag | Default | Description |
|---|---|---|
--http |
(off — uses stdio) |
Enable stateless MCP 2025-11-25 Streamable HTTP transport on POST /mcp |
--host <addr> |
127.0.0.1 |
Bind address (requires --http) |
--port <n> |
3000 |
Listen port 1–65535 (requires --http) |
--read-only |
(off) | Hide mutating tools from tools/list and refuse all mutations locally |
Loopback listeners validate Host and Origin headers against loopback hosts (403 on mismatch to block DNS rebinding). Unknown paths (including legacy /sse) return 404, and non-POST methods on /mcp return 405 (Allow: POST). Non-loopback binds warn on stderr and honor GTASKS_ALLOWED_HOSTS / GTASKS_ALLOWED_ORIGINS.
Connect with MCP Inspector:
npx @modelcontextprotocol/inspector --url http://127.0.0.1:3000/mcp
As a local CLI (gtasks)
npm install -g gtasks
gtasks lists list
gtasks tasks list --all-lists
gtasks tasks create "Ship v2.0" --due 2026-06-01 --notes "Publish npm package"
gtasks tasks list --json
With Docker
docker build -t gtasks-mcp .
# stdio mode (mount your OS config dir read-write for token refresh persistence)
docker run --rm -i \
-v ~/.config/gtasks-mcp:/home/node/.config/gtasks-mcp \
gtasks-mcp
# Streamable HTTP mode (put behind an authenticating reverse proxy for non-loopback use)
docker run --rm -p 127.0.0.1:3000:3000 \
-v ~/.config/gtasks-mcp:/home/node/.config/gtasks-mcp \
-e GTASKS_ALLOWED_HOSTS=localhost:3000,127.0.0.1:3000 \
gtasks-mcp --http --host 0.0.0.0 --port 3000
MCP Tools (13)
All 13 tools conform to MCP 2025-11-25, enforce additionalProperties: false, carry accurate readOnlyHint/destructiveHint/idempotentHint/openWorldHint annotations, and return typed errors as isError: true.
Task Lists (5)
| Tool | Read-Only | Destructive | Description |
|---|---|---|---|
tasklists_list |
Yes | No | List task lists with pagination (maxResults 1–100, default 20; pageToken) |
tasklists_get |
Yes | No | Get details for a task list by taskListId (supports @default) |
tasklists_create |
No | No | Create a new task list (title 1–1,024 chars) |
tasklists_update |
No | No | Rename a task list (taskListId, title) |
tasklists_delete |
No | Yes | Delete a task list (@default is refused locally) |
Tasks (8)
| Tool | Read-Only | Destructive | Description |
|---|---|---|---|
tasks_list |
Yes | No | List tasks (@default by default, or taskListId, or allLists: true; active tasks by default with includeCompleted, showDeleted, showAssigned, dueMin/dueMax, completedMin/completedMax, updatedMin, maxResults, pageToken) |
tasks_get |
Yes | No | Get full details for a single task (taskId, optional taskListId), including webViewLink and assignmentInfo |
tasks_search |
Yes | No | Case-insensitive substring search across title and notes (query, optional taskListId or allLists, includeCompleted, maxResults; scans up to 20 pages / 2,000 tasks per list and appends a truncation note if more remain) |
tasks_create |
No | No | Create a task or subtask (title, optional taskListId, notes, calendar due YYYY-MM-DD, parent, previous) |
tasks_update |
No | No | Partial patch update (taskId, optional taskListId, title, notes, due, status; pass "" or null to clear notes/due; setting status: "needsAction" clears completed) |
tasks_move |
No | No | Reorder a task, nest under parent, position after previous, or move across lists via destinationTasklist |
tasks_delete |
No | Yes | Permanently delete a task (taskId, optional taskListId) |
tasks_clear |
No | Yes | Clear all completed tasks from a task list (optional taskListId, default @default) |
MCP Resources
- Resource URI:
gtasks:///lists/<taskListId>/tasks/<taskId> - Resource Template:
gtasks:///lists/{taskListId}/tasks/{taskId} resources/list: enumerates active tasks across all task lists (default page size20) using an opaque composite cursor and omitsnextCursoron the final page.resources/read: fetches the addressed task in O(1) with a single Google Tasks API call.
Read-Only Mode
Enable defense-in-depth read-only mode in any of three ways:
- Startup / CLI flag:
gtasks-mcp --read-only,gtasks-mcp --http --read-only, orgtasks tasks create "Foo" --read-only - Environment variable:
GTASKS_READ_ONLY=true(strict boolean:true/1/false/0; any other value fails fast) - Read-only OAuth scope:
gtasks auth login --read-onlyrequestshttps://www.googleapis.com/auth/tasks.readonlyonly; stored credentials withtasks.readonlyautomatically enforce read-only mode even ifGTASKS_READ_ONLYis unset.
How enforcement works:
- When
gtasks-mcpis started with--read-onlyorGTASKS_READ_ONLY=true,tools/listadvertises only the 5 read-only tools (tasklists_list,tasklists_get,tasks_list,tasks_get,tasks_search) plus MCP Resources (keepingtools/listindependent of disk credentials). - At execution time—under
--read-only,GTASKS_READ_ONLY=true, or storedtasks.readonly-only credentials—any of the 8 mutating operations across MCP (stdio/--http) and thegtasksCLI is refused locally before any Google Tasks API request is made.
CLI Usage (gtasks)
gtasks <command> [subcommand] [options]
| Command | Description |
|---|---|
auth login [--no-browser] [--read-only] [--json] |
Run loopback OAuth 2.0 login and persist 0600 credentials |
auth status [--read-only] [--json] |
Show OAuth config, effective Access Mode, and token expiry status |
auth logout [--json] |
Best-effort revoke token and remove local credentials |
lists list|get|create|update|delete |
Manage Google Task Lists (--max-results, --page-token, --read-only, --json) |
tasks list|get|search|create|update|move|delete|clear |
Manage Tasks & subtasks (--list, --all-lists, --include-completed, --due, --notes, --clear-notes, --clear-due, --parent, --previous, --destination-list, --read-only, --json) |
All errors are redacted and written to stderr with exit code 1.
Environment Variables
| Variable | Description |
|---|---|
GTASKS_CLIENT_ID & GTASKS_CLIENT_SECRET |
Inline Google OAuth 2.0 Desktop client credentials (highest precedence; both must be non-empty if either is set) |
GTASKS_OAUTH_KEYS_PATH |
Explicit path to gcp-oauth.keys.json (fails explicitly if missing or malformed; overrides OS config dir) |
GTASKS_CREDENTIALS_PATH |
Explicit path to stored OAuth credentials.json (overrides OS config dir) |
GTASKS_READ_ONLY |
Strict boolean (true/1/false/0) enabling read-only mode; fails fast on invalid values |
GTASKS_ALLOWED_HOSTS |
Comma-separated allowed Host values for non-loopback --http deployments |
GTASKS_ALLOWED_ORIGINS |
Comma-separated allowed Origin values for non-loopback --http deployments |
GTASKS_API_BASE_URL |
Optional Google Tasks API base URL override (restricted to https:// or loopback http://127.0.0.1 / http://localhost for offline replay testing) |
Security & Reliability
- Credential Hygiene: Stored credentials are written atomically with owner-only
0600permissions (in0700parent dirs), token refresh merges onto existing credentials without clobberingrefresh_token, and all tokens/client secrets/bearer headers are redacted from errors, CLI output, and MCP responses. - No Surprises on Startup: Headless MCP servers never open a browser and keep
stdiostdoutstrictly JSON-RPC clean. - Local Safety Guards:
@defaulttask list deletion is blocked locally, read-only mode refuses all 8 mutations locally before calling the API, and Streamable HTTP blocks DNS-rebindingHost/Originmismatches with403. - Predictable Network Calls: Direct single-attempt REST v1 calls over native
fetchwith a30stimeout and strict Zod response validation.
Development
bun install
bun run lint # Biome lint & formatting check
bun run typecheck # TypeScript typecheck
bun run build # Build dist/index.js and dist/cli.js
bun test # Unit, integration, MCP conformance & scenario tests
bun run harness # Interactive DD harness (type help)
bun run harness run scenarios # Replay all DD harness scenarios
bun run verify:replay # 3-form-factor offline replay against built dist/ binaries
bun run verify:live # On-demand live Google Tasks check (uses & deletes a temp list)
More MCP & CLI Projects
- fetch-mcp — SSRF-hardened MCP server and CLI for fetching public web pages and YouTube transcripts.
- markdownify-mcp — Convert PDFs, Office docs, images, audio, web pages, and Git repositories into clean Markdown over MCP.
- spotify-cli — Control Spotify playback, search tracks, and manage playlists from your AI agent or terminal.
- builtwith-mcp — Query website technology stacks via BuiltWith over MCP or the CLI.
License
This project is licensed under the MIT License.
Explorar proyectos relacionados
Cargando…