Skip to content

Commit 0798609

Browse files
mickey-mikeyclaude
andcommitted
fix: address PR taylorwilsdon#589 audit findings
SKILL.md: - Fix "every tool requires user_google_email" (generate_trigger_code doesn't) - Add start_google_auth to routing tables - Add missing reference file links for Forms, Tasks, Contacts, Chat, Apps Script, Search - Move import_to_google_doc to Drive section (per tool_tiers.yaml) - Remove non-standard metadata frontmatter field - Rewrite setup: skill guides credential config into ~/.claude/settings.local.json - Add PYTHONIOENCODING=utf-8 for Windows - Add Windows cmd.exe quoting note for CLI mode plugin.json: - Add author field Reference files: - apps-script.md: fix header re generate_trigger_code - docs.md: add user_google_email to all 12 tables that were missing it - sheets.md: add missing include_notes parameter to read_sheet_values - contacts.md, forms.md, gmail.md, drive.md, tasks.md: fix page_token type to any Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 5443506 commit 0798609

10 files changed

Lines changed: 67 additions & 30 deletions

File tree

.claude-plugin/plugin.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,8 @@
22
"name": "google-workspace-mcp",
33
"description": "Complete Google Workspace integration — connects Gmail, Drive, Calendar, Docs, Sheets, Slides, Forms, Tasks, Contacts, Chat, and Apps Script via MCP with workflow guidance.",
44
"version": "1.14.3",
5+
"author": {
6+
"name": "taylorwilsdon"
7+
},
58
"skills": "./skills/"
69
}

skills/google-workspace/SKILL.md

Lines changed: 42 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ description: >
99
Also triggers for phrases like "check my email", "find a file", "schedule a meeting", "update the spreadsheet", "share a doc",
1010
"create a presentation", "add a task", "look up a contact", or any mention of Gmail, Google Drive, Google Docs, Google Sheets,
1111
Google Slides, Google Forms, Google Tasks, Google Contacts, Google Chat, or Apps Script.
12-
metadata:
13-
author: taylorwilsdon
1412
---
1513

