Skip to main content

Google Workspace MCP Server

License: MIT Python 3.10+ PyPI PyPI Downloads MCP Toplist Website

Full natural language control over Google Calendar, Drive, Gmail, Docs, Sheets, Slides, Forms, Tasks, Contacts, and Chat through all MCP clients, AI assistants and developer tools. Includes a full featured CLI & Code Mode for use with tools like Claude Code and Codex!

The most feature-complete Google Workspace MCP server is in a class of it's own: it can do things that Google's own tooling and the built in integrations with Claude and ChatGPT can't come close to with multi-user support, rich fine-grained editing tools and the most extensive coverage of any Workspace AI integration in existence.

By leveraging native OAuth 2.1, stateless deployment capability and external auth server & gateway passthrough auth support, it's also the only Workspace MCP you can host for your whole organization centrally & securely!

Supports all free Google accounts & Google Workspace plans with expanded app options like Chat & Spaces.
Interested in a managed cloud instance? That can be arranged (starting at $5/mo).

Read the Docs Quick Start Guide


See it in action:


What It Does

Workspace MCP connects AI assistants to all twelve major Google Workspace services - 120+ tools behind a single MCP server, with OAuth 2.1 multi-user auth, three progressive tool tiers, read-only mode, a full CLI, and stateless container deployment. It runs locally over stdio for legacy clients and remotely over streamable HTTP with full implementation of the latest MCP spec.

The README covers just enough to get you running, with extensive documentation on the website:

Where to go What you'll find
Quick Start Google Cloud setup, credentials, and client connection with screenshots
Full Documentation Every tool, parameter, and auth mode
Advanced Deployment Reverse proxy & nginx config, origin validation, credential store backends (GCS/CMEK), trusted-gateway identity, and the complete environment variable reference
Client Setup Guides Claude Desktop/web Connectors, ChatGPT Developer Mode, and more
FAQ & Troubleshooting OAuth errors, redirect URIs, Google Chat setup, client quirks

Security & Compliance

For Security Teams

By default, this server sends no data anywhere except Google's APIs, on behalf of the authenticated user, using your own OAuth client credentials. There is no usage reporting, analytics, license server, or SaaS dependency outside optional OTel support for your own usage.

  • Fully open source — every line is auditable in this repo
  • Your OAuth client, your GCP project — credentials never leave your environment & you control scopes
  • You control the network — deploy behind your reverse proxy, in your VPC, on your own terms
  • Stateless mode — zero disk writes for locked-down container environments
  • Sensitive path blocking — local file reads default to the managed attachment directory, and validate_file_path() still blocks .env* files plus common home-directory credential stores such as ~/.ssh/ and ~/.aws/ even if ALLOWED_FILE_DIRS is broadened

Full dependency tree in pyproject.toml, pinned in uv.lock.

For Legal & Procurement

This project is MIT licensed — not "open core," not "source available," not "free with a CLA." There is no dual licensing, no commercial tier gating features, and no contributor license agreement.

  • Use commercially without restriction — build products, sell services, deploy internally
  • Fork, embed, redistribute — MIT requires only attribution
  • No CLA — contributions remain under MIT
  • No built-in telemetry to disclose — optional tracing is off unless you configure it
  • No network effects — the server never contacts any endpoint you didn't configure
  • Standard dependency licenses — MIT, Apache 2.0, and BSD throughout the dependency chain; no copyleft, no AGPL

Services

📧

Gmail
15 tools - search, send, draft,
labels, filters, attachments

📁

Drive
16 tools - search, create, share,
import Office files

📅

Calendar
7 tools - events, free/busy,
Out of Office, Focus Time

📝

Docs
19 tools - edit, style, tables,
tabs, comments, export

📊

Sheets
14 tools - ranges, tables,
formatting, conditional rules

🖼️

Slides
7 tools - create, batch update,
thumbnails, comments

📋

Forms
6 tools - build forms, publish,
read responses

Tasks
6 tools - tasks & lists
with hierarchy

👤

Contacts
8 tools - people, groups,
batch operations

💬

Chat
6 tools - spaces, messages,
search, reactions

🔍

Custom Search
2 tools - programmable
web search

Apps Script
15 tools - write, deploy,
run & debug scripts

Each page lists every tool with its tier, parameters, required scopes, and example prompts. The complete reference covers all twelve in one place.

💬 Google Chat needs a one-time Chat app configuration and a Workspace account - see the Chat setup FAQ.

Quick Start

Set credentials → pick a launch command → connect your client. Full walkthrough with screenshots: workspacemcp.com/quick-start

You'll need an OAuth client from Google Cloud Console with the APIs enabled for the services you plan to use - the quick start guide walks through it in about five minutes.

Confidential Client

# 1. Credentials
export GOOGLE_OAUTH_CLIENT_ID="..."
export GOOGLE_OAUTH_CLIENT_SECRET="..."

# 2. Launch - pick a tier
uvx workspace-mcp --tool-tier core       # essential tools
uvx workspace-mcp --tool-tier extended   # core + management ops
uvx workspace-mcp --tool-tier complete   # everything

# Or cherry-pick services
uvx workspace-mcp --tools gmail drive calendar

OAuth 2.1 (PKCE)

# 1. Credentials - MCP clients connect with PKCE and no
#    secret, but Google still requires one server-side
export MCP_ENABLE_OAUTH21=true
export GOOGLE_OAUTH_CLIENT_ID="..."
export GOOGLE_OAUTH_CLIENT_SECRET="..."
export WORKSPACE_MCP_PORT=8000
export GOOGLE_OAUTH_REDIRECT_URI="http://localhost:${WORKSPACE_MCP_PORT}/oauth2callback"
export OAUTHLIB_INSECURE_TRANSPORT=1

# 2. Launch - OAuth 2.1 requires HTTP transport
uvx workspace-mcp --transport streamable-http --tool-tier core

Tool tiers keep context windows lean: core is the essential set, extended adds management operations, complete loads everything. Combine with --tools <service> ..., --read-only, or per-service --permissions, and subtract individual tools with --disabled-tools <name> ... - details in the server modes docs.

Connect Your Client

Claude Desktop, web & mobile - run the server in HTTP mode and add it as a Connector (Settings → Connectors → Add custom connector). This is the recommended path; the Connector guide has step-by-step screenshots. Legacy stdio configuration remains available for clients without Connector support - see the FAQ.

Claude Code

# Start the server in HTTP mode, then:
claude mcp add --transport http workspace-mcp http://localhost:8000/mcp

# Optional: install the bundled skill for better Workspace tool routing
ln -s "$(pwd)/skills/managing-google-workspace" ~/.claude/skills/managing-google-workspace

ChatGPT - connect via Developer Mode with the ChatGPT guide.

VS Code, LM Studio, Open WebUI, and everything else - any MCP client works over streamable HTTP (recommended) or stdio. Client-specific walkthroughs live in the guides and FAQ.

CLI

workspace-cli lists and calls tools against a running server with encrypted, disk-backed OAuth token caching - authenticate once, script forever:

uv run workspace-cli list
uv run workspace-cli call search_gmail_messages query="is:unread" max_results=5

Install globally with uv tool install . from this repo. ⚠️ Don't use uvx workspace-cli - an abandoned PyPI package squats that name.

Deployment & Advanced Configuration

Everything you need to run this in production lives in two places. The documentation covers auth modes and server configuration:

The Advanced Deployment guide covers self-hosting specifics: reverse proxy setup with WORKSPACE_EXTERNAL_URL (including the nginx Origin: null consent workaround, the WORKSPACE_MCP_ALLOW_NULL_ORIGIN_CONSENT escape hatch, and the Referrer-Policy pitfall), origin validation and VS Code webview allowlisting, credential store backends (local directory or GCS with CMEK enforcement), and the complete environment variable reference.

Advanced OAuth 2.1 deployments affected by concurrent client token refreshes can tune FastMCP's early-refresh threshold and client-facing access-token lifetime. See .env.oauth21 for the bounded settings, recommended values, and security tradeoffs. These settings reduce how often the race occurs; they do not add a grace period to FastMCP's one-time-use refresh-token rotation.

Security Best Practices

By default this server sends no data anywhere except Google's APIs, using your own OAuth client credentials - no usage reporting, analytics, license server, or SaaS dependency. MIT licensed with no CLA, no dual licensing, and no copyleft in the dependency chain. The full security posture - scope minimization, sensitive-path blocking, stateless mode - is documented at workspacemcp.com.

