@mindstone/mcp-server-google-workspace 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +147 -29
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,40 +1,101 @@
1
- # Google Workspace MCP Server
1
+ # @mindstone/mcp-server-google-workspace
2
2
 
3
- Google Workspace MCP server for Gmail, Calendar, Drive, Docs, Sheets, Slides, Contacts, Comments, and account diagnostics. Google Tasks and Forms tools are available when `ENABLE_GOOGLE_TASKS_FORMS=true`.
3
+ [![License: FSL-1.1-MIT](https://img.shields.io/badge/License-FSL--1.1--MIT-blue.svg)](./LICENSE)
4
4
 
5
- Originally based on [aaronsb/google-workspace-mcp](https://github.com/aaronsb/google-workspace-mcp).
5
+ Google Workspace MCP server — Gmail, Calendar, Drive, Docs, Sheets, Slides, Contacts, Comments, and account diagnostics, with optional Tasks and Forms behind a feature flag.
6
6
 
7
- ## Installation
7
+ *Multi-account Google Workspace MCP. Host-orchestrated OAuth (the connector neither runs a callback server nor mints OAuth URLs), atomic per-account credential writes, and a structured `auth_required` handoff so the host drives the sign-in flow rather than the server.*
8
+
9
+ ## Status
10
+
11
+ - **Version:** [0.1.1](./CHANGELOG.md) · npm: not yet published
12
+ - **Auth:** OAuth (host-orchestrated) ([`GOOGLE_CLIENT_SECRET`](./server.json))
13
+ - **Tools:** [94](./src/tools/definitions/) (Gmail, Calendar, Drive, Docs, Sheets, Slides, Contacts, Comments, Account; +10 gated Tasks/Forms behind `ENABLE_GOOGLE_TASKS_FORMS=true`)
14
+ - **Surface:** cloud-api
15
+ - **Hosts tested:** Mindstone Rebel
16
+ - **Machine-readable:** [`STATUS.json`](./STATUS.json)
17
+
18
+ This connector is based on [aaronsb/google-workspace-mcp](https://github.com/aaronsb/google-workspace-mcp) and credited under `package.json#attribution`.
19
+
20
+ ## Why this exists
21
+
22
+ When we ported this in early 2026, Google had not published a first-party MCP server for the Workspace surface. The community options at the time each got parts of the job right — Aaron Brown's [aaronsb/google-workspace-mcp](https://github.com/aaronsb/google-workspace-mcp), which we used as the starting point, covered the breadth of Workspace APIs but ran its own browser-callback server during OAuth, which our host application already does. We forked it so that the MCP host can own the entire OAuth flow (the connector returns a structured `auth_required` response instead of running a callback server or computing OAuth URLs), per-account token files are written atomically with restrictive permissions and symlink rejection, and the connector goes through our own security review before each release. Google's [Workspace MCP](https://github.com/googleworkspace/mcp) has since shipped; we continue to maintain this one because it integrates with our host's credential-file layout, host-orchestrated OAuth handoff, and recovery-guidance contract.
23
+
24
+ ## Example interaction
25
+
26
+ > "Find the email thread Alice sent yesterday about Q3 planning and reply with 'thanks, will read tonight'."
27
+
28
+ Tools the host calls:
29
+ 1. `search_workspace_emails` — searches Gmail for `from:alice@... subject:"Q3 planning" newer_than:1d`.
30
+ 2. `reply_to_workspace_email` — replies on the returned thread ID with the supplied body.
31
+
32
+ Response (trimmed):
33
+
34
+ ```json
35
+ {
36
+ "thread": {
37
+ "id": "1928a...",
38
+ "subject": "Q3 planning",
39
+ "from": "alice@example.com"
40
+ },
41
+ "reply": {
42
+ "id": "1928b...",
43
+ "labelIds": ["SENT"]
44
+ }
45
+ }
46
+ ```
47
+
48
+ ## Requirements
49
+
50
+ - Node.js 20+ (`engines.node` is `>=18`, but the build and tests are exercised on 20 and 22)
51
+ - npm
52
+ - A host application that performs the Google OAuth flow and writes `accounts.json` plus per-account token files for the connector to read.
53
+
54
+ ## Quick Start
55
+
56
+ ### Install & build
57
+
58
+ ```bash
59
+ cd <path-to-repo>/connectors/google-workspace
60
+ npm install
61
+ npm run build
62
+ ```
63
+
64
+ ### npx (once published)
8
65
 
9
66
  ```bash
10
67
  npx -y @mindstone/mcp-server-google-workspace
11
68
  ```
12
69
 
70
+ ### Local
71
+
72
+ ```bash
73
+ node dist/index.js
74
+ ```
75
+
13
76
  ## Configuration
14
77
 
15
- This connector uses host-orchestrated Google OAuth. The MCP host owns the browser redirect and writes `accounts.json` plus per-account token files for the connector to read.
78
+ This server is designed to run alongside a host application that performs the Google OAuth flow on its own. The host writes credentials to disk; this server reads them.
16
79
 
17
- Required environment variables:
80
+ ### Required environment variables
18
81
 
19
82
  | Variable | Description |
20
83
  | --- | --- |
21
- | `GOOGLE_CLIENT_ID` | Google OAuth client ID |
22
- | `GOOGLE_CLIENT_SECRET` | Google OAuth client secret |
23
- | `ACCOUNTS_PATH` | Path to `accounts.json` |
24
- | `CREDENTIALS_PATH` | Directory containing per-account token files |
84
+ | `GOOGLE_CLIENT_ID` | Google OAuth client ID. |
85
+ | `GOOGLE_CLIENT_SECRET` | Google OAuth client secret. |
86
+ | `ACCOUNTS_PATH` | Path to `accounts.json` (host-written index of authenticated accounts). |
87
+ | `CREDENTIALS_PATH` | Directory containing per-account Google OAuth token files. |
25
88
 
26
- Optional environment variables:
89
+ ### Optional environment variables
27
90
 
28
91
  | Variable | Default | Description |
29
92
  | --- | --- | --- |
30
- | `ENABLE_GOOGLE_TASKS_FORMS` | `false` | Set to `true` to register Google Tasks and Forms tools |
31
- | `GOOGLE_WORKSPACE_REQUEST_TIMEOUT_MS` | `60000` | Google API request timeout in milliseconds, max 300000 |
93
+ | `ENABLE_GOOGLE_TASKS_FORMS` | `false` | Set to `true` to register the additional Google Tasks and Forms tools. |
94
+ | `GOOGLE_WORKSPACE_REQUEST_TIMEOUT_MS` | `60000` | Outbound Google API request timeout in milliseconds (max `300000` = 5 min). |
32
95
 
33
96
  `GOOGLE_WORKSPACE_DISABLE_REFRESH=1` may be injected by a host to make the connector return `auth_required` instead of refreshing tokens. It is intentionally not a user-facing setup variable.
34
97
 
35
- The OSS package does not read `REBEL_WORKSPACE_PATH`. Local attachment staging uses the connector's own workspace helpers and host-provided paths.
36
-
37
- ## OAuth setup flow
98
+ ### Authentication flow
38
99
 
39
100
  `authenticate_workspace_account` returns a structured `auth_required` response:
40
101
 
@@ -49,23 +110,80 @@ The OSS package does not read `REBEL_WORKSPACE_PATH`. Local attachment staging u
49
110
  }
50
111
  ```
51
112
 
52
- The connector does not run a callback server and does not generate OAuth URLs. The MCP host computes the Google OAuth URL and handles the callback.
113
+ The connector does not run a callback server and does not generate OAuth URLs. The MCP host computes the Google OAuth URL and handles the callback. Once the host has written the account's token file under `CREDENTIALS_PATH/` and an entry into `ACCOUNTS_PATH`, the next tool call succeeds.
114
+
115
+ ## Host configuration examples
116
+
117
+ ### Claude Desktop / Cursor
118
+
119
+ ```json
120
+ {
121
+ "mcpServers": {
122
+ "GoogleWorkspace": {
123
+ "command": "npx",
124
+ "args": ["-y", "@mindstone/mcp-server-google-workspace"],
125
+ "env": {
126
+ "GOOGLE_CLIENT_ID": "your-google-oauth-client-id",
127
+ "GOOGLE_CLIENT_SECRET": "your-google-oauth-client-secret",
128
+ "ACCOUNTS_PATH": "/absolute/path/to/accounts.json",
129
+ "CREDENTIALS_PATH": "/absolute/path/to/credentials"
130
+ }
131
+ }
132
+ }
133
+ }
134
+ ```
53
135
 
54
- ## Available tools
136
+ Until the host has written `${ACCOUNTS_PATH}` and the matching per-account token file under `${CREDENTIALS_PATH}/`, every tool call returns the structured `auth_required` response (see the Authentication flow above).
55
137
 
56
- - Gmail: email search/thread/send/compose, drafts, labels, label filters, attachments, archive/trash/read-state helpers.
57
- - Calendar: current time, free-slot lookup, calendar/event listing, event creation, updates, responses, and deletion.
58
- - Drive: list/search/upload/download/copy/move/trash/untrash files, folders, permissions, and revisions.
59
- - Docs: read, create, append, replace, find/replace, tab listing, and batch updates.
60
- - Sheets: read/write ranges, create spreadsheets, sheet management, batch operations, find/replace, and formatting.
61
- - Slides: read, create, list/get slides, batch update, thumbnails, and ID extraction.
62
- - Contacts: list and search contacts.
63
- - Comments: list/create/reply/resolve/delete Drive comments.
64
- - Account: list, authenticate, and remove workspace accounts.
65
- - Tasks and Forms: registered only when `ENABLE_GOOGLE_TASKS_FORMS=true`.
138
+ ### Local development (no npm publish needed)
139
+
140
+ ```json
141
+ {
142
+ "mcpServers": {
143
+ "GoogleWorkspace": {
144
+ "command": "node",
145
+ "args": ["<path-to-repo>/connectors/google-workspace/dist/index.js"],
146
+ "env": {
147
+ "GOOGLE_CLIENT_ID": "your-google-oauth-client-id",
148
+ "GOOGLE_CLIENT_SECRET": "your-google-oauth-client-secret",
149
+ "ACCOUNTS_PATH": "/absolute/path/to/accounts.json",
150
+ "CREDENTIALS_PATH": "/absolute/path/to/credentials"
151
+ }
152
+ }
153
+ }
154
+ }
155
+ ```
156
+
157
+ ## Tools (94)
158
+
159
+ The full list lives under [`src/tools/definitions/`](./src/tools/definitions/) and is also surfaced in [`tools-inventory.json`](./tools-inventory.json). Grouped by domain:
160
+
161
+ | Domain | Tools | Notes |
162
+ | --- | --- | --- |
163
+ | Gmail | 21 | Email search/thread/send/compose, drafts, labels, label filters, attachments, archive/trash/read-state helpers. |
164
+ | Calendar | 9 | Current time, free-slot lookup, calendar/event listing, event creation, updates, responses, and deletion. |
165
+ | Drive | 13 | List/search/upload/download/copy/move/trash/untrash files, folders, permissions, and revisions. |
166
+ | Docs | 8 | Read, create, append, replace, find/replace, tab listing, and batch updates. |
167
+ | Sheets | 14 | Read/write ranges, create spreadsheets, sheet management, batch operations, find/replace, and formatting. |
168
+ | Slides | 7 | Read, create, list/get slides, batch update, thumbnails, and ID extraction. |
169
+ | Labels | 12 | Gmail label CRUD and filter rules. |
170
+ | Contacts | 2 | List and search contacts. |
171
+ | Comments | 5 | List/create/reply/resolve/delete Drive comments. |
172
+ | Account | 3 | List, authenticate, and remove workspace accounts. |
173
+ | Tasks (gated) | 6 | Registered only when `ENABLE_GOOGLE_TASKS_FORMS=true`. |
174
+ | Forms (gated) | 4 | Registered only when `ENABLE_GOOGLE_TASKS_FORMS=true`. |
175
+
176
+ The `## Status` block counts the 94 default-enabled tools; the additional 10 Tasks + Forms tools register when the feature flag is set.
66
177
 
67
178
  ## Security notes
68
179
 
69
180
  - Token and account writes use temp-file plus rename, restrictive permissions, fsync, and symlink rejection.
70
- - Token refresh can be disabled by the host so a single authority owns refresh-token rotation.
181
+ - Token refresh can be disabled by the host so a single authority owns refresh-token rotation (`GOOGLE_WORKSPACE_DISABLE_REFRESH=1`).
71
182
  - User-recoverable failures return host-neutral recovery guidance with `action_required` and `next_step` fields.
183
+ - The bundled callback server was removed; OAuth URLs and callback handling stay with the MCP host.
184
+ - Attachment filenames are sanitised to prevent path traversal via crafted `upload_workspace_attachment` filename arguments.
185
+ - `<untrusted-content>` envelopes cover Contacts, Calendar, Comments, Forms, Tasks, and JSON-return paths.
186
+
187
+ ## Licence
188
+
189
+ [FSL-1.1-MIT](./LICENSE) — Functional Source License, Version 1.1, with MIT future licence. The software converts to MIT licence on 2030-04-08.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mindstone/mcp-server-google-workspace",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "mcpName": "io.github.mindstone/mcp-server-google-workspace",
5
5
  "description": "Google Workspace MCP server for Gmail, Calendar, Drive, Docs, Sheets, Slides, Contacts, Tasks, and Forms",
6
6
  "license": "FSL-1.1-MIT",