google-tools-mcp 1.2.11 → 2.0.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/LICENSE +21 -21
- package/README.md +555 -276
- package/dist/cachedToolsList.js +52 -52
- package/dist/googleDocsApiHelpers.js +76 -12
- package/dist/helpers.js +572 -252
- package/dist/httpAuth.js +296 -0
- package/dist/index.js +162 -11
- package/dist/logger.js +87 -87
- package/dist/markdown-transformer/docsToMarkdown.js +222 -21
- package/dist/markdown-transformer/index.js +19 -9
- package/dist/markdown-transformer/markdownToDocs.js +458 -28
- package/dist/readTracker.js +136 -17
- package/dist/sessionContext.js +37 -0
- package/dist/setup.js +187 -9
- package/dist/tools/calendar/getBusy.js +64 -64
- package/dist/tools/calendar/getEvents.js +141 -141
- package/dist/tools/calendar/getFree.js +225 -225
- package/dist/tools/calendar/index.js +19 -19
- package/dist/tools/calendar/listCalendars.js +38 -38
- package/dist/tools/calendar/listRecurringInstances.js +83 -83
- package/dist/tools/calendar/manageCalendar.js +121 -121
- package/dist/tools/calendar/manageEvent.js +258 -258
- package/dist/tools/calendar/moveEvent.js +66 -66
- package/dist/tools/docs/addTab.js +10 -12
- package/dist/tools/docs/appendToGoogleDoc.js +9 -4
- package/dist/tools/docs/deleteRange.js +9 -4
- package/dist/tools/docs/findAndReplace.js +9 -4
- package/dist/tools/docs/formatting/applyParagraphStyle.js +4 -1
- package/dist/tools/docs/formatting/getFormatting.js +171 -171
- package/dist/tools/docs/insertImage.js +15 -2
- package/dist/tools/docs/insertPageBreak.js +4 -1
- package/dist/tools/docs/insertTable.js +4 -1
- package/dist/tools/docs/insertTableWithData.js +4 -1
- package/dist/tools/docs/modifyText.js +14 -4
- package/dist/tools/docs/modifyText.test.js +84 -84
- package/dist/tools/docs/readGoogleDoc.js +71 -11
- package/dist/tools/docs/renameTab.js +12 -14
- package/dist/tools/drafts.js +165 -165
- package/dist/tools/drive/createDocument.js +13 -1
- package/dist/tools/drive/downloadFile.js +268 -268
- package/dist/tools/drive/getFileInfo.js +48 -48
- package/dist/tools/drive/getFilePath.js +50 -50
- package/dist/tools/drive/listDriveFiles.js +112 -112
- package/dist/tools/drive/listSharedDrives.js +52 -52
- package/dist/tools/drive/listSharedWithMe.js +97 -97
- package/dist/tools/drive/uploadFile.js +111 -111
- package/dist/tools/extras/index.js +9 -9
- package/dist/tools/extras/readDriveFile.js +212 -206
- package/dist/tools/extras/readFile.js +84 -84
- package/dist/tools/extras/searchFileContents.js +81 -81
- package/dist/tools/forms/batchUpdateForm.js +81 -81
- package/dist/tools/forms/createForm.js +54 -54
- package/dist/tools/forms/getForm.js +118 -118
- package/dist/tools/forms/getFormResponse.js +45 -45
- package/dist/tools/forms/index.js +15 -15
- package/dist/tools/forms/listFormResponses.js +56 -56
- package/dist/tools/forms/setPublishSettings.js +59 -59
- package/dist/tools/gmail/drafts.js +165 -165
- package/dist/tools/gmail/labels.js +54 -83
- package/dist/tools/gmail/messages.js +444 -441
- package/dist/tools/gmail/settings.js +358 -528
- package/dist/tools/gmail/threads.js +286 -164
- package/dist/tools/index.js +511 -473
- package/dist/tools/labels.js +103 -103
- package/dist/tools/legacyAliases.js +426 -0
- package/dist/tools/maps/directions.js +72 -0
- package/dist/tools/maps/geocode.js +16 -0
- package/dist/tools/maps/index.js +15 -0
- package/dist/tools/maps/mapsClient.js +83 -0
- package/dist/tools/maps/placeDetails.js +16 -0
- package/dist/tools/maps/reverseGeocode.js +19 -0
- package/dist/tools/maps/searchNearby.js +54 -0
- package/dist/tools/maps/searchPlaces.js +24 -0
- package/dist/tools/messages.js +448 -448
- package/dist/tools/settings.js +528 -528
- package/dist/tools/slides/createPresentation.js +104 -104
- package/dist/tools/slides/createShape.js +92 -92
- package/dist/tools/slides/createTextBox.js +82 -82
- package/dist/tools/slides/deleteSlide.js +30 -30
- package/dist/tools/slides/duplicateSlide.js +37 -37
- package/dist/tools/slides/exportThumbnail.js +42 -42
- package/dist/tools/slides/formatParagraph.js +72 -72
- package/dist/tools/slides/formatText.js +84 -84
- package/dist/tools/slides/getPresentation.js +87 -87
- package/dist/tools/slides/index.js +33 -33
- package/dist/tools/slides/reorderSlides.js +41 -41
- package/dist/tools/slides/replaceAllText.js +46 -46
- package/dist/tools/slides/setBackground.js +58 -58
- package/dist/tools/slides/speakerNotes.js +102 -102
- package/dist/tools/slides/styleShape.js +111 -111
- package/dist/tools/slides/updatePresentation.js +128 -128
- package/dist/tools/threads.js +145 -145
- package/dist/tools/utils/appendMarkdownToGoogleDoc.js +31 -7
- package/dist/tools/utils/replaceDocumentWithMarkdown.js +72 -9
- package/dist/updateCheck.js +202 -0
- package/dist/workspace.js +122 -0
- package/package.json +82 -80
package/README.md
CHANGED
|
@@ -1,118 +1,145 @@
|
|
|
1
|
-
# google-tools-mcp
|
|
2
|
-
|
|
3
|
-
The **easiest way** to connect your AI agent to Google Workspace.
|
|
4
|
-
|
|
5
|
-
**
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
npx -y google-tools-mcp setup
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## Why google-tools-mcp?
|
|
12
|
-
|
|
13
|
-
- **One command to install.** No cloning repos, no building from source, no Docker. Just `npx -y google-tools-mcp` and it works.
|
|
14
|
-
- **One login for everything.** A single OAuth flow gives you Drive, Docs, Sheets, Gmail, Calendar, and Forms. No juggling multiple tokens or servers.
|
|
15
|
-
- **Auth that stays out of your way.** No browser popup until your first tool call. After that, your token is saved and you won't be asked again.
|
|
16
|
-
- **Read anything in your Drive.** PDFs, Word docs (.docx), spreadsheets — your AI agent can read them directly. No extra setup.
|
|
17
|
-
- **
|
|
18
|
-
- **Switch between Google accounts.** Set a profile name and keep work and personal accounts completely separate.
|
|
19
|
-
- **No telemetry. No tracking. Fully open source.**
|
|
20
|
-
|
|
21
|
-
## Quick Start
|
|
22
|
-
|
|
23
|
-
You can be up and running in under 5 minutes.
|
|
24
|
-
|
|
25
|
-
### Guided Setup (recommended)
|
|
26
|
-
|
|
27
|
-
Run the setup wizard — it opens the right Google Cloud Console pages for you and saves your credentials automatically:
|
|
28
|
-
|
|
29
|
-
```bash
|
|
30
|
-
npx -y google-tools-mcp setup
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
The wizard walks you through:
|
|
34
|
-
1. Enabling all required Google APIs (opens in your browser)
|
|
35
|
-
2. Configuring the OAuth consent screen
|
|
36
|
-
3. Creating OAuth credentials
|
|
37
|
-
4. Authenticating with Google
|
|
38
|
-
|
|
1
|
+
# google-tools-mcp
|
|
2
|
+
|
|
3
|
+
The **easiest way** to connect your AI agent to Google Workspace.
|
|
4
|
+
|
|
5
|
+
**159 tools** for Drive, Docs, Sheets, Gmail, Calendar, Forms, and Maps — all in one package. One install, one auth, and you're done.
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npx -y google-tools-mcp setup
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Why google-tools-mcp?
|
|
12
|
+
|
|
13
|
+
- **One command to install.** No cloning repos, no building from source, no Docker. Just `npx -y google-tools-mcp setup` and it works.
|
|
14
|
+
- **One login for everything.** A single OAuth flow gives you Drive, Docs, Sheets, Gmail, Calendar, and Forms. No juggling multiple tokens or servers.
|
|
15
|
+
- **Auth that stays out of your way.** No browser popup until your first tool call. After that, your token is saved and you won't be asked again.
|
|
16
|
+
- **Read anything in your Drive.** PDFs, Word docs (.docx), spreadsheets — your AI agent can read them directly. No extra setup.
|
|
17
|
+
- **159 tools, zero config.** Every tool is available the moment the server starts. Send emails, create docs, manage calendar events, build forms, search places — it's all there.
|
|
18
|
+
- **Switch between Google accounts.** Set a profile name and keep work and personal accounts completely separate.
|
|
19
|
+
- **No telemetry. No tracking. Fully open source.**
|
|
20
|
+
|
|
21
|
+
## Quick Start
|
|
22
|
+
|
|
23
|
+
You can be up and running in under 5 minutes.
|
|
24
|
+
|
|
25
|
+
### Guided Setup (recommended)
|
|
26
|
+
|
|
27
|
+
Run the setup wizard — it opens the right Google Cloud Console pages for you and saves your credentials automatically:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npx -y google-tools-mcp setup
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
The wizard walks you through:
|
|
34
|
+
1. Enabling all required Google APIs (opens in your browser)
|
|
35
|
+
2. Configuring the OAuth consent screen
|
|
36
|
+
3. Creating OAuth credentials
|
|
37
|
+
4. Authenticating with Google
|
|
38
|
+
|
|
39
39
|
The setup wizard can add the MCP server to Codex or Claude Code automatically when their CLIs are installed. You can also add it manually later (see [Step 3](#step-3-add-to-your-mcp-client) below).
|
|
40
|
-
|
|
41
|
-
### Manual Setup
|
|
42
|
-
|
|
43
|
-
<details>
|
|
44
|
-
<summary>Click to expand manual setup instructions</summary>
|
|
45
|
-
|
|
46
|
-
#### Step 1: Create Google OAuth Credentials
|
|
47
|
-
|
|
48
|
-
1. Go to the [Google Cloud Console](https://console.cloud.google.com/)
|
|
49
|
-
2. Create a project (or use an existing one)
|
|
50
|
-
3. Enable the **Google Docs API**, **Google Sheets API**, **Google Drive API**, **Gmail API**, **Google Calendar API**, and **Google Forms API**
|
|
51
|
-
4. Go to **OAuth consent screen** and configure it (External is fine for personal use). If your app's publishing status is **Testing** (the default), you must add your Google account as a test user — go to **OAuth consent screen** → **Test users** → **Add users** and enter your email. Without this, Google will block the OAuth flow with an "Access denied" or "app not verified" error.
|
|
52
|
-
5. Go to **Credentials** → **Create Credentials** → **OAuth Client ID**
|
|
53
|
-
6. Select **Desktop application** as the application type
|
|
54
|
-
7. Download the credentials or note your **Client ID** and **Client Secret**
|
|
55
|
-
|
|
56
|
-
#### Step 2: Provide Your Credentials
|
|
57
|
-
|
|
58
|
-
Choose **one** of the following methods (whichever you prefer):
|
|
59
|
-
|
|
60
|
-
#### Option A: Use `credentials.json`
|
|
61
|
-
|
|
62
|
-
Download the JSON file from Google Cloud Console and place it in either location:
|
|
63
|
-
|
|
64
|
-
```
|
|
65
|
-
~/.config/google-tools-mcp/credentials.json (recommended — shared across projects)
|
|
66
|
-
./credentials.json (local to your project)
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
That's it — no env vars needed. The server will find it automatically.
|
|
70
|
-
|
|
71
|
-
#### Option B: Create a `.env` file
|
|
72
|
-
|
|
73
|
-
Create a `.env` file in either location:
|
|
74
|
-
|
|
75
|
-
```
|
|
76
|
-
~/.config/google-tools-mcp/.env (recommended — shared across projects)
|
|
77
|
-
./.env (local to your project)
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
With the following contents:
|
|
81
|
-
|
|
82
|
-
```env
|
|
83
|
-
GOOGLE_CLIENT_ID=your-client-id.apps.googleusercontent.com
|
|
84
|
-
GOOGLE_CLIENT_SECRET=your-client-secret
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
#### Option C: Set env vars in your MCP config
|
|
88
|
-
|
|
89
|
-
Add the credentials directly to your MCP configuration:
|
|
90
|
-
|
|
91
|
-
```json
|
|
92
|
-
{
|
|
93
|
-
"mcpServers": {
|
|
94
|
-
"google": {
|
|
95
|
-
"command": "
|
|
96
|
-
"
|
|
97
|
-
|
|
98
|
-
"
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
40
|
+
|
|
41
|
+
### Manual Setup
|
|
42
|
+
|
|
43
|
+
<details>
|
|
44
|
+
<summary>Click to expand manual setup instructions</summary>
|
|
45
|
+
|
|
46
|
+
#### Step 1: Create Google OAuth Credentials
|
|
47
|
+
|
|
48
|
+
1. Go to the [Google Cloud Console](https://console.cloud.google.com/)
|
|
49
|
+
2. Create a project (or use an existing one)
|
|
50
|
+
3. Enable the **Google Docs API**, **Google Sheets API**, **Google Drive API**, **Gmail API**, **Google Calendar API**, and **Google Forms API**
|
|
51
|
+
4. Go to **OAuth consent screen** and configure it (External is fine for personal use). If your app's publishing status is **Testing** (the default), you must add your Google account as a test user — go to **OAuth consent screen** → **Test users** → **Add users** and enter your email. Without this, Google will block the OAuth flow with an "Access denied" or "app not verified" error.
|
|
52
|
+
5. Go to **Credentials** → **Create Credentials** → **OAuth Client ID**
|
|
53
|
+
6. Select **Desktop application** as the application type
|
|
54
|
+
7. Download the credentials or note your **Client ID** and **Client Secret**
|
|
55
|
+
|
|
56
|
+
#### Step 2: Provide Your Credentials
|
|
57
|
+
|
|
58
|
+
Choose **one** of the following methods (whichever you prefer):
|
|
59
|
+
|
|
60
|
+
#### Option A: Use `credentials.json`
|
|
61
|
+
|
|
62
|
+
Download the JSON file from Google Cloud Console and place it in either location:
|
|
63
|
+
|
|
64
|
+
```
|
|
65
|
+
~/.config/google-tools-mcp/credentials.json (recommended — shared across projects)
|
|
66
|
+
./credentials.json (local to your project)
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
That's it — no env vars needed. The server will find it automatically.
|
|
70
|
+
|
|
71
|
+
#### Option B: Create a `.env` file
|
|
72
|
+
|
|
73
|
+
Create a `.env` file in either location:
|
|
74
|
+
|
|
75
|
+
```
|
|
76
|
+
~/.config/google-tools-mcp/.env (recommended — shared across projects)
|
|
77
|
+
./.env (local to your project)
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
With the following contents:
|
|
81
|
+
|
|
82
|
+
```env
|
|
83
|
+
GOOGLE_CLIENT_ID=your-client-id.apps.googleusercontent.com
|
|
84
|
+
GOOGLE_CLIENT_SECRET=your-client-secret
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
#### Option C: Set env vars in your MCP config
|
|
88
|
+
|
|
89
|
+
Add the credentials directly to your MCP configuration:
|
|
90
|
+
|
|
91
|
+
```json
|
|
92
|
+
{
|
|
93
|
+
"mcpServers": {
|
|
94
|
+
"google": {
|
|
95
|
+
"command": "google-tools-mcp",
|
|
96
|
+
"env": {
|
|
97
|
+
"GOOGLE_CLIENT_ID": "your-client-id",
|
|
98
|
+
"GOOGLE_CLIENT_SECRET": "your-client-secret"
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
(Requires `npm install -g google-tools-mcp` first: see [Step 3](#step-3-add-to-your-mcp-client) and the [Troubleshooting](#troubleshooting) section for why `npx` isn't used here.)
|
|
106
|
+
|
|
107
|
+
> **Credential lookup order:** env vars → `~/.config/google-tools-mcp/.env` → project root `.env` → `~/.config/google-tools-mcp/credentials.json` → project root `credentials.json`
|
|
108
|
+
|
|
109
|
+
</details>
|
|
110
|
+
|
|
110
111
|
### Step 3: Add to Your MCP Client
|
|
111
112
|
|
|
113
|
+
#### Local unpublished checkout
|
|
114
|
+
|
|
115
|
+
To call a local tool directly without publishing or using MCP transport, use
|
|
116
|
+
`local:tool`. This loads the unpublished checkout, registers the real tools in
|
|
117
|
+
memory, validates the arguments, and calls the tool's `execute` function:
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
npm run local:tool -- list
|
|
121
|
+
npm run local:tool -- help
|
|
122
|
+
npm run local:tool -- readDocument documentId=... format=markdown
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
For larger arguments, put JSON in a file and pass it with `@`:
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
npm run local:tool -- replaceDocumentWithMarkdown @args.json
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
> **Why `npm install -g` instead of `npx`?** The guided setup wizard installs the package globally and points your MCP client straight at it, instead of using `npx -y google-tools-mcp`. `npx` re-resolves the whole dependency tree on every single launch, which can take 30+ seconds on some machines (this package pulls in `fastmcp` + the full `googleapis` client library). That's long enough to lose the race against Claude Code's fixed 30s stdio MCP connection timeout. See [Troubleshooting](#troubleshooting) below if you're setting this up by hand.
|
|
132
|
+
|
|
133
|
+
First, install once:
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
npm install -g google-tools-mcp
|
|
137
|
+
```
|
|
138
|
+
|
|
112
139
|
#### Codex
|
|
113
140
|
|
|
114
141
|
```bash
|
|
115
|
-
codex mcp add google --
|
|
142
|
+
codex mcp add google -- google-tools-mcp
|
|
116
143
|
```
|
|
117
144
|
|
|
118
145
|
With env vars (Option C):
|
|
@@ -121,175 +148,427 @@ With env vars (Option C):
|
|
|
121
148
|
codex mcp add google \
|
|
122
149
|
--env GOOGLE_CLIENT_ID=your-client-id \
|
|
123
150
|
--env GOOGLE_CLIENT_SECRET=your-client-secret \
|
|
124
|
-
--
|
|
151
|
+
-- google-tools-mcp
|
|
125
152
|
```
|
|
126
153
|
|
|
127
154
|
#### Claude Code
|
|
128
155
|
|
|
129
156
|
**User-scope** (available in all projects):
|
|
130
|
-
|
|
131
|
-
```bash
|
|
132
|
-
claude mcp add -s user google --
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
**Project-scope** (available only in the current project):
|
|
136
|
-
|
|
137
|
-
```bash
|
|
138
|
-
claude mcp add google --
|
|
139
|
-
```
|
|
140
|
-
|
|
141
|
-
With env vars (Option C):
|
|
142
|
-
|
|
143
|
-
```bash
|
|
144
|
-
# User-scope
|
|
145
|
-
claude mcp add -s user google \
|
|
146
|
-
-e GOOGLE_CLIENT_ID=your-client-id \
|
|
147
|
-
-e GOOGLE_CLIENT_SECRET=your-client-secret \
|
|
148
|
-
--
|
|
149
|
-
|
|
150
|
-
# Project-scope
|
|
151
|
-
claude mcp add google \
|
|
152
|
-
-e GOOGLE_CLIENT_ID=your-client-id \
|
|
153
|
-
-e GOOGLE_CLIENT_SECRET=your-client-secret \
|
|
154
|
-
--
|
|
155
|
-
```
|
|
156
|
-
|
|
157
|
-
#### Project-Local Installation (with profile)
|
|
158
|
-
|
|
159
|
-
Via the `claude` CLI:
|
|
160
|
-
|
|
161
|
-
```bash
|
|
162
|
-
claude mcp add -s user google \
|
|
163
|
-
-e GOOGLE_MCP_PROFILE=myprofile \
|
|
164
|
-
--
|
|
165
|
-
```
|
|
166
|
-
|
|
167
|
-
Or manually in your `.mcp.json`:
|
|
168
|
-
|
|
169
|
-
```json
|
|
170
|
-
{
|
|
171
|
-
"mcpServers": {
|
|
172
|
-
"google": {
|
|
173
|
-
"command": "
|
|
174
|
-
"
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
{
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
### `
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
157
|
+
|
|
158
|
+
```bash
|
|
159
|
+
claude mcp add -s user google -- google-tools-mcp
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
**Project-scope** (available only in the current project):
|
|
163
|
+
|
|
164
|
+
```bash
|
|
165
|
+
claude mcp add google -- google-tools-mcp
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
With env vars (Option C):
|
|
169
|
+
|
|
170
|
+
```bash
|
|
171
|
+
# User-scope
|
|
172
|
+
claude mcp add -s user google \
|
|
173
|
+
-e GOOGLE_CLIENT_ID=your-client-id \
|
|
174
|
+
-e GOOGLE_CLIENT_SECRET=your-client-secret \
|
|
175
|
+
-- google-tools-mcp
|
|
176
|
+
|
|
177
|
+
# Project-scope
|
|
178
|
+
claude mcp add google \
|
|
179
|
+
-e GOOGLE_CLIENT_ID=your-client-id \
|
|
180
|
+
-e GOOGLE_CLIENT_SECRET=your-client-secret \
|
|
181
|
+
-- google-tools-mcp
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
#### Project-Local Installation (with profile)
|
|
185
|
+
|
|
186
|
+
Via the `claude` CLI:
|
|
187
|
+
|
|
188
|
+
```bash
|
|
189
|
+
claude mcp add -s user google \
|
|
190
|
+
-e GOOGLE_MCP_PROFILE=myprofile \
|
|
191
|
+
-- google-tools-mcp
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
Or manually in your `.mcp.json`:
|
|
195
|
+
|
|
196
|
+
```json
|
|
197
|
+
{
|
|
198
|
+
"mcpServers": {
|
|
199
|
+
"google": {
|
|
200
|
+
"command": "google-tools-mcp",
|
|
201
|
+
"env": {
|
|
202
|
+
"GOOGLE_MCP_PROFILE": "myprofile"
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
#### Other MCP clients
|
|
210
|
+
|
|
211
|
+
Add this to your MCP configuration (e.g., `.mcp.json`, `claude_desktop_config.json`):
|
|
212
|
+
|
|
213
|
+
```json
|
|
214
|
+
{
|
|
215
|
+
"mcpServers": {
|
|
216
|
+
"google": {
|
|
217
|
+
"command": "google-tools-mcp"
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
If using Option C, add an `"env"` block with your `GOOGLE_CLIENT_ID` and `GOOGLE_CLIENT_SECRET`.
|
|
224
|
+
|
|
225
|
+
<details>
|
|
226
|
+
<summary>Prefer <code>npx</code> anyway, or can't install globally?</summary>
|
|
227
|
+
|
|
228
|
+
Every example above works with `npx -y google-tools-mcp` in place of `google-tools-mcp` (e.g. `codex mcp add google -- npx -y google-tools-mcp`). It requires no global install, but pays npx's dependency-resolution cost on every launch: see [Troubleshooting](#troubleshooting) for what that costs you.
|
|
229
|
+
|
|
230
|
+
</details>
|
|
231
|
+
|
|
232
|
+
### Step 4: Authenticate
|
|
233
|
+
|
|
234
|
+
On your first tool call, the server will automatically open your browser for Google OAuth consent. Sign in and grant access — the token is saved to `~/.config/google-tools-mcp/token.json` for future use.
|
|
235
|
+
|
|
236
|
+
You can also run the auth flow manually anytime:
|
|
237
|
+
|
|
238
|
+
```bash
|
|
239
|
+
npx google-tools-mcp auth
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
### Multi-Account Support
|
|
243
|
+
|
|
244
|
+
Set the `GOOGLE_MCP_PROFILE` env var to use separate tokens per profile:
|
|
245
|
+
|
|
246
|
+
```json
|
|
247
|
+
{
|
|
248
|
+
"env": {
|
|
249
|
+
"GOOGLE_MCP_PROFILE": "work"
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
This stores tokens in `~/.config/google-tools-mcp/work/` instead of the default directory.
|
|
255
|
+
|
|
256
|
+
## Troubleshooting
|
|
257
|
+
|
|
258
|
+
### The `google` MCP server won't connect / "connection timed out"
|
|
259
|
+
|
|
260
|
+
**Symptom:** Claude Code (or another MCP client) reports that the `google` server failed to connect, timed out, or keeps disconnecting, with no other visible error. It may work sometimes and fail other times on the same machine.
|
|
261
|
+
|
|
262
|
+
**Cause:** If your MCP config launches the server with `npx -y google-tools-mcp`, `npx` re-resolves and verifies the entire dependency tree (this package pulls in `fastmcp` + the full `googleapis` client library, a large `node_modules`) on **every single launch**, not just the first. On some machines, especially Windows (likely antivirus real-time scanning of npm's file I/O during install/verify), this reliably takes 30-34 seconds, even when the exact version is already cached locally. Claude Code's stdio MCP connection timeout is a fixed 30 seconds, so `npx`-launched servers are right on the failure line and frequently lose the race.
|
|
263
|
+
|
|
264
|
+
Launching directly (`node dist/index.js`, or the global-install path below) is faster, but it is not a guarantee. Measured on one affected Windows machine on 2026-07-24, three runs each: `npx` took 23.0s, 25.3s and 24.6s, a direct `node` launch took 14.7s, 26.0s and 12.2s. So skipping `npx` is worth roughly 7 seconds on average and removes a large source of variance, but on a machine with slow disk I/O a direct launch can still come close to the limit. If it still times out after you switch, what is left is the cost of reading this package's dependency tree off disk, tracked in [issue #71](https://github.com/karthikcsq/google-tools-mcp/issues/71). Full writeup in [issue #46](https://github.com/karthikcsq/google-tools-mcp/issues/46).
|
|
265
|
+
|
|
266
|
+
**Where to look:** MCP clients that log per-server connection attempts will show the exact timing. For Claude Code, per-server logs live at:
|
|
267
|
+
|
|
268
|
+
- **Windows:** `%LOCALAPPDATA%\claude-cli-nodejs\Cache\<project-slug>\mcp-logs-google\*.jsonl`
|
|
269
|
+
- **macOS:** `~/Library/Caches/claude-cli-nodejs/<project-slug>/mcp-logs-google/*.jsonl`: the `claude-cli-nodejs` cache root and per-server log folder are corroborated by an independent user report ([anthropics/claude-code#18869](https://github.com/anthropics/claude-code/issues/18869)), though not confirmed with this exact server name
|
|
270
|
+
- **Linux:** `~/.cache/claude-cli-nodejs/<project-slug>/mcp-logs-google/*.jsonl` (same convention as macOS, under the XDG cache dir, and unconfirmed; if it's not there, check wherever `claude doctor` / your Claude Code version reports its cache directory)
|
|
271
|
+
|
|
272
|
+
Look for lines like `"Connection timeout triggered after ...ms"` or `"Successfully connected ... in ...ms"`. google-tools-mcp itself also logs its own startup time on the server's first ready line (e.g. `MCP Server running using stdio in 1123ms`), so if the server logs a fast startup but the client still reports a near-30000ms connection time, the delay is happening before the server process even starts, i.e. in `npx`, not in the server.
|
|
273
|
+
|
|
274
|
+
**Fix:** Install the package globally and point your MCP client directly at it instead of using `npx`:
|
|
275
|
+
|
|
276
|
+
```bash
|
|
277
|
+
npm install -g google-tools-mcp
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
Then use `google-tools-mcp` (no `npx`) as the MCP `command`: see [Step 3](#step-3-add-to-your-mcp-client) for exact commands per client. Running `npx -y google-tools-mcp setup` does this for you automatically: the guided setup wizard installs the package globally and points the MCP entry straight at it. If the global install isn't possible on your machine (e.g. no write access to the global npm directory), it falls back to `npx`, but only if `npx` is actually on PATH, since a machine that can't reach npm usually can't reach npx either. If `npx` isn't there either, it falls back to launching whichever copy of the package is running the wizard right now. If none of the three works, it stops, explains why, and writes nothing to your MCP config rather than leaving you with a command that can't run.
|
|
281
|
+
|
|
282
|
+
### Updates stop arriving after switching off `npx`
|
|
283
|
+
|
|
284
|
+
**Cause:** `npx -y google-tools-mcp` re-resolves to whatever is currently published on every launch, so it auto-updates by accident. The global-install path above trades that away for startup speed: your MCP client launches a fixed `node <path>` command that points at whatever was installed the moment you ran setup, and nothing else ever runs `npm install -g` again on its own. Left alone, a global-install user keeps running that same version forever, missing every release after it.
|
|
285
|
+
|
|
286
|
+
**Fix:** Update it yourself whenever you like:
|
|
287
|
+
|
|
288
|
+
```bash
|
|
289
|
+
npm install -g google-tools-mcp@latest
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
(or just re-run `npx -y google-tools-mcp setup`, which does the same install and re-points your MCP config). The server also helps you notice: on startup, after the MCP connection is already established, it makes a strictly time-boxed (2s), non-blocking, at-most-once-per-24-hours check against the npm registry for the latest published version, and logs a one-line warning if you're behind. This check runs after the connection handshake and is never awaited, so a slow or unreachable network can't delay or reintroduce the `npx` startup-timeout race this section is about; worst case, it just never gets to print the notice.
|
|
293
|
+
## Development / Contributing
|
|
294
|
+
|
|
295
|
+
`dist/` is the hand-edited source for this repository. It contains plain JavaScript; there is no TypeScript, bundler, or build step.
|
|
296
|
+
|
|
297
|
+
A few files under `dist/` still carry a leftover header comment naming a `src/*.ts` path (for example, `dist/types.js` starts with `// src/types.ts`) from before this repo was forked. No such source file exists here; treat the comment as stale and edit the `.js` file directly.
|
|
298
|
+
|
|
299
|
+
Run the server directly from a clone:
|
|
300
|
+
|
|
301
|
+
```bash
|
|
302
|
+
npm install
|
|
303
|
+
npm start
|
|
304
|
+
# Equivalent: node dist/index.js
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
To make an MCP client run the clone instead of the published package, use an absolute path in its configuration. Pin `command` to the absolute Node executable too, not a bare `node`: desktop and GUI MCP clients often launch with a minimal PATH that doesn't include `node` (this is especially common with nvm, volta, or fnm), even when `node` resolves fine in your own shell. Confirming `node` works in a terminal doesn't prove what the GUI client's process can resolve, since it may not inherit your shell's PATH at all, so hand it the resolved path directly. Get that path with:
|
|
308
|
+
|
|
309
|
+
```bash
|
|
310
|
+
node -p "process.execPath"
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
Then use that output as `command`:
|
|
314
|
+
|
|
315
|
+
```json
|
|
316
|
+
{
|
|
317
|
+
"mcpServers": {
|
|
318
|
+
"google": {
|
|
319
|
+
"command": "/absolute/path/to/node",
|
|
320
|
+
"args": ["/absolute/path/to/google-tools-mcp/dist/index.js"]
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
On Windows, write both paths with forward slashes (`C:/Users/you/google-tools-mcp/dist/index.js`) or escape backslashes (`C:\\Users\\...`) — a bare `C:\Users\...` is invalid JSON.
|
|
327
|
+
|
|
328
|
+
Alternatively, link the clone into npm's global executable directory, then configure the client with `"command": "google-tools-mcp"`. This has the same bare-command risk described above: a GUI client's PATH doesn't have to match your shell's, so after linking, resolve the absolute path once with `command -v google-tools-mcp` (macOS/Linux) or `where google-tools-mcp` (Windows) and put that path in `command` instead of the bare name.
|
|
329
|
+
|
|
330
|
+
```bash
|
|
331
|
+
cd /absolute/path/to/google-tools-mcp
|
|
332
|
+
npm install
|
|
333
|
+
npm link
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
Watch for source/runtime drift: editing a clone has no effect while the MCP client still launches `npx google-tools-mcp` or a separately installed global copy. Check the client's configured command and arguments, then use `command -v google-tools-mcp` (macOS/Linux) or `where google-tools-mcp` (Windows) to see which executable is selected. Restart the MCP client after changing its configuration or relinking.
|
|
337
|
+
|
|
338
|
+
## Tool Categories
|
|
339
|
+
|
|
340
|
+
### `files` (18 tools)
|
|
341
|
+
Google Drive file management and content reading.
|
|
342
|
+
|
|
343
|
+
`listDriveFiles`, `searchDocuments`, `getFileInfo`, `getFilePath`, `createFolder`, `listFolderContents`, `getFolderInfo`, `moveFile`, `copyFile`, `renameFile`, `deleteFile`, `createDocument`, `createDocumentFromTemplate`, `listSharedDrives`, `listSharedWithMe`, `downloadFile`, `readFile`, `searchFileContents`
|
|
344
|
+
|
|
345
|
+
### `documents` (22 tools)
|
|
346
|
+
Google Docs read/write/format with markdown support.
|
|
347
|
+
|
|
348
|
+
`readDocument`, `appendText`, `deleteRange`, `modifyText`, `findAndReplace`, `insertTable`, `insertTableWithData`, `insertPageBreak`, `insertImage`, `listTabs`, `addTab`, `renameTab`, `applyParagraphStyle`, `getFormatting`, `addComment`, `deleteComment`, `getComment`, `listComments`, `replyToComment`, `resolveComment`, `appendMarkdown`, `replaceDocumentWithMarkdown`
|
|
349
|
+
|
|
350
|
+
### `spreadsheets` (29 tools)
|
|
351
|
+
Google Sheets operations.
|
|
352
|
+
|
|
353
|
+
`readSpreadsheet`, `writeSpreadsheet`, `batchWrite`, `appendRows`, `clearRange`, `createSpreadsheet`, `getSpreadsheetInfo`, `addSheet`, `deleteSheet`, `duplicateSheet`, `renameSheet`, `formatCells`, `readCellFormat`, `autoResizeColumns`, `freezeRowsAndColumns`, `setColumnWidths`, `addConditionalFormatting`, `copyFormatting`, `setDropdownValidation`, `createTable`, `deleteTable`, `getTable`, `listTables`, `appendTableRows`, `updateTableRange`, `insertChart`, `deleteChart`, `groupRows`, `ungroupAllRows`
|
|
354
|
+
|
|
355
|
+
### `email` (16 tools)
|
|
356
|
+
Gmail messages and drafts (hot-path tools stay granular).
|
|
357
|
+
|
|
358
|
+
`sendMessage`, `replyMessage`, `forwardMessage`, `getMessage`, `listMessages`, `modifyMessage`, `deleteMessage`, `trashMessage`, `batchGetMessages`, `getAttachment`, `createDraft`, `updateDraft`, `deleteDraft`, `getDraft`, `listDrafts`, `sendDraft`
|
|
359
|
+
|
|
360
|
+
### `email_threads` (6 tools)
|
|
361
|
+
Gmail thread-level operations.
|
|
362
|
+
|
|
363
|
+
`getThread`, `listThreads`, `batchGetThreads`, `modifyThread`, `deleteThread`, `trashThread`
|
|
364
|
+
|
|
365
|
+
### `email_labels` (1 tool)
|
|
366
|
+
Gmail label management, consolidated into one dispatch tool.
|
|
367
|
+
|
|
368
|
+
`manageLabel` (action: `create` | `patch` | `delete` | `get` | `list`)
|
|
369
|
+
|
|
370
|
+
### `email_settings` (6 tools)
|
|
371
|
+
Gmail admin and configuration, consolidated into dispatch tools.
|
|
372
|
+
|
|
373
|
+
`manageGmailSettings` (resource: `imap` | `pop` | `vacation` | `language` | `autoForwarding` | `forwardingAddress` | `delegate` | `sendAs`), `manageSmime`, `manageFilter`, `getProfile`, `watchMailbox`, `stopMailWatch`
|
|
374
|
+
|
|
375
|
+
### `calendar` (8 tools)
|
|
376
|
+
Google Calendar — events, availability, and calendar management.
|
|
377
|
+
|
|
378
|
+
`listCalendars`, `getEvents`, `manageEvent`, `getBusy`, `getFree`, `moveEvent`, `listRecurringEventInstances`, `manageCalendar`
|
|
379
|
+
|
|
380
|
+
> **Backward compatibility:** every former snake_case tool name (`get_imap`, `list_messages`, `manage_event`, …) is still available as a deprecated alias that forwards to its new implementation, but they are **opt-in, not loaded by default** — registering them by default would grow the tool surface these issues exist to shrink. Set `GOOGLE_MCP_ENABLE_LEGACY_ALIASES=true` to register them. See [Gmail tool migration](#gmail-tool-migration-snake_case--camelcase).
|
|
381
|
+
|
|
382
|
+
### `forms` (6 tools)
|
|
383
|
+
Google Forms — create/read forms, manage responses, and publish settings.
|
|
384
|
+
|
|
385
|
+
`create_form`, `get_form`, `batch_update_form`, `get_form_response`, `list_form_responses`, `set_publish_settings`
|
|
386
|
+
|
|
387
|
+
### `maps` (6 tools)
|
|
388
|
+
Google Maps and Places tools for geocoding, reverse geocoding, nearby and text search, place details, and directions.
|
|
389
|
+
|
|
390
|
+
`mapsGeocode`, `mapsReverseGeocode`, `mapsSearchNearby`, `mapsSearchPlaces`, `mapsPlaceDetails`, `mapsDirections`
|
|
391
|
+
|
|
392
|
+
These tools require `GOOGLE_MAPS_API_KEY`, a Google Maps Platform API key, separate from the Google OAuth credentials used everywhere else and not covered by the setup wizard or by [Step 1](#step-1-create-google-oauth-credentials) above. To get one: enable the **Geocoding API**, **Places API (New)**, and **Routes API** for your Google Cloud project, then go to **Credentials** → **Create Credentials** → **API key**, and set it as `GOOGLE_MAPS_API_KEY`. Without it, the `maps` tools are still listed, but calling any of them fails with a clear error telling you to set the key.
|
|
393
|
+
|
|
394
|
+
## Local Working Copies
|
|
395
|
+
|
|
396
|
+
`readDocument` (markdown format) saves what it reads to a local working-copy file, keyed by document ID and tab, so you can edit that file directly and push it back with `replaceDocumentWithMarkdown` using `filePath` instead of pasting content inline. `replaceDocumentWithMarkdown` also mirrors any inline `markdown=` push into that same file, so it always reflects what's actually on the document.
|
|
397
|
+
|
|
398
|
+
If the document contains content markdown can't represent (images, footnotes, a generated table of contents, or other Docs elements with no markdown equivalent), `readDocument` appends a warning after the markdown listing exactly what a full `replaceDocumentWithMarkdown` push would permanently remove. Use `modifyText` or `appendMarkdown` instead for those documents.
|
|
399
|
+
|
|
400
|
+
These files live in a per-user directory under the OS temp dir (`google-tools-mcp-<user>`), created with restrictive permissions and checked on every write so a planted symlink is refused rather than followed. Set `GOOGLE_MCP_WORKSPACE_DIR` to use a different directory instead.
|
|
401
|
+
|
|
402
|
+
## Environment Variables
|
|
403
|
+
|
|
404
|
+
| Variable | Required | Description |
|
|
405
|
+
|---|---|---|
|
|
406
|
+
| `GOOGLE_CLIENT_ID` | No* | OAuth 2.0 Client ID |
|
|
407
|
+
| `GOOGLE_CLIENT_SECRET` | No* | OAuth 2.0 Client Secret |
|
|
408
|
+
| `GOOGLE_MCP_PROFILE` | No | Profile name for multi-account support (see above) |
|
|
409
|
+
| `GOOGLE_MCP_TRANSPORT` | No | `stdio` (default) or `http`. Use `http` to run one shared server (see [Shared HTTP mode](#shared-http-mode-one-server-for-many-clients)) |
|
|
410
|
+
| `GOOGLE_MCP_PORT` | No | Port for HTTP transport (default `3939`) |
|
|
411
|
+
| `GOOGLE_MCP_ENDPOINT` | No | URL path for HTTP transport (default `/mcp`) |
|
|
412
|
+
| `GOOGLE_MCP_HTTP_TOKEN` | No | Bearer token required by HTTP clients. If unset in HTTP mode, a one-time token is generated and printed to stderr at startup. Set a fixed value to keep it stable across restarts |
|
|
413
|
+
| `GOOGLE_MCP_HTTP_HOST` | No | Bind address for HTTP transport (default `127.0.0.1`, loopback only). Change only if you deliberately need remote access |
|
|
414
|
+
| `GOOGLE_MCP_HTTP_ALLOWED_ORIGINS` | No | Comma-separated extra `Origin` values to accept (loopback origins are always allowed). Requests with a foreign browser `Origin` are otherwise rejected |
|
|
415
|
+
| `GOOGLE_MCP_HTTP_NO_AUTH` | No | Set to `1` to disable the bearer-token requirement. Only safe when you fully trust every process on the machine |
|
|
416
|
+
| `LOG_LEVEL` | No | `debug`, `info`, `warn`, `error`, or `silent` |
|
|
417
|
+
| `GOOGLE_MCP_LOG_FILE` | No | Set to `1` to log to `~/.config/google-tools-mcp/server.log`, or set to a custom file path |
|
|
418
|
+
| `GOOGLE_MCP_ENABLE_LEGACY_ALIASES` | No | Set to `true` to register the deprecated snake_case tool aliases (off by default; see [Gmail tool migration](#gmail-tool-migration-snake_case--camelcase)) |
|
|
419
|
+
| `GOOGLE_MCP_WORKSPACE_DIR` | No | Overrides where local working copies of Google Docs are saved (see [Local working copies](#local-working-copies)). Defaults to a per-user directory under the OS temp dir |
|
|
420
|
+
| `SERVICE_ACCOUNT_PATH` | No | Path to service account JSON key (alternative to OAuth) |
|
|
421
|
+
| `GOOGLE_IMPERSONATE_USER` | No | Email to impersonate with service account |
|
|
422
|
+
| `GOOGLE_MCP_NO_UPDATE_CHECK` | No | Set to any value to skip the background check for a newer published version |
|
|
423
|
+
| `NO_UPDATE_NOTIFIER` | No | Same effect as `GOOGLE_MCP_NO_UPDATE_CHECK`, following the npm-ecosystem-standard opt-out name from the `update-notifier` package |
|
|
424
|
+
| `GOOGLE_MAPS_API_KEY` | No | Google Maps Platform API key (separate from OAuth). Without it, `maps` tools remain listed but fail with a clear error when called |
|
|
425
|
+
|
|
426
|
+
\* Not required as env vars if you provide credentials via `.env` file or `credentials.json` (see [Step 2](#step-2-provide-your-credentials)).
|
|
427
|
+
|
|
428
|
+
The background version check is also skipped automatically when `CI` is set to anything other than `false`, so automated test runs never make an unannounced outbound call.
|
|
429
|
+
|
|
430
|
+
## Shared HTTP mode (one server for many clients)
|
|
431
|
+
|
|
432
|
+
By default the server uses **stdio** transport: each MCP client spawns its own
|
|
433
|
+
`google-tools-mcp` process. If you run several clients at once (e.g. many editor
|
|
434
|
+
or agent sessions), that's one Node process per session, each holding memory.
|
|
435
|
+
|
|
436
|
+
Set `GOOGLE_MCP_TRANSPORT=http` to instead run a **single long-lived server**
|
|
437
|
+
that every client shares over a loopback URL — one process regardless of how
|
|
438
|
+
many clients connect:
|
|
439
|
+
|
|
440
|
+
```bash
|
|
441
|
+
# start one shared server (keep it running; e.g. a login item or service)
|
|
442
|
+
GOOGLE_MCP_TRANSPORT=http GOOGLE_MCP_PORT=3939 GOOGLE_MCP_HTTP_TOKEN=your-secret google-tools-mcp
|
|
443
|
+
```
|
|
444
|
+
|
|
445
|
+
Then point each client at the URL, sending the token as a bearer header:
|
|
446
|
+
|
|
447
|
+
```json
|
|
448
|
+
{
|
|
449
|
+
"mcpServers": {
|
|
450
|
+
"google": {
|
|
451
|
+
"type": "http",
|
|
452
|
+
"url": "http://127.0.0.1:3939/mcp",
|
|
453
|
+
"headers": { "Authorization": "Bearer your-secret" }
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
```
|
|
458
|
+
|
|
459
|
+
### Security
|
|
460
|
+
|
|
461
|
+
The HTTP endpoint exposes your **authenticated** Google Workspace tool surface
|
|
462
|
+
(Gmail, Drive, Calendar, Docs, …). It is guarded so it can't be driven by other
|
|
463
|
+
processes or by web pages on your machine:
|
|
464
|
+
|
|
465
|
+
- **Bearer token required, on every route.** Every request must send
|
|
466
|
+
`Authorization: Bearer <token>`, including the `GET` that attaches to a session's
|
|
467
|
+
event stream, the `DELETE` that terminates one, and the legacy SSE compatibility
|
|
468
|
+
routes (`/sse` and its `/messages` POST endpoint) that FastMCP's HTTP transport
|
|
469
|
+
always stands up alongside the configured endpoint, whatever `GOOGLE_MCP_ENDPOINT`
|
|
470
|
+
is set to — there is no way to disable them, so they're guarded instead. A leaked
|
|
471
|
+
session id on its own gets nobody in. Set `GOOGLE_MCP_HTTP_TOKEN`; if you don't, a
|
|
472
|
+
random one-time token is generated and printed to stderr at startup (printed
|
|
473
|
+
directly, so it still appears under `LOG_LEVEL=error` or `LOG_LEVEL=silent`).
|
|
474
|
+
Requests without a valid token get `401`. (`GOOGLE_MCP_HTTP_NO_AUTH=1` disables
|
|
475
|
+
this — only on a fully trusted machine.) The `/ping` health endpoint stays open.
|
|
476
|
+
- **Loopback only.** Binds to `127.0.0.1` by default, so the port isn't reachable
|
|
477
|
+
from the network. Override with `GOOGLE_MCP_HTTP_HOST` only if you know you need
|
|
478
|
+
to. Startup refuses to run (and exits non-zero) if `GOOGLE_MCP_HTTP_NO_AUTH=1` is
|
|
479
|
+
combined with a non-loopback host such as `0.0.0.0` or `::` — that combination
|
|
480
|
+
would be a remotely reachable, completely unauthenticated server — and refuses an
|
|
481
|
+
empty or whitespace-only host as well.
|
|
482
|
+
- **Origin checked.** Requests carrying a non-loopback browser `Origin` are
|
|
483
|
+
rejected (DNS-rebinding protection). Add trusted origins via
|
|
484
|
+
`GOOGLE_MCP_HTTP_ALLOWED_ORIGINS` if needed.
|
|
485
|
+
|
|
486
|
+
Notes:
|
|
487
|
+
- The shared server does **not** start or stop with your clients — you manage
|
|
488
|
+
its lifecycle (start it at login / run it as a service).
|
|
489
|
+
- Each connecting client gets its own MCP session, and per-session state (such as
|
|
490
|
+
the read-before-edit guard) is isolated between clients. They still share one
|
|
491
|
+
process and one OAuth/token state, so a crash or token expiry affects everyone.
|
|
492
|
+
- Auth (`google-tools-mcp auth` / `setup`) is unchanged and still uses stdio.
|
|
493
|
+
|
|
494
|
+
## Migrating from gdrive-tools-mcp / gmail-tools-mcp
|
|
495
|
+
|
|
496
|
+
This package replaces both [`gdrive-tools-mcp`](https://www.npmjs.com/package/gdrive-tools-mcp) and [`gmail-tools-mcp`](https://www.npmjs.com/package/gmail-tools-mcp). To migrate:
|
|
497
|
+
|
|
498
|
+
1. Replace both MCP server entries with a single `google-tools-mcp` entry
|
|
499
|
+
2. Re-authenticate (the combined server uses its own config dir at `~/.config/google-tools-mcp/`)
|
|
500
|
+
3. All tools are available immediately — no discovery step needed
|
|
501
|
+
|
|
502
|
+
## Gmail tool migration (snake_case → camelCase)
|
|
503
|
+
|
|
504
|
+
Gmail and Calendar tools were unified to camelCase, and the rarely-used Gmail
|
|
505
|
+
account-config tools were consolidated into dispatch tools. **Every old name
|
|
506
|
+
still works** as a deprecated alias that forwards to the new implementation,
|
|
507
|
+
but the aliases are **opt-in** — they are not registered by default, since
|
|
508
|
+
loading all 72 of them alongside the new camelCase + dispatch tools would grow
|
|
509
|
+
the default tool surface instead of shrinking it. Set
|
|
510
|
+
`GOOGLE_MCP_ENABLE_LEGACY_ALIASES=true` if you still depend on the old
|
|
511
|
+
snake_case names.
|
|
512
|
+
|
|
513
|
+
### Renamed (behavior and parameters unchanged)
|
|
514
|
+
|
|
515
|
+
| Old name | New name |
|
|
516
|
+
|---|---|
|
|
517
|
+
| `send_message` | `sendMessage` |
|
|
518
|
+
| `reply_message` | `replyMessage` |
|
|
519
|
+
| `forward_message` | `forwardMessage` |
|
|
520
|
+
| `get_message` | `getMessage` |
|
|
521
|
+
| `list_messages` | `listMessages` |
|
|
522
|
+
| `modify_message` | `modifyMessage` |
|
|
523
|
+
| `delete_message` | `deleteMessage` |
|
|
524
|
+
| `trash_message` | `trashMessage` |
|
|
525
|
+
| `batch_get_messages` | `batchGetMessages` |
|
|
526
|
+
| `get_attachment` | `getAttachment` |
|
|
527
|
+
| `create_draft` | `createDraft` |
|
|
528
|
+
| `update_draft` | `updateDraft` |
|
|
529
|
+
| `delete_draft` | `deleteDraft` |
|
|
530
|
+
| `get_draft` | `getDraft` |
|
|
531
|
+
| `list_drafts` | `listDrafts` |
|
|
532
|
+
| `send_draft` | `sendDraft` |
|
|
533
|
+
| `get_thread` | `getThread` |
|
|
534
|
+
| `list_threads` | `listThreads` |
|
|
535
|
+
| `batch_get_threads` | `batchGetThreads` |
|
|
536
|
+
| `modify_thread` | `modifyThread` |
|
|
537
|
+
| `delete_thread` | `deleteThread` |
|
|
538
|
+
| `trash_thread` | `trashThread` |
|
|
539
|
+
| `get_profile` | `getProfile` |
|
|
540
|
+
| `watch_mailbox` | `watchMailbox` |
|
|
541
|
+
| `stop_mail_watch` | `stopMailWatch` |
|
|
542
|
+
| `list_calendars` | `listCalendars` |
|
|
543
|
+
| `get_events` | `getEvents` |
|
|
544
|
+
| `manage_event` | `manageEvent` |
|
|
545
|
+
| `get_busy` | `getBusy` |
|
|
546
|
+
| `get_free` | `getFree` |
|
|
547
|
+
| `move_event` | `moveEvent` |
|
|
548
|
+
| `list_recurring_event_instances` | `listRecurringEventInstances` |
|
|
549
|
+
| `manage_calendar` | `manageCalendar` |
|
|
550
|
+
|
|
551
|
+
### Consolidated into dispatch tools
|
|
552
|
+
|
|
553
|
+
| Old name(s) | New dispatch call |
|
|
554
|
+
|---|---|
|
|
555
|
+
| `get_imap` / `update_imap` | `manageGmailSettings` resource=`imap` action=`get`/`update` |
|
|
556
|
+
| `get_pop` / `update_pop` | `manageGmailSettings` resource=`pop` action=`get`/`update` |
|
|
557
|
+
| `get_vacation` / `update_vacation` | `manageGmailSettings` resource=`vacation` action=`get`/`update` |
|
|
558
|
+
| `get_language` / `update_language` | `manageGmailSettings` resource=`language` action=`get`/`update` |
|
|
559
|
+
| `get_auto_forwarding` / `update_auto_forwarding` | `manageGmailSettings` resource=`autoForwarding` action=`get`/`update` |
|
|
560
|
+
| `list_forwarding_addresses` / `get_forwarding_address` / `create_forwarding_address` / `delete_forwarding_address` | `manageGmailSettings` resource=`forwardingAddress` action=`list`/`get`/`create`/`delete` |
|
|
561
|
+
| `list_delegates` / `get_delegate` / `add_delegate` / `remove_delegate` | `manageGmailSettings` resource=`delegate` action=`list`/`get`/`create`/`delete` |
|
|
562
|
+
| `list_send_as` / `get_send_as` / `create_send_as` / `patch_send_as` / `update_send_as` / `delete_send_as` / `verify_send_as` | `manageGmailSettings` resource=`sendAs` action=`list`/`get`/`create`/`patch`/`update`/`delete`/`verify` |
|
|
563
|
+
| `list_smime_info` / `get_smime_info` / `insert_smime_info` / `delete_smime_info` / `set_default_smime_info` | `manageSmime` action=`list`/`get`/`insert`/`delete`/`setDefault` |
|
|
564
|
+
| `list_filters` / `get_filter` / `create_filter` / `delete_filter` | `manageFilter` action=`list`/`get`/`create`/`delete` |
|
|
565
|
+
| `list_labels` / `get_label` / `create_label` / `patch_label` / `delete_label` | `manageLabel` action=`list`/`get`/`create`/`patch`/`delete` |
|
|
566
|
+
|
|
567
|
+
## License
|
|
568
|
+
|
|
569
|
+
MIT
|
|
570
|
+
|
|
571
|
+
## Releasing
|
|
572
|
+
|
|
573
|
+
Maintainers: see [RELEASING.md](RELEASING.md) for the tag-triggered npm
|
|
574
|
+
publishing workflow and its one-time trusted-publisher setup.
|