A few things worth internalizing before you connect an LLM to your email:

  • Prompt injection is real. Emails, docs, and events can contain hidden instructions. Only connect trusted data to an LLM, and be deliberate about which write tools you enable.
  • Never commit .env, client_secret.json, or .credentials/ to source control.
  • Local file reads are sandboxed to the managed attachment directory. Broaden with ALLOWED_FILE_DIRS only if you trust the client and its data sources; .env*, ~/.ssh/, ~/.aws/, and similar paths are always blocked.
  • Production deployments should use HTTPS and OAuth 2.1.

Development

uv sync --group dev    # install deps
uv run ruff check .    # lint
uv run pytest          # test

Single-file service modules live in g<service>/, tools are registered with @server.tool decorators, and tiers are defined in core/tool_tiers.yaml. PRs welcome.

License

MIT - see LICENSE. The license is 21 lines and says what it means.


Validations: MCP Badge

Release files for workspace-mcp 1.25.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for workspace-mcp 1.25.2
File Size Uploaded
workspace_mcp-1.25.2.tar.gz 428.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for workspace-mcp 1.25.2
File Interpreter ABI Platform
workspace_mcp-1.25.2-py3-none-any.whl Python 3 none any Details

Total release size: 869.7 kB

Release files / workspace_mcp-1.25.2.tar.gz

Download URL workspace_mcp-1.25.2.tar.gz
Size 428.9 kB
Tags Source
SHA-256 checksum
How to use checksums
303e1c1fc6263f0a8c622f3b9b4fe752f1a49e40cae63707de7b10ec2b223226
BLAKE2b-256 checksum
How to use checksums
412bf7be2999637fe45f3f4c3b6f1e40236fe99c80e260708845b75a0a38ea46
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.13

Release files / workspace_mcp-1.25.2-py3-none-any.whl

Download URL workspace_mcp-1.25.2-py3-none-any.whl
Size 440.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f7e9dce9e2c7dfabe0684911e66efb021f2c29f8fd48c04fc8c48fde7e167125
BLAKE2b-256 checksum
How to use checksums
5e2d55c9b1684e6c3e62dfdfffc82b1db72a9bd0ef454bc0e8363d7c104db2ae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.13

Release history Release notifications | RSS feed

1.27.1

2 release files

1.27.0

2 release files

1.26.2

2 release files

1.26.1

2 release files

This release

1.25.2 This release

2 release files

1.25.1

2 release files

1.25.0

2 release files

1.24.1

2 release files

1.24.0

2 release files

1.23.0

2 release files

1.22.2

2 release files

1.22.1

2 release files

1.22.0

2 release files

1.21.3

2 release files

1.21.2

2 release files

1.21.1

2 release files

1.21.0

2 release files

1.20.1

2 release files

1.20.0

2 release files

1.19.0

2 release files

1.16.2

2 release files

1.16.1

2 release files

1.16.0

2 release files

1.15.3

2 release files

1.15.1

2 release files

1.15.0

2 release files

1.14.3

2 release files

1.13.1

2 release files

1.13.0

2 release files

1.12.0

2 release files

1.11.5

2 release files

1.11.4

2 release files

1.11.2

2 release files

1.11.1

2 release files

1.11.0

2 release files

1.9.0

2 release files

1.8.3

2 release files

1.8.2

2 release files

1.8.1

2 release files

1.8.0

2 release files

1.7.1

2 release files

1.7.0

2 release files

1.6.3

2 release files

1.6.2

2 release files

1.6.1

2 release files

1.6.0

2 release files

1.5.5

2 release files

1.5.4

2 release files

1.5.3

2 release files

1.5.2

2 release files

1.5.1

2 release files

1.5.0

2 release files

1.4.8

2 release files

1.4.7

2 release files

1.4.6

2 release files

1.4.5

2 release files

1.4.4

2 release files

1.4.3

2 release files

1.4.2

2 release files

1.4.1

2 release files

1.4.0

2 release files

1.3.4

2 release files

1.3.3

2 release files

1.3.2

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.16

2 release files

1.1.15

2 release files

1.1.14

2 release files

1.1.13

2 release files

1.1.12

2 release files

1.1.10

2 release files

1.1.9

2 release files

1.1.8

2 release files

1.1.7

2 release files

1.1.6

2 release files

1.1.5

2 release files

1.1.4

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page