1614
# Google Workspace — Tool Router
@@ -32,42 +30,48 @@ If no MCP tools are available, execute via bash:
3230
uvx workspace-mcp --cli <tool_name> --args '{"user_google_email": "USER_EMAIL", ...}'
3331
```
3432

33+
On Windows cmd.exe, use double quotes and escape inner quotes: `--args "{\"user_google_email\": \"USER_EMAIL\"}"`. PowerShell and Git Bash support single quotes as shown above.
34+
3535
Before calling a tool, read the relevant reference file for exact parameter names and types. Only use parameters documented there — do not invent parameters.
3636

3737
## First-Time Setup
3838

39+
If a tool call fails with a credential error, walk the user through this setup.
40+
3941
### 1. Create OAuth credentials
40-
At [Google Cloud Console](https://console.cloud.google.com/apis/credentials):
42+
Direct the user to [Google Cloud Console](https://console.cloud.google.com/apis/credentials):
4143
- Create OAuth 2.0 Client ID (Desktop application type)
42-
- Enable the Google APIs you need (Gmail, Drive, Calendar, etc.)
44+
- Enable the Google APIs they need (Gmail, Drive, Calendar, etc.)
45+
- Copy the Client ID and Client Secret
4346

44-
### 2. Configure credentials
45-
Credentials load in this priority order:
46-
1. Environment variables
47-
2. `.env` file in project root — **will not work with `uvx`** (uvx spawns a standalone process outside your repo). Either export env vars or point to the file directly.
48-
3. `client_secret.json` via `GOOGLE_CLIENT_SECRET_PATH`
49-
4. Default `client_secret.json` in project root
47+
### 2. Store credentials
48+
Ask the user for their Client ID and Client Secret, then write them to `~/.claude/settings.local.json` in the `env` block (this file is gitignored and never shared):
5049

51-
### 3. MCP config (recommended)
52-
Pass credentials in the MCP `env` block:
5350
```json
5451
{
55-
"command": "uvx",
56-
"args": ["workspace-mcp"],
5752
"env": {
58-
"GOOGLE_OAUTH_CLIENT_ID": "your-client-id",
59-
"GOOGLE_OAUTH_CLIENT_SECRET": "your-secret",
60-
"OAUTHLIB_INSECURE_TRANSPORT": "1"
53+
"GOOGLE_OAUTH_CLIENT_ID": "their-client-id",
54+
"GOOGLE_OAUTH_CLIENT_SECRET": "their-secret",
55+
"PYTHONIOENCODING": "utf-8"
6156
}
6257
}
6358
```
64-
`OAUTHLIB_INSECURE_TRANSPORT=1` is required for local (non-HTTPS) development.
6559

66-
### 4. Authenticate
60+
`PYTHONIOENCODING=utf-8` prevents encoding errors on Windows when tool output contains non-ASCII characters.
61+
62+
Read the existing `~/.claude/settings.local.json` first — merge into the existing `env` object, do not overwrite other settings. These env vars are inherited by all MCP servers and CLI processes that Claude Code spawns.
63+
64+
### 3. Authenticate
6765
- **MCP mode**: call `start_google_auth` to open the browser OAuth flow
6866
- **CLI mode**: run any tool — the first invocation opens the OAuth flow
6967
- Credentials are cached in `store_creds/` for future sessions
7068

69+
### Credential loading priority (for reference)
70+
1. Environment variables (including those from `~/.claude/settings.json` `env` block)
71+
2. `.env` file in project root — **will not work with `uvx`** (uvx runs outside the repo directory)
72+
3. `client_secret.json` via `GOOGLE_CLIENT_SECRET_PATH` env var
73+
4. Default `client_secret.json` in project root
74+
7175
## Server Options
7276

7377
These mirror the MCP server's own flags. See the [README](https://github.com/taylorwilsdon/google_workspace_mcp) for full details.
@@ -114,7 +118,7 @@ Other services: `readonly`, `full`.
114118

115119
## Universal Patterns
116120

117-
- Every tool requires `user_google_email`.
121+
- Almost every tool requires `user_google_email` (exception: `generate_trigger_code`).
118122
- Paginated tools support `page_size` and `page_token`. Check for `next_page_token` when completeness matters.
119123
- Consolidated "manage" tools use an `action` parameter for create/update/delete.
120124
- Prefer batch tools when working with multiple items.
@@ -157,6 +161,7 @@ For parameters: [references/gmail.md](references/gmail.md)
157161
| Check permissions | `get_drive_file_permissions` |
158162
| Get shareable link | `get_drive_shareable_link` |
159163
| Check public access | `check_drive_file_public_access` |
164+
| Import file to Google Doc | `import_to_google_doc` |
160165

161166
For parameters: [references/drive.md](references/drive.md)
162167

@@ -186,7 +191,6 @@ For parameters: [references/calendar.md](references/calendar.md)
186191
| Batch update (multiple ops) | `batch_update_doc` |
187192
| Headers/footers | `update_doc_headers_footers` |
188193
| Manage tabs | `insert_doc_tab` / `update_doc_tab` / `delete_doc_tab` |
189-
| Import file to Doc | `import_to_google_doc` |
190194
| Export to PDF | `export_doc_to_pdf` |
191195
| List docs in folder | `list_docs_in_folder` |
192196
| Search docs | `search_docs` |
@@ -231,6 +235,8 @@ For parameters: [references/slides.md](references/slides.md)
231235
| Get one response | `get_form_response` |
232236
| Publish settings | `set_publish_settings` |
233237

238+
For parameters: [references/forms.md](references/forms.md)
239+
234240
### Google Tasks
235241
| Task | Tool |
236242
|------|------|
@@ -241,6 +247,8 @@ For parameters: [references/slides.md](references/slides.md)
241247
| Get task | `get_task` |
242248
| Manage task (CRUD/move) | `manage_task` |
243249

250+
For parameters: [references/tasks.md](references/tasks.md)
251+
244252
### Contacts
245253
| Task | Tool |
246254
|------|------|
@@ -253,6 +261,8 @@ For parameters: [references/slides.md](references/slides.md)
253261
| Manage contact group | `manage_contact_group` |
254262
| List all contacts | `list_contacts` |
255263

264+
For parameters: [references/contacts.md](references/contacts.md)
265+
256266
### Google Chat
257267
| Task | Tool |
258268
|------|------|
@@ -263,6 +273,8 @@ For parameters: [references/slides.md](references/slides.md)
263273
| React to message | `create_reaction` |
264274
| Download attachment | `download_chat_attachment` |
265275

276+
For parameters: [references/chat.md](references/chat.md)
277+
266278
### Apps Script
267279
| Task | Tool |
268280
|------|------|
@@ -279,12 +291,21 @@ For parameters: [references/slides.md](references/slides.md)
279291
| Execution metrics | `get_script_metrics` |
280292
| Process history | `list_script_processes` |
281293

294+
For parameters: [references/apps-script.md](references/apps-script.md)
295+
282296
### Google Custom Search
283297
| Task | Tool |
284298
|------|------|
285299
| Web search | `search_custom` |
286300
| Get search engine info | `get_search_engine_info` |
287301

302+
For parameters: [references/search.md](references/search.md)
303+
304+
### Auth
305+
| Task | Tool |
306+
|------|------|
307+
| Start OAuth flow | `start_google_auth` |
308+
288309
## Common Workflows
289310

290311
### Reply to an email

skills/google-workspace/references/apps-script.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Apps Script Tools Reference
22

3-
MCP tools for Google Apps Script via the Google Workspace MCP server. All tools require `user_google_email` (string, required).
3+
MCP tools for Google Apps Script via the Google Workspace MCP server. All tools require `user_google_email` (string, required) except `generate_trigger_code`.
44

55
---
66

skills/google-workspace/references/contacts.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ List contacts for the authenticated user.
2222
|---|---|---|---|---|
2323
| user_google_email | string | yes | | |
2424
| page_size | integer | no | 100 | Max 1000 |
25-
| page_token | string | no | | For pagination |
25+
| page_token | any | no | | For pagination |
2626
| sort_order | string | no | | `LAST_MODIFIED_ASCENDING`, `LAST_MODIFIED_DESCENDING`, `FIRST_NAME_ASCENDING`, or `LAST_NAME_ASCENDING` |
2727

2828
### get_contact
@@ -71,7 +71,7 @@ List contact groups (labels).
7171
|---|---|---|---|---|
7272
| user_google_email | string | yes | | |
7373
| page_size | integer | no | 100 | Max 1000 |
74-
| page_token | string | no | | For pagination |
74+
| page_token | any | no | | For pagination |
7575

7676
### get_contact_group
7777
Get details of a specific contact group including its members.

skills/google-workspace/references/docs.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ Retrieves plain text content of a Google Doc or a Drive file (.docx, etc.). Nati
2323

2424
| Parameter | Type | Required | Default | Notes |
2525
|-----------|------|----------|---------|-------|
26+
| user_google_email | string | yes | | |
2627
| document_id | string | yes | | Doc ID or file ID |
2728

2829
### search_docs
@@ -31,6 +32,7 @@ Searches for Google Docs by name using Drive API (mimeType filter).
3132

3233
| Parameter | Type | Required | Default | Notes |
3334
|-----------|------|----------|---------|-------|
35+
| user_google_email | string | yes | | |
3436
| query | string | yes | | Search query for doc names |
3537
| page_size | integer | no | 10 | Max results to return |
3638

@@ -40,6 +42,7 @@ Lists Google Docs within a specific Drive folder.
4042

4143
| Parameter | Type | Required | Default | Notes |
4244
|-----------|------|----------|---------|-------|
45+
| user_google_email | string | yes | | |
4346
| folder_id | string | no | root | Drive folder ID |
4447
| page_size | integer | no | 100 | Max items to return |
4548

@@ -53,6 +56,7 @@ Creates a new Google Doc with optional initial content.
5356

5457
| Parameter | Type | Required | Default | Notes |
5558
|-----------|------|----------|---------|-------|
59+
| user_google_email | string | yes | | |
5660
| title | string | yes | | Document title |
5761
| content | string | no | (empty) | Initial text content |
5862

@@ -62,6 +66,7 @@ Imports a file (Markdown, DOCX, TXT, HTML, RTF, ODT) into Google Docs format wit
6266

6367
| Parameter | Type | Required | Default | Notes |
6468
|-----------|------|----------|---------|-------|
69+
| user_google_email | string | yes | | |
6570
| file_name | string | yes | | Name for the new Google Doc |
6671
| content | string | no | | Text content for MD, TXT, HTML |
6772
| file_path | string | no | | Local file path for DOCX, ODT, etc. Supports `file://` URLs |
@@ -193,6 +198,7 @@ Export a Google Doc to PDF and save it to Drive.
193198

194199
| Parameter | Type | Required | Default | Notes |
195200
|-----------|------|----------|---------|-------|
201+
| user_google_email | string | yes | | |
196202
| document_id | string | yes | | |
197203
| pdf_filename | string | no | (original name + "_PDF") | PDF file name |
198204
| folder_id | string | no | (root) | Destination folder ID |
@@ -207,6 +213,7 @@ Add a new tab to a document.
207213

208214
| Parameter | Type | Required | Default | Notes |
209215
|-----------|------|----------|---------|-------|
216+
| user_google_email | string | yes | | |
210217
| document_id | string | yes | | |
211218
| title | string | yes | | Tab title |
212219
| index | integer | yes | | 0-based position among sibling tabs |
@@ -218,6 +225,7 @@ Rename an existing tab.
218225

219226
| Parameter | Type | Required | Default | Notes |
220227
|-----------|------|----------|---------|-------|
228+
| user_google_email | string | yes | | |
221229
| document_id | string | yes | | |
222230
| tab_id | string | yes | | Get from `inspect_doc_structure` |
223231
| title | string | yes | | New tab title |
@@ -228,6 +236,7 @@ Delete a tab by ID.
228236

229237
| Parameter | Type | Required | Default | Notes |
230238
|-----------|------|----------|---------|-------|
239+
| user_google_email | string | yes | | |
231240
| document_id | string | yes | | |
232241
| tab_id | string | yes | | Get from `inspect_doc_structure` |
233242

@@ -241,6 +250,7 @@ List all comments on a document.
241250

242251
| Parameter | Type | Required | Default | Notes |
243252
|-----------|------|----------|---------|-------|
253+
| user_google_email | string | yes | | |
244254
| document_id | string | yes | | |
245255

246256
### manage_document_comment
@@ -249,6 +259,7 @@ Create, reply to, or resolve a comment.
249259

250260
| Parameter | Type | Required | Default | Notes |
251261
|-----------|------|----------|---------|-------|
262+
| user_google_email | string | yes | | |
252263
| document_id | string | yes | | |
253264
| action | string | yes | | `create`, `reply`, or `resolve` |
254265
| comment_content | string | no | | Required for `create` and `reply` |
@@ -281,6 +292,7 @@ Detailed view of a single table's layout: dimensions, cell positions, current co
281292

282293
| Parameter | Type | Required | Default | Notes |
283294
|-----------|------|----------|---------|-------|
295+
| user_google_email | string | yes | | |
284296
| document_id | string | yes | | |
285297
| table_index | integer | no | 0 | 0-based table number (0 = first table) |
286298

skills/google-workspace/references/drive.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Search for files and folders across My Drive and shared drives.
1414
|-----------|------|----------|---------|-------|
1515
| query | string | yes | | Google Drive search query (see operators below) |
1616
| page_size | integer | no | 10 | Max results to return |
17-
| page_token | string | no | | Token from previous response for pagination |
17+
| page_token | any | no | | Token from previous response for pagination |
1818
| drive_id | string | no | | Shared drive ID to scope search |
1919
| include_items_from_all_drives | boolean | no | true | Include shared drive items when no drive_id set |
2020
| corpora | string | no | | `user`, `domain`, `drive`, or `allDrives`. Defaults to `drive` when drive_id is set. Prefer `user` or `drive` over `allDrives` |
@@ -29,7 +29,7 @@ List files and folders in a specific folder.
2929
|-----------|------|----------|---------|-------|
3030
| folder_id | string | no | root | Folder ID. Use shared drive ID for its root |
3131
| page_size | integer | no | 100 | Max items to return |
32-
| page_token | string | no | | Pagination token |
32+
| page_token | any | no | | Pagination token |
3333
| drive_id | string | no | | Shared drive ID to scope listing |
3434
| include_items_from_all_drives | boolean | no | true | Include shared drive items when no drive_id set |
3535
| corpora | string | no | | `user`, `drive`, `allDrives` |

