Skip to content

feat: add list-tasklists tool and fix OAuth token refresh#20

Open
pybe wants to merge 2 commits into
zcaceres:mainfrom
pybe:feature/list-tasklists-and-token-refresh
Open

feat: add list-tasklists tool and fix OAuth token refresh#20
pybe wants to merge 2 commits into
zcaceres:mainfrom
pybe:feature/list-tasklists-and-token-refresh

Conversation

@pybe

@pybe pybe commented Jan 13, 2026

Copy link
Copy Markdown

Summary

This PR adds improvements and fixes to the gtasks MCP server:

1. New list-tasklists tool (Closes #3)

  • Returns all task lists with their IDs
  • Useful for discovering which taskListId to use with other operations

2. Fix OAuth token refresh

  • Initialize OAuth2 client with client_id and client_secret to enable automatic token refresh
  • Auto-save refreshed tokens to disk

3. Support GOOGLE_OAUTH_CREDENTIALS env var (Closes #18)

  • Allows specifying a shared location for OAuth credentials
  • Useful when sharing credentials with other Google MCP servers
  • Falls back to default relative path if not set

4. Fix Windows path resolution (Closes #7, Closes #11)

  • Use fileURLToPath() instead of URL.pathname
  • Fixes the C:\C:\... path issue on Windows

5. Fix due date format for create/update (Closes #2)

  • Normalize dates to RFC3339 format required by Google Tasks API
  • Supports: date-only (2026-01-15), datetime (2026-01-15T21:00:00), and pre-formatted RFC3339
  • Fixes "invalid argument" error when setting due dates on task creation

Test plan

  • list-tasklists returns all task lists with IDs
  • Token refresh works when access token expires
  • GOOGLE_OAUTH_CREDENTIALS env var works (tested with explicit path)
  • Path resolution works on Linux (Windows fix uses standard fileURLToPath approach)
  • Due dates work with various formats: date-only, datetime without TZ, RFC3339
  • No breaking changes to existing tools

🤖 Generated with Claude Code

pybe and others added 2 commits January 13, 2026 13:48
Adds two improvements:

1. New `list-tasklists` tool that returns all task lists with their IDs.
   This is useful for discovering which taskListId to use with other operations.

2. Fix OAuth token refresh by initializing OAuth2 client with client_id
   and client_secret from the OAuth keys file. Previously, tokens would
   expire and break because the client couldn't refresh them. Now tokens
   are automatically refreshed and saved to disk.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Additional fixes:

1. Support GOOGLE_OAUTH_CREDENTIALS env var (zcaceres#18)
   - Allows specifying a shared location for OAuth credentials
   - Falls back to default relative path if not set

2. Fix Windows path resolution (zcaceres#7, zcaceres#11)
   - Use fileURLToPath() instead of URL.pathname
   - Fixes C:\C:\... path issue on Windows

3. Fix due date format for create/update (zcaceres#2)
   - Normalize dates to RFC3339 format required by Google Tasks API
   - Supports: date-only (2026-01-15), datetime (2026-01-15T21:00:00),
     and already-formatted RFC3339 strings
   - Fixes "invalid argument" error when setting due dates

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant