google-tools-mcp 1.2.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/setup.js +52 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@ The **easiest way** to connect your AI agent to Google Workspace.
|
|
|
5
5
|
**153 tools** for Drive, Docs, Sheets, Gmail, Calendar, and Forms — all in one package. One install, one auth, and you're done.
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
|
|
8
|
+
npx -y google-tools-mcp setup
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
## Why google-tools-mcp?
|
package/dist/setup.js
CHANGED
|
@@ -4,7 +4,7 @@ import * as readline from 'readline';
|
|
|
4
4
|
import * as fs from 'fs/promises';
|
|
5
5
|
import * as path from 'path';
|
|
6
6
|
import * as os from 'os';
|
|
7
|
-
import { exec } from 'child_process';
|
|
7
|
+
import { exec, execSync } from 'child_process';
|
|
8
8
|
|
|
9
9
|
// ---------------------------------------------------------------------------
|
|
10
10
|
// Config
|
|
@@ -56,6 +56,24 @@ function getConfigDir() {
|
|
|
56
56
|
return profile ? path.join(baseDir, profile) : baseDir;
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
+
function hasCli(name) {
|
|
60
|
+
try {
|
|
61
|
+
execSync(`${name} --version`, { stdio: 'ignore' });
|
|
62
|
+
return true;
|
|
63
|
+
} catch {
|
|
64
|
+
return false;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function runCommand(cmd) {
|
|
69
|
+
return new Promise((resolve, reject) => {
|
|
70
|
+
exec(cmd, (err, stdout, stderr) => {
|
|
71
|
+
if (err) reject(new Error(stderr || err.message));
|
|
72
|
+
else resolve(stdout);
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
|
|
59
77
|
// ---------------------------------------------------------------------------
|
|
60
78
|
// Setup flow
|
|
61
79
|
// ---------------------------------------------------------------------------
|
|
@@ -117,7 +135,6 @@ export async function runSetup() {
|
|
|
117
135
|
console.log('\nStep 4: Authenticate with Google');
|
|
118
136
|
console.log('────────────────────────────────');
|
|
119
137
|
console.log('Opening browser for OAuth consent...\n');
|
|
120
|
-
rl.close();
|
|
121
138
|
|
|
122
139
|
// Set env vars so auth picks them up immediately
|
|
123
140
|
process.env.GOOGLE_CLIENT_ID = clientId;
|
|
@@ -126,7 +143,37 @@ export async function runSetup() {
|
|
|
126
143
|
const { runAuthFlow } = await import('./auth.js');
|
|
127
144
|
await runAuthFlow();
|
|
128
145
|
|
|
129
|
-
|
|
130
|
-
console.log('\
|
|
131
|
-
console.log('
|
|
146
|
+
// Step 6: Install into MCP client
|
|
147
|
+
console.log('\nStep 5: Install');
|
|
148
|
+
console.log('───────────────');
|
|
149
|
+
|
|
150
|
+
const hasClaude = hasCli('claude');
|
|
151
|
+
if (hasClaude) {
|
|
152
|
+
const answer = (await prompt(rl, 'Add to Claude Code as a user-scope MCP server? (Y/n) ')).trim().toLowerCase();
|
|
153
|
+
if (answer === '' || answer === 'y' || answer === 'yes') {
|
|
154
|
+
console.log('Running: claude mcp add -s user google -- npx -y google-tools-mcp');
|
|
155
|
+
try {
|
|
156
|
+
await runCommand('claude mcp add -s user google -- npx -y google-tools-mcp');
|
|
157
|
+
console.log('Added to Claude Code!');
|
|
158
|
+
} catch (err) {
|
|
159
|
+
console.error('Failed to add:', err.message);
|
|
160
|
+
console.log('You can add it manually:');
|
|
161
|
+
console.log(' claude mcp add -s user google -- npx -y google-tools-mcp');
|
|
162
|
+
}
|
|
163
|
+
} else {
|
|
164
|
+
console.log('\nTo add it later:');
|
|
165
|
+
console.log(' claude mcp add -s user google -- npx -y google-tools-mcp');
|
|
166
|
+
}
|
|
167
|
+
} else {
|
|
168
|
+
console.log('Add google-tools-mcp to your MCP client config:');
|
|
169
|
+
console.log('');
|
|
170
|
+
console.log(' Claude Code:');
|
|
171
|
+
console.log(' claude mcp add -s user google -- npx -y google-tools-mcp');
|
|
172
|
+
console.log('');
|
|
173
|
+
console.log(' Other clients (.mcp.json / claude_desktop_config.json):');
|
|
174
|
+
console.log(' { "mcpServers": { "google": { "command": "npx", "args": ["-y", "google-tools-mcp"] } } }');
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
rl.close();
|
|
178
|
+
console.log('\n✅ Setup complete! You\'re ready to use google-tools-mcp.\n');
|
|
132
179
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "google-tools-mcp",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"description": "The easiest MCP server for Google Workspace — Drive, Docs, Sheets, Gmail, Calendar, and Forms. 153 tools with one-click browser auth. Read Word docs, PDFs, and spreadsheets straight from Drive.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|