google-mcp-suite 1.7.0 → 1.8.0

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.
package/ADOPTING.md ADDED
@@ -0,0 +1,423 @@
1
+ # Adopting google-mcp-suite
2
+
3
+ How an agent takes this suite into service as its client's Google surface, and
4
+ how it hands it back cleanly. Written to be followed literally, by a person or
5
+ by an agent; every step states what it changes, and [Decommission](#decommission)
6
+ removes exactly that set and nothing else.
7
+
8
+ If you are a human: paste the [hand-off prompt](#the-hand-off-prompt) into your
9
+ agent and supervise the two steps that are yours (a Google Cloud console visit
10
+ and a browser consent). If you are an agent: follow the playbook top to bottom,
11
+ verify each gate before moving on, and stop for the human where the playbook
12
+ says to.
13
+
14
+ ## Why adopt this instead of a built-in connector
15
+
16
+ Most agent clients ship, or will ship, some built-in Google integration. This
17
+ suite exists because a thin slice is not enough to actually run an account, and
18
+ the differences are concrete:
19
+
20
+ - **MCP and then some.** Each server exposes Google's curated MCP toolset
21
+ *plus* the broader REST method surface: [117 operations](./README.md#services)
22
+ across Gmail (33), Calendar (25), Drive (35), Sheets (15), and Docs (9). Each
23
+ service's `CAPABILITIES.md` enumerates its operations with provenance.
24
+ Built-in connectors document a narrower surface; as of this writing,
25
+ Anthropic documents its claude.ai Gmail connector as searching, reading,
26
+ and drafting, but not sending. This suite's Gmail server sends mail,
27
+ manages filters and labels, and downloads attachments.
28
+ - **Multiple accounts, in parallel, safely.** Identity is bound to a running
29
+ instance at startup via `GOOGLE_MCP_ACCOUNT`; no operation takes an account
30
+ parameter, so an agent commanding three accounts runs three instances and
31
+ cannot act on the wrong one. The claude.ai Google connector binds one
32
+ Google account at a time; switching accounts means disconnecting and
33
+ reconnecting it.
34
+ - **Self-describing to the wire.** Every operation carries all four MCP
35
+ `ToolAnnotations` hints (read-only, destructive, idempotent, open-world),
36
+ links its source Google reference page under
37
+ `_meta['com.simiancraft.google-mcp/source']`, validates input and output
38
+ schemas on every call, and each server serves usage instructions in its MCP
39
+ initialize result. An agent can audit what a tool does before calling it.
40
+ - **Verifiable by construction.** Test coverage is pinned at 100% in `bunfig.toml`,
41
+ every operation has a colocated stub-client unit test, and destructive
42
+ operations are live-verified pairwise against antecedents the test pass
43
+ itself created.
44
+
45
+ ## The contract
46
+
47
+ Adoption changes an enumerable set of things. Decommissioning removes that set.
48
+
49
+ 1. **One global npm package**: `google-mcp-suite` (bins `google-mcp-gmail`,
50
+ `google-mcp-calendar`, `google-mcp-sheets`, `google-mcp-docs`,
51
+ `google-mcp-drive`, and `google-mcp-doctor`).
52
+ 2. **Credentials outside any repo**: `~/.google-mcp/client_secret.json` plus
53
+ one token per account under `~/.google-mcp/tokens/`. Created by
54
+ provisioning and `doctor auth`, **not** removed by decommission (removing
55
+ credentials is a separate, destructive choice; see
56
+ [Removing credentials](#removing-credentials-optional-destructive)).
57
+ 3. **MCP server entries**, named `<service>-<account>` (`gmail-personal`,
58
+ `calendar-work`), one per service per account, registered at the client's
59
+ user/global scope.
60
+ 4. **Client-specific supersession settings** that stop the client preferring
61
+ its own first-party Google surface (Claude Code: three `permissions.deny`
62
+ strings; Codex CLI: `enabled = false` lines for any installed
63
+ OpenAI-curated Google plugin; Gemini CLI: the Workspace extension stays
64
+ uninstalled, or the human's recorded choice).
65
+ 5. **One marker-delimited block** in the client's instruction/memory file,
66
+ fenced by `<!-- google-mcp-suite:begin -->` and
67
+ `<!-- google-mcp-suite:end -->`, so it can be removed exactly.
68
+
69
+ Adoption is idempotent: every step checks before it writes, and running the
70
+ playbook twice changes nothing the second time.
71
+
72
+ ## Adopt
73
+
74
+ ### 0. Preflight
75
+
76
+ > **Cloud-sandboxed agents (Google Jules and similar): stop here; you are out
77
+ > of scope.** This playbook runs only on the machine where the human consents,
78
+ > and OAuth credentials must never enter a cloud VM. Step 4 has the detail.
79
+
80
+ ```sh
81
+ node --version # >= 22
82
+ npm --version
83
+ ```
84
+
85
+ Decide the account list with the human: each Google account gets a short label
86
+ (`personal`, `work`) or the bare email; the label becomes the
87
+ `GOOGLE_MCP_ACCOUNT` value and part of each server's name.
88
+
89
+ ### 1. Install
90
+
91
+ ```sh
92
+ npm install -g google-mcp-suite
93
+ google-mcp-doctor help # proves the bins are on PATH
94
+ ```
95
+
96
+ ### 2. Provision the OAuth app (human-in-the-loop, once)
97
+
98
+ The suite needs a Google Cloud OAuth client. This is roughly ten minutes of
99
+ console clicks, once, and it is the only part an agent cannot do alone.
100
+
101
+ ```sh
102
+ google-mcp-doctor scopes # the exact APIs + scopes to enable
103
+ ```
104
+
105
+ `doctor scopes` reads the shipped scope list, so it is authoritative for the
106
+ installed version; PROVISIONING.md's inline list may lag behind it.
107
+
108
+ Hand the human [PROVISIONING.md](./PROVISIONING.md) (it is written click by
109
+ click) and wait until `~/.google-mcp/client_secret.json` exists. `doctor`
110
+ reports which step is missing at any point:
111
+
112
+ ```sh
113
+ google-mcp-doctor check --no-probe
114
+ ```
115
+
116
+ ### 3. Authorize each account (human consents, once per account)
117
+
118
+ First write the roster, so each label from step 0 maps to the email it stands
119
+ for. The label is the token filename and the `GOOGLE_MCP_ACCOUNT` value; the
120
+ email is only the browser login hint:
121
+
122
+ ```sh
123
+ mkdir -p ~/.google-mcp
124
+ cat > ~/.google-mcp/accounts.json <<'EOF'
125
+ [
126
+ { "label": "personal", "email": "you@example.com" },
127
+ { "label": "work", "email": "you@company.com" }
128
+ ]
129
+ EOF
130
+ google-mcp-doctor auth --all # browser consent per roster account, writes each token
131
+ google-mcp-doctor # all accounts authorized and reachable?
132
+ ```
133
+
134
+ (Skipping the roster also works: `doctor auth you@example.com` makes the bare
135
+ email its own label, and the instance names in step 4 then carry the email.)
136
+
137
+ At each consent, the browser's account chooser must pick the email that
138
+ matches the label being authorized. The login hint preselects it, but a
139
+ mis-click binds the wrong mailbox to the label; step 7's identity check
140
+ catches that, so verify there rather than trusting the click.
141
+
142
+ Gate: `doctor` ends with its `All set:` line and no `Next:` action before you
143
+ continue; its live probes also catch APIs left un-enabled in step 2. One
144
+ expectation to set with the human: while the OAuth app is in Testing mode,
145
+ Google expires each refresh token 7 days after consent. `doctor status` shows
146
+ the countdown, and a bare `google-mcp-doctor auth` re-authorizes whatever is
147
+ due.
148
+
149
+ ### 4. Register the servers
150
+
151
+ Name every instance `<service>-<account>`. Register at **user scope** so the
152
+ servers are available in every project, not just the current directory.
153
+
154
+ Whatever the client, register only the service-and-account pairs the human
155
+ actually wants; the pattern is the contract, not the worked example below.
156
+ Adding a shipped service later is one more registration, not a new consent:
157
+ accounts authorize the full scope union once, so a token already serving
158
+ Gmail also serves Calendar the moment its instance is registered. (A future
159
+ service that adds new scopes forces re-consent of every account;
160
+ PROVISIONING.md explains why.)
161
+
162
+ **Claude Code:**
163
+
164
+ ```sh
165
+ claude mcp add --scope user gmail-personal --env GOOGLE_MCP_ACCOUNT=personal -- google-mcp-gmail
166
+ claude mcp add --scope user calendar-personal --env GOOGLE_MCP_ACCOUNT=personal -- google-mcp-calendar
167
+ claude mcp add --scope user gmail-work --env GOOGLE_MCP_ACCOUNT=work -- google-mcp-gmail
168
+ claude mcp add --scope user calendar-work --env GOOGLE_MCP_ACCOUNT=work -- google-mcp-calendar
169
+ claude mcp add --scope user drive-work --env GOOGLE_MCP_ACCOUNT=work -- google-mcp-drive
170
+ claude mcp add --scope user sheets-work --env GOOGLE_MCP_ACCOUNT=work -- google-mcp-sheets
171
+ claude mcp add --scope user docs-work --env GOOGLE_MCP_ACCOUNT=work -- google-mcp-docs
172
+ ```
173
+
174
+ User-scope entries land in `~/.claude.json`; `~/.claude/settings.json` holds
175
+ permissions, never servers, so do not hand-write server entries there. These
176
+ commands are not self-checking either: `claude mcp add` errors on an existing
177
+ name rather than overwriting, so on a re-run, check `claude mcp get <name>`
178
+ and add only what is missing.
179
+
180
+ **Any client that reads `mcpServers` JSON** (Cursor, Cline, and most others):
181
+
182
+ ```json
183
+ {
184
+ "mcpServers": {
185
+ "gmail-personal": {
186
+ "command": "google-mcp-gmail",
187
+ "env": { "GOOGLE_MCP_ACCOUNT": "personal" }
188
+ },
189
+ "calendar-work": {
190
+ "command": "google-mcp-calendar",
191
+ "env": { "GOOGLE_MCP_ACCOUNT": "work" }
192
+ }
193
+ }
194
+ }
195
+ ```
196
+
197
+ **OpenAI Codex CLI:**
198
+
199
+ ```sh
200
+ codex mcp add gmail-personal --env GOOGLE_MCP_ACCOUNT=personal -- google-mcp-gmail
201
+ ```
202
+
203
+ or the equivalent table in `~/.codex/config.toml`:
204
+
205
+ ```toml
206
+ [mcp_servers.gmail-personal]
207
+ command = "google-mcp-gmail"
208
+
209
+ [mcp_servers.gmail-personal.env]
210
+ GOOGLE_MCP_ACCOUNT = "personal"
211
+ ```
212
+
213
+ `~/.codex/config.toml` is user-global by nature, so the user-scope
214
+ requirement is satisfied by default; there is no scope flag to hunt for.
215
+
216
+ **Gemini CLI**: the `mcpServers` JSON shape above, inside
217
+ `~/.gemini/settings.json` (`gemini mcp add` also works).
218
+
219
+ **Cloud-sandboxed agents (Google Jules and similar):** out of scope. Jules
220
+ connects only to an allowlist of hosted MCP servers, with no way to run an
221
+ arbitrary stdio server, and its tasks execute in a fresh VM that does not have
222
+ your `~/.google-mcp/` credentials and must never be given them; do not copy
223
+ OAuth tokens into a cloud sandbox. Adopt the suite in clients that run on the
224
+ machine where the human consented.
225
+
226
+ ### 5. Supersede the first-party Google surfaces
227
+
228
+ Several clients ship or offer their own Google integration. Two Google
229
+ surfaces in one client means the agent may pick the shallower one, or one
230
+ bound to a different account than the human intended. Supersession is
231
+ client-specific, and the mechanics below are current as of this writing;
232
+ vendor surfaces move, so if a knob named here is missing, check the client's
233
+ own documentation before improvising.
234
+
235
+ **Claude Code.** If the human has claude.ai's Google connectors attached,
236
+ deny them by adding exactly these three strings to `permissions.deny` in
237
+ `~/.claude/settings.json` (create the array if absent, skip any string
238
+ already present):
239
+
240
+ ```json
241
+ {
242
+ "permissions": {
243
+ "deny": [
244
+ "mcp__claude_ai_Gmail",
245
+ "mcp__claude_ai_Google_Calendar",
246
+ "mcp__claude_ai_Google_Drive"
247
+ ]
248
+ }
249
+ }
250
+ ```
251
+
252
+ The block above shows the shape, not a file to write: merge the three strings
253
+ into the existing `settings.json` (creating the file if absent) rather than
254
+ replacing it.
255
+
256
+ A server-level deny removes every tool of that server from the model's
257
+ context, and deny rules win over allow rules at every settings level. The
258
+ rules are harmless when the connectors are not attached, and decisive when
259
+ they are. This is a local block, not a disconnect; the connectors stay
260
+ attached to the claude.ai account until the human removes them at claude.ai →
261
+ Settings → Connectors.
262
+
263
+ Two facts worth knowing rather than acting on: claude.ai connectors load only
264
+ when Claude Code is authenticated with a claude.ai subscription (API-key,
265
+ Bedrock, and Vertex sessions never see them), and
266
+ `ENABLE_CLAUDEAI_MCP_SERVERS=false` disables all claude.ai connectors at
267
+ once. The deny rules above are still the right mechanism: they are targeted
268
+ to the Google connectors, survive auth-method changes, and leave the human's
269
+ other connectors alone.
270
+
271
+ **OpenAI Codex CLI.** OpenAI curates Gmail and Google Drive plugins (backed
272
+ by ChatGPT apps), and curated identifiers follow the `<name>@openai-curated`
273
+ pattern. Enumerate the `[plugins.*]` tables in `~/.codex/config.toml` to find
274
+ every installed Google plugin, then disable each one:
275
+
276
+ ```toml
277
+ [plugins."gmail@openai-curated"]
278
+ enabled = false
279
+ ```
280
+
281
+ If a plugin's table already existed, set `enabled = false` in place and
282
+ record the prior value; either way, list what you superseded in the step 6
283
+ block, which is the manifest decommission reads back.
284
+
285
+ **Gemini CLI.** Google's Workspace extension (Gmail, Calendar, Drive, Docs,
286
+ Sheets, and more) is opt-in. If it is installed it overlaps every service
287
+ here, with a different identity model: the extension binds whichever account
288
+ its OAuth flow captured, while these servers fix one account per process.
289
+ Ask the human to uninstall it, or to choose; do not run both surfaces for
290
+ the same service. Record the outcome in the step 6 block.
291
+
292
+ **Cursor, Cline, and Windsurf** ship no first-party Google connector as of
293
+ this writing; there is nothing to supersede.
294
+
295
+ ### 6. State the preference where the agent reads it
296
+
297
+ Write this block into the client's user-level instruction file (for Claude
298
+ Code: `~/.claude/CLAUDE.md`; for Codex CLI: `~/.codex/AGENTS.md`; for Gemini
299
+ CLI: `~/.gemini/GEMINI.md`), keeping the markers verbatim, filling in the
300
+ instance list actually registered, and listing what step 5 superseded. The
301
+ block doubles as the manifest decommission reads back. Create the file if it
302
+ does not exist; if the markers are already present from an earlier run,
303
+ replace the block's contents instead of appending a second copy:
304
+
305
+ ```markdown
306
+ <!-- google-mcp-suite:begin -->
307
+ ## Google services (MCP)
308
+
309
+ Use the google-mcp-suite servers for all Google work; never a built-in Google
310
+ connector. One server per service per account; identity is fixed at startup,
311
+ so to act on a different account, use that account's instance.
312
+
313
+ Configured instances: gmail-personal, calendar-personal, gmail-work,
314
+ calendar-work, drive-work, sheets-work, docs-work.
315
+
316
+ Superseded: the claude.ai Gmail, Google Calendar, and Google Drive connectors
317
+ (three deny rules in ~/.claude/settings.json).
318
+
319
+ Setup and health: `google-mcp-doctor` (diagnose), `google-mcp-doctor auth
320
+ <account>` (re-consent when a token expires). If a Google capability is
321
+ missing, extend the suite
322
+ (https://github.com/simiancraft/google-mcp-suite/blob/main/EXTENDING.md)
323
+ rather than falling back to a built-in connector.
324
+ <!-- google-mcp-suite:end -->
325
+ ```
326
+
327
+ ### 7. Verify
328
+
329
+ Start a fresh session of the client, then:
330
+
331
+ 1. The instances are connected: `claude mcp list` or `codex mcp list` (or
332
+ your client's equivalent) shows every `<service>-<account>` entry healthy.
333
+ 2. The tools resolve, and identity matches: call a read-only operation on
334
+ each service, for example Gmail `list_labels`, Calendar `list_calendars`,
335
+ and Drive `get_about`. Where an operation returns identity, check it
336
+ against the label's intended account: Drive `get_about` returns the
337
+ account's `emailAddress`, and the Calendar list contains the primary
338
+ calendar, whose id is the account's email. A consent mis-click in step 3
339
+ surfaces here as the wrong email; fix it with
340
+ `google-mcp-doctor auth <label>` and a more careful click.
341
+ 3. The superseded surfaces are gone. Claude Code: in a fresh session, no
342
+ `claude_ai_*` Google tool is listed or callable. Codex CLI: the curated
343
+ Google plugins expose no tools. Gemini CLI: the Workspace extension is
344
+ absent.
345
+
346
+ Gate: every applicable check passes. If a server fails to connect,
347
+ `google-mcp-doctor` names the missing piece (no token, expired token, API not
348
+ enabled).
349
+
350
+ ## Decommission
351
+
352
+ The exact reverse of [the contract](#the-contract), in reverse order. Remove
353
+ only what adoption added.
354
+
355
+ 1. **Read, then remove, the marker-delimited block** in the instruction
356
+ file. It is the manifest: the instance list and the superseded list the
357
+ later steps consume, so read it first. Then delete from
358
+ `<!-- google-mcp-suite:begin -->` through `<!-- google-mcp-suite:end -->`
359
+ inclusive, leaving the rest of the file untouched.
360
+ 2. **Remove the supersession settings**, per the manifest. Claude Code:
361
+ delete exactly the three strings `mcp__claude_ai_Gmail`,
362
+ `mcp__claude_ai_Google_Calendar`, and `mcp__claude_ai_Google_Drive` from
363
+ `permissions.deny` in `~/.claude/settings.json`, leaving every other deny
364
+ rule in place. Codex CLI: restore each plugin table to the state the
365
+ manifest recorded (delete lines adoption added; restore a prior
366
+ `enabled = true` where one existed). Gemini CLI: reinstall the Workspace
367
+ extension only if the human asks for it.
368
+ 3. **Remove the server entries**, every name matching `<service>-<account>`
369
+ that adoption registered:
370
+
371
+ ```sh
372
+ claude mcp list # enumerate what is registered
373
+ claude mcp remove --scope user gmail-personal # repeat per instance
374
+ ```
375
+
376
+ Other clients: delete the corresponding `mcpServers` / `[mcp_servers.*]`
377
+ entries.
378
+ 4. **Uninstall the package** (optional):
379
+
380
+ ```sh
381
+ npm uninstall -g google-mcp-suite
382
+ ```
383
+
384
+ After these steps the client behaves as if adoption never happened; built-in
385
+ connectors, if attached, resume answering Google requests.
386
+
387
+ ### Removing credentials (optional, destructive)
388
+
389
+ Decommission deliberately leaves `~/.google-mcp/` alone, because tokens and
390
+ the client secret survive a reinstall and re-adoption is then a five-minute
391
+ job. To remove them anyway:
392
+
393
+ ```sh
394
+ rm -rf ~/.google-mcp
395
+ ```
396
+
397
+ Deleting local tokens does **not** revoke anything at Google. To revoke the
398
+ grants themselves, the human visits
399
+ [myaccount.google.com/connections](https://myaccount.google.com/connections)
400
+ for each authorized account and removes the OAuth app, and deletes the OAuth
401
+ client in the Google Cloud console.
402
+
403
+ ## The hand-off prompt
404
+
405
+ A human starting from zero can paste this into their agent:
406
+
407
+ > Adopt google-mcp-suite per
408
+ > https://github.com/simiancraft/google-mcp-suite/blob/main/ADOPTING.md for
409
+ > these Google accounts: `personal` (you@example.com) and `work`
410
+ > (you@company.com), with these services: Gmail and Calendar on both, Drive,
411
+ > Sheets, and Docs on work only. My client is Claude Code. Follow the playbook
412
+ > in order, verify every gate, and stop for me at the Google Cloud console
413
+ > step and at each browser consent.
414
+
415
+ Substitute your own client, accounts, and services; the prompt is a worked
416
+ example, like every list in this playbook.
417
+
418
+ To undo it later:
419
+
420
+ > Decommission google-mcp-suite per
421
+ > https://github.com/simiancraft/google-mcp-suite/blob/main/ADOPTING.md.
422
+ > Remove exactly what adoption added, leave my credentials in
423
+ > `~/.google-mcp/` in place, and show me what you removed.
@@ -0,0 +1,332 @@
1
+ # Provisioning google-mcp-suite
2
+
3
+ Everything you do **once in Google Cloud** to stand up the shared OAuth app, plus
4
+ the **per-account** authorization each Google account needs. This is the long,
5
+ explicit version; the README's "Auth setup" is the summary.
6
+
7
+ The console is a maze, so this doc is written to be followed literally, by a
8
+ person or by an LLM driving a person. Where the UI is mid-migration, both the old
9
+ and new menu names are given.
10
+
11
+ ## Mental model (read this first)
12
+
13
+ There are **two independent surfaces** in Google Cloud, in different menus, and you
14
+ need both:
15
+
16
+ 1. **Enable an API** so the project is allowed to *call* a service (Gmail, Calendar,
17
+ Meet, ...). Menu: *APIs & Services > Library*.
18
+ 2. **Declare a scope** on the consent screen so the OAuth flow is allowed to
19
+ *request* that permission. Menu: *Google Auth Platform > Data access* (old:
20
+ *OAuth consent screen > Scopes*).
21
+
22
+ Enable without declaring the scope and consent never asks for it. Declare the
23
+ scope without enabling the API and consent succeeds but every call returns
24
+ `403 ... has not been used in project`. You need both, for every service.
25
+
26
+ This project uses a **per-user OAuth** model: one OAuth app (one client secret),
27
+ and each Google account consents once to the **full scope union** for all planned
28
+ services. The union is front-loaded in code at [`src/auth/config.ts`](https://github.com/simiancraft/google-mcp-suite/blob/main/src/auth/config.ts)
29
+ (`SCOPES`); Google issues a refresh token only on a fresh grant, so adding a scope
30
+ later forces every account to re-consent. Add all the scopes you expect to need
31
+ before the first authorization.
32
+
33
+ ---
34
+
35
+ ## Phase 1: project (one time)
36
+
37
+ 1. Sign in to <https://console.cloud.google.com> as the account that will **own**
38
+ the OAuth app (for this repo: `info@simiancraft.com`, a Workspace account).
39
+ 2. Top bar: click the **project picker** (the dropdown left of the search box).
40
+ 3. Select the existing **google-mcp** project, or **New project** to create one.
41
+ The project must exist before anything below; everything is scoped to it.
42
+ 4. Confirm you are in the right project: its name shows in the top bar, and its
43
+ number matches the client ID prefix you will create in Phase 3
44
+ (`<number>-xxxx.apps.googleusercontent.com`).
45
+
46
+ > Provisioning a brand-new project also needs **billing** linked only if you later
47
+ > use paid APIs. The Workspace APIs here (Gmail, Drive, Sheets, Docs, Calendar,
48
+ > Meet, Tasks, Slides, People, Drive Activity) do **not** require billing.
49
+
50
+ ---
51
+
52
+ ## Phase 2: enable the APIs
53
+
54
+ ### Console (manual; the path actually used)
55
+
56
+ 1. Left nav or search: **APIs & Services > Library**
57
+ (<https://console.cloud.google.com/apis/library>).
58
+ 2. At the top, the **Enable APIs and Services** button / the Library landing.
59
+ 3. In the category list, click **Google Workspace**: every Workspace API is
60
+ grouped there.
61
+ 4. For each API you want, open its card and click **Enable**. For this suite:
62
+ - Gmail API
63
+ - Google Drive API
64
+ - Google Sheets API
65
+ - Google Docs API
66
+ - Google Calendar API
67
+ - Google Meet REST API
68
+ - (optional, see appendix) Tasks, Slides, People, Drive Activity, Forms, Chat
69
+ 5. Verify the full set under **APIs & Services > Enabled APIs & services**
70
+ (<https://console.cloud.google.com/apis/dashboard>).
71
+
72
+ ### gcloud (scriptable; see the agent appendix)
73
+
74
+ ```sh
75
+ gcloud config set project <PROJECT_ID>
76
+ gcloud services enable \
77
+ gmail.googleapis.com \
78
+ drive.googleapis.com \
79
+ sheets.googleapis.com \
80
+ docs.googleapis.com \
81
+ calendar-json.googleapis.com \
82
+ meet.googleapis.com
83
+ # verify:
84
+ gcloud services list --enabled
85
+ ```
86
+
87
+ Service identifiers are not always the obvious name (Calendar is
88
+ `calendar-json.googleapis.com`, not `calendar.googleapis.com`). Confirm any name
89
+ with `gcloud services list --available | grep -i <word>` before relying on it.
90
+
91
+ ---
92
+
93
+ ## Phase 3: create the OAuth client (one time)
94
+
95
+ 1. **APIs & Services > Credentials** (new: *Google Auth Platform > Clients*),
96
+ <https://console.cloud.google.com/auth/clients>.
97
+ 2. **Create credentials > OAuth client ID**.
98
+ 3. Application type: **Desktop app**. Name it anything (e.g. `google-mcp`).
99
+ 4. **Create**, then **Download JSON**.
100
+ 5. Save it to the canonical config dir, outside the repo:
101
+
102
+ ```sh
103
+ mkdir -p ~/.google-mcp
104
+ mv ~/Downloads/client_secret_*.json ~/.google-mcp/client_secret.json
105
+ chmod 600 ~/.google-mcp/client_secret.json
106
+ ```
107
+
108
+ Either the `installed` or `web` JSON shape is accepted. All accounts share this
109
+ one client.
110
+
111
+ > There is **no public API** to create a Desktop OAuth client or download its
112
+ > secret; this step is manual by design (see the agent appendix).
113
+
114
+ ---
115
+
116
+ ## Phase 4: configure the consent screen
117
+
118
+ If this is a brand-new project you will first be prompted to configure the consent
119
+ screen (set **User type: External**, app name, support email, developer email).
120
+ Then:
121
+
122
+ ### Declare the scopes
123
+
124
+ 1. **Google Auth Platform > Data access** (old: *OAuth consent screen*, the
125
+ **Scopes** step), <https://console.cloud.google.com/auth/scopes>.
126
+ 2. Click **Add or remove scopes**. This opens a side panel with a 100+ row table
127
+ and, at the bottom, a **"Manually add scopes"** text box.
128
+ 3. In the **manual box** (the table is huge and easy to mis-click; many scopes
129
+ look almost identical), paste the **exact** contents of `SCOPES` from
130
+ [`src/auth/config.ts`](https://github.com/simiancraft/google-mcp-suite/blob/main/src/auth/config.ts), one per line. As of this writing:
131
+
132
+ ```
133
+ https://mail.google.com/
134
+ https://www.googleapis.com/auth/gmail.settings.basic
135
+ https://www.googleapis.com/auth/drive
136
+ https://www.googleapis.com/auth/spreadsheets
137
+ https://www.googleapis.com/auth/documents
138
+ https://www.googleapis.com/auth/calendar
139
+ https://www.googleapis.com/auth/meetings.space.created
140
+ https://www.googleapis.com/auth/meetings.space.readonly
141
+ https://www.googleapis.com/auth/meetings.space.settings
142
+ ```
143
+
144
+ 4. Click **Add to table**, then **Update** (this closes the panel and stages your
145
+ selection).
146
+
147
+ > **You are not done. Click Save.** The Data access page does **not** save like a
148
+ > normal web form. **Update** only stages the selection back onto the page; the
149
+ > page then shows your scopes sorted into Non-sensitive / Sensitive / Restricted,
150
+ > and you must click the **Save** button on that page as a **separate second
151
+ > step** to commit. Navigate away before clicking Save and your scopes are lost
152
+ > with no warning. After saving, expect `mail.google.com` and `drive` under
153
+ > **Restricted**, `meetings.space.settings` under **Non-sensitive**, and the rest
154
+ > under **Sensitive**.
155
+
156
+ **Watch two traps while picking:**
157
+ - `https://mail.google.com/` has no `googleapis.com/auth` prefix and breaks the
158
+ pattern, so it is the easy one to miss. It is the full-mailbox scope ("Read,
159
+ compose, send, and permanently delete all your email"); do not settle for
160
+ `gmail.modify`, which cannot permanently delete.
161
+ - Full `.../auth/drive` already subsumes every narrower Drive scope
162
+ (`drive.file`, `drive.readonly`, `drive.metadata*`, `drive.meet.readonly`) and
163
+ the separate **Drive Labels** scopes (`drive.labels*`, `drive.admin.labels*`).
164
+ If the table tacks any of those on, remove them; keep only the single
165
+ `.../auth/drive`. Extra restricted scopes are inert in Testing but enlarge the
166
+ verification surface if you ever publish.
167
+
168
+ The list in code is the source of truth. When you change `SCOPES`, mirror it here
169
+ (Add or remove scopes, Update, **Save**) and re-authorize every account (Phase 5).
170
+
171
+ ### Add test users, and stay in Testing
172
+
173
+ 1. **Google Auth Platform > Audience** (old: *OAuth consent screen > Test users*),
174
+ <https://console.cloud.google.com/auth/audience>.
175
+ 2. Keep **Publishing status: Testing**.
176
+ 3. Under **Test users**, add every account you will authorize (e.g.
177
+ `info@simiancraft.com`). Restricted scopes only consent for a listed test user
178
+ while in Testing.
179
+
180
+ > **Do not click "Publish app."** Restricted and sensitive scopes trigger Google's
181
+ > verification process (security assessment, and for restricted scopes a possible
182
+ > paid third-party audit) **only when published to production**. In Testing, with
183
+ > yourself as a test user, you get the full grant immediately. The cost is a
184
+ > "Google hasn't verified this app" interstitial during consent: click
185
+ > **Advanced**, then **Go to (app) (unsafe)**, and proceed. That is expected for a
186
+ > personal/dev app. The other cost of Testing: **refresh tokens expire 7 days after
187
+ > issuance**, so each account needs weekly re-consent (`google-mcp-doctor auth`;
188
+ > `doctor status` shows the countdown).
189
+
190
+ ---
191
+
192
+ ## Phase 5: authorize an account (per account)
193
+
194
+ Build once, then run the `auth` subcommand for each account. The flow forces
195
+ offline access and consent, so a refresh token is always written.
196
+
197
+ ```sh
198
+ # authorize an account (opens a browser; writes ~/.google-mcp/tokens/<account>.json, 0600)
199
+ google-mcp-doctor auth you@example.com
200
+
201
+ # or, from a source checkout:
202
+ bun install && bun run build
203
+ GOOGLE_MCP_ACCOUNT=<account> node ./dist/gmail/index.js auth
204
+ ```
205
+
206
+ - The account label becomes the token filename. Use the same label in the MCP
207
+ registration (Phase 6).
208
+ - On WSL2 the browser may not auto-open; the URL is printed to stderr. Copy it
209
+ into your browser. The callback hits `http://localhost:3000/oauth2callback`.
210
+ - Verify the granted scope:
211
+
212
+ ```sh
213
+ python3 -c "import json;print(json.load(open('$HOME/.google-mcp/tokens/<account>.json'))['scope'])"
214
+ ```
215
+
216
+ It must contain every scope from `SCOPES`. If it is missing one, the consent
217
+ screen is missing that scope (Phase 4) or the account re-used an old grant; add
218
+ the scope, then re-run `auth`.
219
+
220
+ ### Config directory and overrides
221
+
222
+ Default layout (all overridable by env, read lazily):
223
+
224
+ ```
225
+ ~/.google-mcp/
226
+ client_secret.json # the shared OAuth client (Phase 3)
227
+ tokens/<account>.json # per-account token, 0600 inside a 0700 dir
228
+ ```
229
+
230
+ | Variable | Meaning | Default |
231
+ |---|---|---|
232
+ | `GOOGLE_MCP_ACCOUNT` | which account this instance acts as | required |
233
+ | `GOOGLE_MCP_DIR` | the config directory | `~/.google-mcp` |
234
+ | `GOOGLE_MCP_CLIENT_SECRET` | path to the client secret JSON | `<dir>/client_secret.json` |
235
+ | `GOOGLE_MCP_TOKEN` | a specific token file (single-account override) | `<dir>/tokens/<account>.json` |
236
+
237
+ ---
238
+
239
+ ## Phase 6: register the MCP server
240
+
241
+ One server instance per account, each pinned via `GOOGLE_MCP_ACCOUNT`. Example
242
+ entries for an MCP host config (e.g. `~/.claude.json` `mcpServers`):
243
+
244
+ ```jsonc
245
+ {
246
+ "gmail-simiancraft": {
247
+ "type": "stdio",
248
+ "command": "google-mcp-gmail",
249
+ "env": { "GOOGLE_MCP_ACCOUNT": "simiancraft" }
250
+ },
251
+ // or, from a source checkout:
252
+ "gmail-from-source": {
253
+ "type": "stdio",
254
+ "command": "node",
255
+ "args": ["<abs-path-to-repo>/dist/gmail/index.js"],
256
+ "env": { "GOOGLE_MCP_ACCOUNT": "simiancraft" }
257
+ }
258
+ }
259
+ ```
260
+
261
+ With the canonical config dir in place, `GOOGLE_MCP_ACCOUNT` is the only env var
262
+ needed; the client secret and token resolve from `~/.google-mcp/`. Set
263
+ `GOOGLE_MCP_CLIENT_SECRET` / `GOOGLE_MCP_TOKEN` only to point at a non-canonical
264
+ location. Restart the host (or reconnect the server) after editing.
265
+
266
+ ---
267
+
268
+ ## Appendix A: adding a new service's scopes
269
+
270
+ 1. Enable its API (Phase 2).
271
+ 2. Add its scope(s) to `SCOPES` in [`src/auth/config.ts`](https://github.com/simiancraft/google-mcp-suite/blob/main/src/auth/config.ts).
272
+ 3. Add the same scope strings on the consent screen (Phase 4).
273
+ 4. Re-run `auth` for every account (Phase 5); a new scope is only granted on a
274
+ fresh consent.
275
+
276
+ Candidate scopes for planned/likely services (not all are in `SCOPES` yet; check
277
+ the file for the authoritative list):
278
+
279
+ | Service | API id (verify with gcloud) | Representative scope(s) |
280
+ |---|---|---|
281
+ | Gmail | `gmail.googleapis.com` | `https://mail.google.com/`, `.../auth/gmail.settings.basic` |
282
+ | Drive | `drive.googleapis.com` | `.../auth/drive` |
283
+ | Sheets | `sheets.googleapis.com` | `.../auth/spreadsheets` |
284
+ | Docs | `docs.googleapis.com` | `.../auth/documents` |
285
+ | Calendar | `calendar-json.googleapis.com` | `.../auth/calendar` |
286
+ | Meet (REST) | `meet.googleapis.com` | `.../auth/meetings.space.created`, `.../auth/meetings.space.readonly`, `.../auth/meetings.space.settings` |
287
+ | Tasks | `tasks.googleapis.com` | `.../auth/tasks` |
288
+ | Slides | `slides.googleapis.com` | `.../auth/presentations` |
289
+ | People | `people.googleapis.com` | `.../auth/contacts` |
290
+ | Drive Activity | `driveactivity.googleapis.com` | `.../auth/drive.activity.readonly` |
291
+ | Forms | `forms.googleapis.com` | `.../auth/forms.body`, `.../auth/forms.responses.readonly` |
292
+ | Chat | `chat.googleapis.com` | `.../auth/chat.messages`, `.../auth/chat.spaces` |
293
+
294
+ `.../auth/` is shorthand for `https://www.googleapis.com/auth/`.
295
+
296
+ ---
297
+
298
+ ## Appendix B: can an agent do this?
299
+
300
+ Partly. The split is sharp, and it is worth knowing where the human is mandatory.
301
+
302
+ **An agent CAN automate (via `gcloud` / Google Cloud APIs):**
303
+
304
+ - Create the project: `gcloud projects create <id>`.
305
+ - Enable APIs: `gcloud services enable ...` (the **Service Usage API**).
306
+ - Audit state: `gcloud services list --enabled`, list credentials, etc.
307
+
308
+ Requirements: `gcloud` installed, an authenticated principal, and (for enabling)
309
+ the `roles/serviceusage.serviceUsageAdmin` role plus the **Service Usage** and
310
+ **Cloud Resource Manager** APIs enabled. Authenticate either as the human
311
+ (`gcloud auth login`, interactive, one time) or as a service account with a key
312
+ (`gcloud auth activate-service-account --key-file=...`). Once authenticated, an
313
+ agent with shell access (e.g. a coding agent's Bash tool) can run the enable
314
+ commands directly. Note: `gcloud` is **not** installed in this repo's environment
315
+ by default; install the Google Cloud SDK first.
316
+
317
+ **An agent CANNOT automate (no stable public API; manual in the console):**
318
+
319
+ - Creating a **Desktop OAuth client** and downloading its `client_secret.json`.
320
+ (The IAP brands API only covers an OAuth brand and IAP/web client types, not
321
+ Desktop clients.)
322
+ - **Declaring scopes** on the consent screen (no public API to add
323
+ sensitive/restricted scopes).
324
+ - Managing **test users** and **publishing status**.
325
+ - The **browser consent** itself (Phase 5): interactive and human-in-the-loop by
326
+ design; the whole point is a human granting access.
327
+
328
+ **Realistic division of labor:** let an agent create the project and enable the
329
+ APIs (the tedious, scriptable part), then a human does the consent-screen and
330
+ client steps once in the console, runs `auth` per account in a browser, and hands
331
+ back. The repo already scripts the token mint (the `auth` subcommand); only the
332
+ browser click is human.
package/README.md CHANGED
@@ -14,7 +14,7 @@
14
14
 
15
15
  <p align="center">
16
16
  <strong>Google MCP servers you can read in an afternoon, one per service.</strong><br />
17
- The curated <a href="https://modelcontextprotocol.io/">MCP</a> toolset plus the broader REST surface, in one server per account, so an agent can run several Google accounts at once and can never act on the wrong one. A folder tree that mirrors Google's API reference page-for-page, with 100% test coverage.
17
+ The curated <a href="https://modelcontextprotocol.io/">MCP</a> toolset plus the broader REST surface, one server per service per account: <strong>117 self-describing operations</strong> across five Google services, so an agent can do (nearly) anything your accounts can, on several accounts at once, and never on the wrong one. Every operation cites its Google reference page and validates input and output; test coverage is pinned at 100%.
18
18
  </p>
19
19
 
20
20
  <p align="center">
@@ -30,9 +30,11 @@
30
30
  </p>
31
31
 
32
32
  <p align="center">
33
- <sub><strong>Gmail</strong> (<a href="./src/gmail/CAPABILITIES.md">33 operations</a>), <strong>Calendar</strong> (<a href="./src/calendar/CAPABILITIES.md">25 operations</a>), <strong>Sheets</strong> (<a href="./src/sheets/CAPABILITIES.md">15 operations</a>), <strong>Docs</strong> (<a href="./src/docs/CAPABILITIES.md">9 operations</a>), and <strong>Drive</strong> (<a href="./src/drive/CAPABILITIES.md">35 operations</a>) ship today.</sub>
33
+ <sub><strong>117 operations</strong> ship today: <strong>Gmail</strong> (<a href="./src/gmail/CAPABILITIES.md">33</a>), <strong>Calendar</strong> (<a href="./src/calendar/CAPABILITIES.md">25</a>), <strong>Sheets</strong> (<a href="./src/sheets/CAPABILITIES.md">15</a>), <strong>Docs</strong> (<a href="./src/docs/CAPABILITIES.md">9</a>), and <strong>Drive</strong> (<a href="./src/drive/CAPABILITIES.md">35</a>).</sub>
34
34
  </p>
35
35
 
36
+ <p align="center"><sub><strong>Replacing a built-in connector?</strong> Hand your agent <a href="./ADOPTING.md">ADOPTING.md</a>: the playbook to adopt, supersede, verify, and decommission.</sub></p>
37
+
36
38
  ## What it does
37
39
 
38
40
  Point an AI agent at your Google accounts and let it do the work: triage and send mail, run your calendars, read and write your spreadsheets, draft and edit documents, and manage your files and shared drives. The end goal is an agent that operates your accounts and hands you results.
@@ -71,6 +73,8 @@ The split is Google's own (its MCP reference and its REST reference are separate
71
73
 
72
74
  One thing first: a Google Cloud OAuth client (roughly ten minutes of console clicks, once; the friction is Google's, not ours). [PROVISIONING.md](./PROVISIONING.md) walks every click, and `doctor` tells you which step you are on.
73
75
 
76
+ **Driving this with an agent?** Hand it [ADOPTING.md](./ADOPTING.md): the literal adopt, supersede-the-built-ins, verify, and decommission playbook, with a hand-off prompt to paste.
77
+
74
78
  ```sh
75
79
  npm install -g google-mcp-suite
76
80
 
@@ -0,0 +1,69 @@
1
+ # Installing google-mcp-suite (for AI agents)
2
+
3
+ You are installing a suite of Google MCP servers: Gmail, Calendar, Drive,
4
+ Sheets, and Docs, one stdio server per service per Google account. Identity is
5
+ bound at startup via the `GOOGLE_MCP_ACCOUNT` environment variable; there is no
6
+ per-call account parameter.
7
+
8
+ **Cloud-sandboxed agents (Google Jules and similar) are out of scope**: the
9
+ suite runs on the machine where the human consented, and OAuth credentials
10
+ must never enter a cloud VM.
11
+
12
+ The full agent playbook, including superseding a client's built-in Google
13
+ connectors and a clean decommission, is
14
+ [ADOPTING.md](https://github.com/simiancraft/google-mcp-suite/blob/main/ADOPTING.md).
15
+ The condensed path:
16
+
17
+ ## 1. Install
18
+
19
+ ```sh
20
+ npm install -g google-mcp-suite
21
+ ```
22
+
23
+ Requires Node >= 22. Bins: `google-mcp-gmail`, `google-mcp-calendar`,
24
+ `google-mcp-drive`, `google-mcp-sheets`, `google-mcp-docs`, and the
25
+ `google-mcp-doctor` setup CLI.
26
+
27
+ ## 2. Provision and authorize (human-in-the-loop)
28
+
29
+ The suite needs a Google Cloud OAuth client; this is a one-time human step.
30
+
31
+ ```sh
32
+ google-mcp-doctor scopes # the APIs + scopes to enable in Google Cloud
33
+ # human follows PROVISIONING.md, drops client_secret.json in ~/.google-mcp/
34
+ google-mcp-doctor auth you@example.com # browser consent; writes the account token
35
+ google-mcp-doctor # provisioned, authorized, reachable?
36
+ ```
37
+
38
+ ## 3. Configure your MCP client
39
+
40
+ One instance per service per account, named `<service>-<account>`:
41
+
42
+ ```json
43
+ {
44
+ "mcpServers": {
45
+ "gmail-personal": {
46
+ "command": "google-mcp-gmail",
47
+ "env": { "GOOGLE_MCP_ACCOUNT": "personal" }
48
+ },
49
+ "calendar-personal": {
50
+ "command": "google-mcp-calendar",
51
+ "env": { "GOOGLE_MCP_ACCOUNT": "personal" }
52
+ }
53
+ }
54
+ }
55
+ ```
56
+
57
+ For Claude Code, register with `claude mcp add --scope user <name> --env
58
+ GOOGLE_MCP_ACCOUNT=<account> -- <bin>`; for OpenAI Codex CLI, `codex mcp add
59
+ <name> --env GOOGLE_MCP_ACCOUNT=<account> -- <bin>`. See
60
+ [ADOPTING.md](https://github.com/simiancraft/google-mcp-suite/blob/main/ADOPTING.md)
61
+ for every client's path and for superseding a client's first-party Google
62
+ surface (claude.ai connectors, OpenAI-curated plugins, Gemini's Workspace
63
+ extension).
64
+
65
+ ## 4. Verify
66
+
67
+ Restart the client, confirm each `<service>-<account>` server connects, and
68
+ call one read-only tool per service (Gmail `list_labels`, Calendar
69
+ `list_calendars`). `google-mcp-doctor` diagnoses any failure.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "google-mcp-suite",
3
- "version": "1.7.0",
3
+ "version": "1.8.0",
4
4
  "type": "module",
5
5
  "description": "Per-account MCP servers for Gmail, Google Calendar, Google Drive, Google Sheets, and Google Docs: identity is bound to the running instance, so an agent can never act on the wrong account; each server exposes Google's curated MCP toolset (where one exists) plus the broader REST surface.",
6
6
  "keywords": [
@@ -48,6 +48,9 @@
48
48
  "files": [
49
49
  "dist",
50
50
  "README.md",
51
+ "ADOPTING.md",
52
+ "PROVISIONING.md",
53
+ "llms-install.md",
51
54
  "LICENSE",
52
55
  "NOTICE.md"
53
56
  ],