mcp-google-workspace
Production-oriented Google Workspace MCP package with:
- Gmail MCP: send/read/search emails, attachment handling, label management, batch operations.
- Google Calendar MCP: events, availability, create/update/delete operations.
- Google Drive MCP: files/folders CRUD, uploads/downloads/exports, sharing permissions, Shared Drives operations.
- Google Sheets MCP: spreadsheet metadata, values reads/writes, and raw batch updates.
- Google Docs MCP: document fetch/create flows plus convenience text mutations and raw batch updates.
- Google Tasks MCP: task lists, tasks, completion, movement, and deletion.
- Google People MCP: personal contacts and contact groups.
- Google Forms MCP: forms CRUD, publish settings, and response reads.
- Google Slides MCP: presentations, slide pages, thumbnails, text replacement, and raw batch updates.
- MCP Apps Dashboard: workspace dashboard app-layer tools/resources with interactive UI.
- Optional Google Keep MCP, Google Chat MCP, Google Meet MCP, and Gemini media integrations behind feature flags.
- FastMCP advanced features: progress updates, background tasks, resources, and prompts on MCP 2026-07-28.
- Composed server architecture: Gmail + Calendar + Drive + Sheets + Docs + Tasks + People + Forms + Slides mounted by default, with optional Apps/Keep/Chat/Meet/Gemini namespaces.
- Protocol support: MCP 2026-07-28 (modern, no session) plus legacy handshake-era connectivity for 2024-11-05 through 2025-11-25, over both stdio and Streamable HTTP.
Requirements
- Python 3.12+
- UV package manager
- Node.js 20+ and npm (required for MCP Apps UI in
src/mcp_google_workspace/apps/ui)
- Google Cloud OAuth client credentials (
credentials.json) for a client marked Use this client for an AI-powered agent (see OAuth setup)
- Google APIs enabled in your Google Cloud project: Gmail, Calendar, Drive, Sheets, Docs, Tasks, People, Forms, and Slides
- Optional APIs when enabling feature-flagged integrations: Google Keep, Google Chat, and Google Meet
- Gemini Developer API key when enabling Gemini media tools
Installation
uv sync --all-extras --dev
If you are working on MCP Apps UI, install frontend dependencies and build the bundle:
cd src/mcp_google_workspace/apps/ui
npm ci
npm run build
OAuth setup
Create the server's OAuth client as an AI agent client:
- In the Google Cloud console, open Google Auth Platform → Clients and create a client: Desktop app for local stdio/MCPB, or Web application with
MCP_GOOGLE_OAUTH_REDIRECT_URL as an authorized redirect URI for HTTP deployments.
- Select Use this client for an AI-powered agent.
- Download the client JSON as
credentials.json.
Google asks developers to mark every OAuth client that an AI agent uses, even one that only calls the Workspace REST APIs, and to keep agent and non-agent workflows on separate client IDs. Use a dedicated client for this server rather than one shared with other apps. The mark grants no extra scopes and does not replace user consent; it lets Workspace administrators apply agent-specific access controls. From November 11, 2026, Google's hosted Workspace MCP servers reject clients that are not marked. This server calls the Workspace REST APIs, not those hosted servers, so an unmarked client still works here. On November 12, 2026, the setting becomes permanent on existing clients: if yours is unmarked after that date, create a new client. See Manage OAuth clients.
To switch an existing installation to a new client, replace credentials.json, then call disconnect_google_workspace (it asks you to confirm) and connect again (each user, over HTTP). Saved grants keep refreshing through the client that issued them until you reconnect.
Place the Google OAuth client credentials.json in one of:
- project root:
./credentials.json
- package credentials folder:
./src/credentials/credentials.json
Each user's Google refresh token is encrypted separately with Fernet; the MCP never writes a shared token.json.
Local stdio / MCPB: nothing to configure. On first use the server generates the encryption key and keeps it in the OS keychain (Windows Credential Manager, macOS Keychain, or the Secret Service on Linux), never in a file or in the host's extension settings. If no secure keychain is available (for example headless Linux), startup stops and asks you to set MCP_TOKEN_ENCRYPTION_KEY instead. Losing the keychain entry (new machine, OS reinstall) only means reconnecting Google once.
HTTP deployments: configure a versioned key ring from your secret manager. Mount a secret-manager document through MCP_SECRET_FILE; MCP_TOKEN_ENCRYPTION_KEY remains a single-key development option. The keychain is never used over HTTP.
Generate a key once and store it in your secret manager: