get-claudia 1.54.1 → 1.54.3

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.
@@ -0,0 +1,69 @@
1
+ /**
2
+ * Google Workspace MCP setup logic.
3
+ * Extracted as a module so it can be tested independently from the interactive CLI.
4
+ */
5
+
6
+ import { existsSync, readFileSync, writeFileSync } from 'node:fs';
7
+ import { join } from 'node:path';
8
+
9
+ /**
10
+ * Detect old Google MCP server entries in .mcp.json.
11
+ * Returns { hasOldGmail, hasOldCalendar, hasWorkspace }.
12
+ */
13
+ export function detectOldGoogleMcp(targetPath) {
14
+ const mcpPath = join(targetPath, '.mcp.json');
15
+ const result = { hasOldGmail: false, hasOldCalendar: false, hasWorkspace: false };
16
+
17
+ if (!existsSync(mcpPath)) return result;
18
+
19
+ try {
20
+ const config = JSON.parse(readFileSync(mcpPath, 'utf-8'));
21
+ const servers = config.mcpServers || {};
22
+ result.hasOldGmail = !!servers.gmail;
23
+ result.hasOldCalendar = !!servers['google-calendar'];
24
+ result.hasWorkspace = !!servers.google_workspace;
25
+ } catch {
26
+ // Malformed JSON
27
+ }
28
+
29
+ return result;
30
+ }
31
+
32
+ /**
33
+ * Add or update the google_workspace entry in .mcp.json.
34
+ * Removes old gmail and google-calendar entries if present.
35
+ * Creates .mcp.json if it doesn't exist.
36
+ */
37
+ export function setupGoogleWorkspace(targetPath, clientId, clientSecret, tier) {
38
+ const mcpPath = join(targetPath, '.mcp.json');
39
+ const effectiveTier = tier || 'core';
40
+
41
+ let config;
42
+ if (existsSync(mcpPath)) {
43
+ try {
44
+ config = JSON.parse(readFileSync(mcpPath, 'utf-8'));
45
+ } catch {
46
+ config = { mcpServers: {} };
47
+ }
48
+ } else {
49
+ config = { mcpServers: {} };
50
+ }
51
+
52
+ if (!config.mcpServers) config.mcpServers = {};
53
+
54
+ // Remove old entries
55
+ delete config.mcpServers.gmail;
56
+ delete config.mcpServers['google-calendar'];
57
+
58
+ // Add/update google_workspace
59
+ config.mcpServers.google_workspace = {
60
+ command: 'uvx',
61
+ args: ['workspace-mcp', '--tool-tier', effectiveTier],
62
+ env: {
63
+ GOOGLE_OAUTH_CLIENT_ID: clientId,
64
+ GOOGLE_OAUTH_CLIENT_SECRET: clientSecret,
65
+ },
66
+ };
67
+
68
+ writeFileSync(mcpPath, JSON.stringify(config, null, 2) + '\n');
69
+ }
package/bin/index.js CHANGED
@@ -6,6 +6,7 @@ import { fileURLToPath } from 'url';
6
6
  import { spawn } from 'child_process';
7
7
  import { homedir } from 'os';
8
8
  import { createInterface } from 'readline';
9
+ import { setupGoogleWorkspace, detectOldGoogleMcp } from './google-setup.js';
9
10
 
10
11
  const __filename = fileURLToPath(import.meta.url);
11
12
  const __dirname = dirname(__filename);