skills/google-workspace/references/forms.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ List responses submitted to a form.
2222
| form_id | string | yes | | |
2323
| user_google_email | string | yes | | |
2424
| page_size | integer | no | 10 | Max responses per page |
25-
| page_token | string | no | | From previous response for pagination |
25+
| page_token | any | no | | From previous response for pagination |
2626

2727
### get_form_response
2828
Get a single response from a form.

skills/google-workspace/references/gmail.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Search messages by query. Returns message IDs, thread IDs, and Gmail web links.
1414
| query | string | yes | | Gmail search query (see operators below) |
1515
| user_google_email | string | yes | | |
1616
| page_size | integer | no | 10 | Max results per page |
17-
| page_token | string | no | | From previous response's `next_page_token` |
17+
| page_token | any | no | | From previous response's `next_page_token` |
1818

1919
### get_gmail_message_content
2020
Get full content of a single message (subject, sender, recipients, date, Message-ID, body).

skills/google-workspace/references/sheets.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ Read values from a range in a spreadsheet.
3838
| spreadsheet_id | string | yes | | |
3939
| range_name | string | no | A1:Z1000 | A1 notation, e.g. `Sheet1!A1:D10` |
4040
| include_hyperlinks | boolean | no | false | Fetch hyperlink metadata (slower) |
41+
| include_notes | boolean | no | false | Fetch cell notes (slower) |
4142

4243
### modify_sheet_values
4344

skills/google-workspace/references/tasks.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ List all task lists for the user.
1313
|---|---|---|---|---|
1414
| user_google_email | string | yes | | |
1515
| max_results | integer | no | 1000 | Max 1000 |
16-
| page_token | string | no | | For pagination |
16+
| page_token | any | no | | For pagination |
1717

1818
### get_task_list
1919
Get details of a specific task list.
@@ -45,7 +45,7 @@ List tasks in a specific task list.
4545
| task_list_id | string | yes | | |
4646
| user_google_email | string | yes | | |
4747
| max_results | integer | no | 20 | Max 10000 |
48-
| page_token | string | no | | For pagination |
48+
| page_token | any | no | | For pagination |
4949
| show_completed | boolean | no | true | Include completed tasks |
5050
| show_deleted | boolean | no | false | Include deleted tasks |
5151
| show_hidden | boolean | no | false | Include hidden tasks; must be true to see tasks completed in first-party clients |

0 commit comments

Comments
 (0)