@@ -501,6 +502,12 @@ async function main() {
501
502
  const filteredArgs = args.filter(a => a !== '--no-memory' && a !== '--yes' && a !== '-y');
502
503
  const arg = filteredArgs[0];
503
504
 
505
+ // ─── Subcommand: get-claudia google ─────────────────────────────────────
506
+ if (arg === 'google') {
507
+ await runGoogleSetup();
508
+ process.exit(0);
509
+ }
510
+
504
511
  // Support "." or "upgrade" for current directory
505
512
  const isCurrentDir = arg === '.' || arg === 'upgrade';
506
513
  const targetDir = isCurrentDir ? '.' : (arg || 'claudia');
@@ -1124,7 +1131,7 @@ function restoreMcpServers(targetPath) {
1124
1131
 
1125
1132
  // Path 1: Restore from _disabled_mcpServers stash (older migration format)
1126
1133
  if (config._disabled_mcpServers) {
1127
- const toRestore = ['claudia-memory', 'claudia_memory', 'gmail', 'google-calendar'];
1134
+ const toRestore = ['claudia-memory', 'claudia_memory'];
1128
1135
  for (const key of toRestore) {
1129
1136
  if (config._disabled_mcpServers[key] && !config.mcpServers[key]) {
1130
1137
  const serverConfig = { ...config._disabled_mcpServers[key] };
@@ -1384,12 +1391,22 @@ See the memory-manager skill for the full tool reference.`;
1384
1391
  // skill-index.json not found, skip skills section
1385
1392
  }
1386
1393
 
1394
+ const googleSection = `## Google Workspace Integration (New!)
1395
+
1396
+ Claudia can now connect to your full Google Workspace: Gmail, Calendar, Drive, Docs, Sheets, Tasks, and more through one server.
1397
+
1398
+ **Quick setup:** Run \`npx get-claudia google\` to configure it interactively.
1399
+
1400
+ Or see the Google Integration Setup section in CLAUDE.md for manual configuration.`;
1401
+
1387
1402
  const content = `# Updated to v${version} (${date})
1388
1403
 
1389
1404
  ## What's New
1390
1405
 
1391
1406
  ${changelogSection}
1392
1407
 
1408
+ ${googleSection}
1409
+
1393
1410
  ${skillSections}
1394
1411
 
1395
1412
  ---
@@ -1403,4 +1420,104 @@ _Surface this update in your first greeting, then delete this file._
1403
1420
  }
1404
1421
  }
1405
1422
 
1423
+ // ─── Google Workspace Setup Command ──────────────────────────────────────────
1424
+
1425
+ function prompt(question) {
1426
+ if (!isTTY) return Promise.resolve('');
1427
+ return new Promise((resolve) => {
1428
+ const rl = createInterface({ input: process.stdin, output: process.stdout });
1429
+ rl.question(` ${question} `, (answer) => {
1430
+ rl.close();
1431
+ resolve(answer.trim());
1432
+ });
1433
+ });
1434
+ }
1435
+
1436
+ async function runGoogleSetup() {
1437
+ const targetPath = process.cwd();
1438
+
1439
+ console.log('');
1440
+ console.log(` ${colors.boldCyan}Google Workspace Setup${colors.reset}`);
1441
+ console.log(` ${colors.dim}Connect Gmail, Calendar, Drive, Docs, Sheets, Tasks, and more${colors.reset}`);
1442
+ console.log('');
1443
+
1444
+ // Check for uvx using spawn (safe, no shell injection)
1445
+ try {
1446
+ await new Promise((resolve, reject) => {
1447
+ const child = spawn('uvx', ['--version'], { stdio: 'ignore' });
1448
+ child.on('close', (code) => code === 0 ? resolve() : reject());
1449
+ child.on('error', reject);
1450
+ });
1451
+ } catch {
1452
+ console.log(` ${colors.red}!${colors.reset} uvx is not installed. Install it first:`);
1453
+ console.log(` ${colors.cyan}pip install uv${colors.reset} or ${colors.cyan}brew install uv${colors.reset}`);
1454
+ process.exit(1);
1455
+ }
1456
+
1457
+ // Detect existing state
1458
+ const state = detectOldGoogleMcp(targetPath);
1459
+
1460
+ if (state.hasOldGmail || state.hasOldCalendar) {
1461
+ console.log(` ${colors.yellow}→${colors.reset} Found old Gmail/Calendar MCP servers. These will be replaced.`);
1462
+ console.log(` ${colors.dim}Same GCP credentials work with the new server.${colors.reset}`);
1463
+ console.log('');
1464
+ }
1465
+
1466
+ if (state.hasWorkspace) {
1467
+ const overwrite = await confirm('Google Workspace MCP is already configured. Reconfigure?');
1468
+ if (!overwrite) {
1469
+ console.log(` ${colors.dim}Keeping existing config.${colors.reset}`);
1470
+ return;
1471
+ }
1472
+ }
1473
+
1474
+ // Get credentials
1475
+ console.log(` ${colors.dim}You need a Google Cloud OAuth client (Desktop type).${colors.reset}`);
1476
+ console.log(` ${colors.dim}Create one at: https://console.cloud.google.com/apis/credentials${colors.reset}`);
1477
+ console.log('');
1478
+
1479
+ const clientId = await prompt(`${colors.cyan}Client ID:${colors.reset}`);
1480
+ if (!clientId) {
1481
+ console.log(` ${colors.red}!${colors.reset} Client ID is required.`);
1482
+ process.exit(1);
1483
+ }
1484
+
1485
+ const clientSecret = await prompt(`${colors.cyan}Client Secret:${colors.reset}`);
1486
+ if (!clientSecret) {
1487
+ console.log(` ${colors.red}!${colors.reset} Client Secret is required.`);
1488
+ process.exit(1);
1489
+ }
1490
+
1491
+ // Pick tier
1492
+ console.log('');
1493
+ console.log(` ${colors.boldCyan}Tool tiers:${colors.reset}`);
1494
+ console.log(` ${colors.green}core${colors.reset} 43 tools Gmail, Calendar, Drive, Contacts ${colors.dim}(recommended)${colors.reset}`);
1495
+ console.log(` ${colors.yellow}extended${colors.reset} 83 tools + Docs, Sheets, Tasks, Chat`);
1496
+ console.log(` ${colors.magenta}complete${colors.reset} 111 tools + Slides, Forms, Apps Script`);
1497
+ console.log('');
1498
+
1499
+ const tierInput = await prompt(`${colors.cyan}Tier${colors.reset} ${colors.dim}(core/extended/complete, default: core):${colors.reset}`);
1500
+ const tier = ['core', 'extended', 'complete'].includes(tierInput) ? tierInput : 'core';
1501
+
1502
+ // Write config
1503
+ setupGoogleWorkspace(targetPath, clientId, clientSecret, tier);
1504
+
1505
+ console.log('');
1506
+ console.log(` ${colors.green}✓${colors.reset} Google Workspace MCP configured (${colors.bold}${tier}${colors.reset} tier)`);
1507
+
1508
+ if (state.hasOldGmail || state.hasOldCalendar) {
1509
+ console.log(` ${colors.green}✓${colors.reset} Old Gmail/Calendar entries removed`);
1510
+ }
1511
+
1512
+ console.log('');
1513
+ console.log(` ${colors.boldYellow}Next steps:${colors.reset}`);
1514
+ console.log(` 1. Enable APIs in your GCP project: Gmail, Calendar, Drive, etc.`);
1515
+ console.log(` ${colors.dim}https://console.cloud.google.com/apis/library${colors.reset}`);
1516
+ console.log(` 2. Restart Claude Code`);
1517
+ console.log(` 3. First run will open your browser for Google sign-in`);
1518
+ console.log('');
1519
+ console.log(` ${colors.dim}Try: "check my inbox", "what's on my calendar", "search my Drive for..."${colors.reset}`);
1520
+ console.log('');
1521
+ }
1522
+
1406
1523
  main();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "get-claudia",
3
- "version": "1.54.1",
3
+ "version": "1.54.3",
4
4
  "description": "An AI assistant who learns how you work.",
5
5
  "keywords": [
6
6
  "claudia",
@@ -6,15 +6,19 @@
6
6
  "_description": "Claudia memory system with vector search",
7
7
  "_setup": "Auto-configured by the installer (npx get-claudia). The installer creates a Python venv at ~/.claudia/daemon/venv/ and sets the correct command path in .mcp.json automatically."
8
8
  },
9
- "gmail": {
10
- "command": "npx",
11
- "args": ["-y", "@gongrzhe/server-gmail-autoauth-mcp"],
12
- "_setup": "Requires your own Google Cloud credentials. See Google Integration Setup in CLAUDE.md, then run: npx @gongrzhe/server-gmail-autoauth-mcp auth"
13
- },
14
- "google-calendar": {
15
- "command": "npx",
16
- "args": ["-y", "@gongrzhe/server-calendar-autoauth-mcp"],
17
- "_setup": "Requires your own Google Cloud credentials. See Google Integration Setup in CLAUDE.md, then run: npx @gongrzhe/server-calendar-autoauth-mcp auth"
9
+ "google_workspace": {
10
+ "command": "uvx",
11
+ "args": ["workspace-mcp", "--tool-tier", "core"],
12
+ "env": {
13
+ "GOOGLE_OAUTH_CLIENT_ID": "",
14
+ "GOOGLE_OAUTH_CLIENT_SECRET": ""
15
+ },
16
+ "_setup": "Google Workspace MCP: Gmail, Calendar, Drive, Docs, Sheets, Tasks, and more in one server. Requires Google Cloud OAuth credentials. See Google Integration Setup in CLAUDE.md. Tool tiers: core (43 tools), extended (83), complete (111). Start with core.",
17
+ "_tiers": {
18
+ "core": "Gmail, Calendar, Drive, Contacts (43 tools, recommended default)",
19
+ "extended": "Adds Docs, Sheets, Tasks, Chat (83 tools)",
20
+ "complete": "All services including Slides, Forms, Apps Script (111 tools)"
21
+ }
18
22
  },
19
23
  "rube": {
20
24
  "type": "http",
@@ -29,7 +33,7 @@
29
33
 
30
34
  "_notes": {
31
35
  "memory": "Claudia's memory is powered by the claudia-memory daemon (Python MCP server). It provides ~33 tools for semantic search, pattern detection, and relationship tracking. The installer (npx get-claudia) automatically sets up the daemon in a Python venv at ~/.claudia/daemon/venv/ and configures .mcp.json.",
32
- "gmail_and_calendar": "Gmail and Calendar are enabled by default as stdio MCP servers. Each requires Google Cloud credentials (see Google Integration Setup in CLAUDE.md). Alternatively, connect them through Rube (HTTP) for a simpler setup.",
36
+ "google_workspace": "Google Workspace uses the workspace-mcp server (taylorwilsdon/google_workspace_mcp). One server covers Gmail, Calendar, Drive, Docs, Sheets, Tasks, and more. Tool tiers control context usage. See Google Integration Setup in CLAUDE.md.",
33
37
  "rube": "Rube (by Composio) connects 500+ apps through one HTTP MCP connection. Each user creates their own free Rube account at rube.app. See the Rube section in CLAUDE.md for setup and troubleshooting.",
34
38
  "security": "Each user authenticates with their own accounts and credentials. OAuth tokens are stored locally on your machine, never shared.",
35
39
  "not_included": {
@@ -319,12 +319,10 @@ I adapt to whatever tools are available. When you ask me to do something that ne
319
319
 
320
320
  **Obsidian vault:** My memory syncs to an Obsidian vault at `~/.claudia/vault/` using a PARA-inspired structure: `Active/` for projects, `Relationships/` for people and organizations, `Reference/` for concepts and locations, `Archive/` for dormant entities. Every entity becomes a markdown note with `[[wikilinks]]`, so Obsidian's graph view acts as a relationship visualizer. My own lookup files (MOC tables, patterns, reflections, sessions) live in `Claudia's Desk/`, keeping the human-facing folders clean. The vault syncs on-demand via `claudia vault sync`. SQLite remains the source of truth; the vault is a read projection.
321
321
 
322
- **Gmail and Calendar (MCP):** Gmail and Calendar are provided by third-party MCP servers that each user authenticates with their own Google Cloud credentials. When these MCPs are connected, I have access to tools like `search_emails`, `read_email`, `send_email`, `list_events`, `search_events`, etc. I use these tools naturally when you ask me to check email, send messages, or look at your calendar.
322
+ **Google Workspace (MCP):** Google Workspace is provided by the workspace-mcp server ([taylorwilsdon/google_workspace_mcp](https://github.com/taylorwilsdon/google_workspace_mcp)). One server covers Gmail, Calendar, Drive, Docs, Sheets, Tasks, Contacts, and more. Tool tiers control how many tools are exposed: `--tool-tier core` (43 tools, default), `--tool-tier extended` (83 tools), or `--tool-tier complete` (111 tools). When connected, I have access to Gmail, Calendar, Drive, Docs, Sheets, Tasks, and more. I use these tools naturally when you ask me to check email, send messages, look at your calendar, search Drive, or work with documents.
323
323
 
324
324
  If the MCP tools aren't responding or you see authentication errors, the user needs to set up their Google Cloud credentials. See the **Google Integration Setup** section below.
325
325
 
326
- **Alternative:** CLI commands (`claudia gmail search`, `claudia calendar list`, etc.) are also available as a fallback. These require separate authentication via `claudia google login`.
327
-
328
326
  **Rube (500+ Apps):** Rube (by Composio) is an optional MCP aggregator that connects Claudia to hundreds of apps through a single server. Each user creates their own free Rube account, connects the apps they want via one-click OAuth, and Claudia gets access to all of them through one MCP connection.
329
327
 
330
328
  If a user asks about connecting apps, integrations, or any of the services listed below, proactively suggest Rube as the easiest path. Walk them through setup step by step.
@@ -348,7 +346,7 @@ If a user asks about connecting apps, integrations, or any of the services liste
348
346
  | **Calendar** | Google Calendar, Outlook Calendar, Calendly |
349
347
  | **And 500+ more** | Browse the full list at [rube.app](https://rube.app) |
350
348
 
351
- **External integrations** (Gmail, Google Calendar, Rube, Brave Search) are optional add-ons that extend what I can see and do. I work fully without them. The core value is relationships and context.
349
+ **External integrations** (Google Workspace, Rube, Brave Search) are optional add-ons that extend what I can see and do. I work fully without them. The core value is relationships and context.
352
350
 
353
351
  ### Rube Setup (Guide Users Through This)
354
352
 
@@ -403,33 +401,41 @@ The MCP tools from Rube will have names like `SLACK_SEND_MESSAGE`, `NOTION_CREAT
403
401
  | Rate limited | Rube has usage limits on the free tier. The user may need to upgrade at rube.app/pricing. |
404
402
  | Want to disconnect an app | Go to Rube dashboard and disconnect the app there. No Claudia config changes needed. |
405
403
 
406
- **Rube vs. Individual MCPs:** Rube works alongside (not instead of) Gmail and Calendar MCPs. Individual MCPs give a direct connection with no intermediary but require per-service Google Cloud setup. Rube gives one setup for everything but routes data through Composio servers. Both can coexist. If a user has both Gmail MCP and Rube's Gmail connected, prefer the direct MCP tools.
404
+ **Rube vs. workspace-mcp:** Rube works alongside (not instead of) the workspace-mcp server. Workspace-mcp gives a direct connection with no intermediary but requires Google Cloud setup. Rube gives one setup for everything but routes data through Composio servers. Both can coexist. If a user has both workspace-mcp and Rube's Google apps connected, prefer the direct workspace-mcp tools.
407
405
 
408
406
  ### Google Integration Setup
409
407
 
410
- Gmail and Calendar MCP servers require your own Google Cloud credentials. Each user sets this up once:
408
+ The workspace-mcp server requires your own Google Cloud credentials. Each user sets this up once:
411
409
 
412
410
  1. Go to [Google Cloud Console](https://console.cloud.google.com/)
413
411
  2. Create a new project (or select an existing one)
414
- 3. Enable the **Gmail API** and/or **Google Calendar API**:
412
+ 3. Enable the APIs you need:
415
413
  - Go to APIs & Services > Library
416
- - Search for "Gmail API", click Enable
417
- - Search for "Google Calendar API", click Enable
414
+ - Search for and enable: **Gmail API**, **Google Calendar API**, **Google Drive API**, **Google Docs API**, **Google Sheets API**, **Google Tasks API**, **People API** (Contacts)
415
+ - You can enable more later as needed
418
416
  4. Create OAuth credentials:
419
417
  - Go to APIs & Services > Credentials
420
418
  - Click "Create Credentials" > "OAuth client ID"
421
419
  - If prompted, configure the consent screen first (External, add your email as test user)
422
420
  - Application type: **Desktop app**
423
- - Click Create, then download the JSON file
424
- 5. Rename the downloaded file to `gcp-oauth.keys.json`
425
- 6. Authenticate each service:
426
- ```bash
427
- npx @gongrzhe/server-gmail-autoauth-mcp auth
428
- npx @gongrzhe/server-calendar-autoauth-mcp auth
429
- ```
430
- Each command opens your browser for Google sign-in. Tokens are stored locally at `~/.gmail-mcp/` and `~/.calendar-mcp/`.
431
-
432
- After setup, restart Claude Code and the MCP servers will connect automatically.
421
+ - Click Create
422
+ - Copy the **Client ID** and **Client Secret**
423
+ 5. Add credentials to `.mcp.json`:
424
+ - Open `.mcp.json` in the project root
425
+ - Find the `google_workspace` server entry
426
+ - Set the `GOOGLE_CLIENT_ID` and `GOOGLE_CLIENT_SECRET` environment variables:
427
+ ```json
428
+ "env": {
429
+ "GOOGLE_CLIENT_ID": "your-client-id.apps.googleusercontent.com",
430
+ "GOOGLE_CLIENT_SECRET": "your-client-secret"
431
+ }
432
+ ```
433
+ 6. Choose your tool tier:
434
+ - The default is `--tool-tier core` (43 tools), which covers most needs
435
+ - For more capabilities, change to `--tool-tier extended` (83 tools) or `--tool-tier complete` (111 tools) in the server args
436
+ 7. Restart Claude Code. On first run, the server opens your browser for Google sign-in. Tokens are stored locally for future sessions.
437
+
438
+ **Migrating from the old setup:** If you previously used separate Gmail and Calendar MCP servers, the same GCP project works. Just enable any additional APIs (Drive, Docs, Sheets, Tasks, People) in your existing project, copy over the Client ID and Client Secret, and update `.mcp.json` to use the `google_workspace` server entry instead of the old individual entries.
433
439
 
434
440
  ---
435
441