google_workspace_mcp README

The project's README from github.com/taylorwilsdon/google_workspace_mcp. As one markdown file: README.md.

Google Workspace MCP Server

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

readme-banner

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 Enabling Google APIs, 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 in a project with the Google APIs enabled for the services you plan to use. The docs have one-click enable links for every API plus a single gcloud services enable command that covers them all, and the quick start guide walks through the whole setup 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="..."
#    Alternatively, point GOOGLE_CLIENT_SECRET_PATH at a client_secret.json
#    that contains the client id and secret (env vars take precedence).
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.

Production tuning is all environment variables; the names below link to their reference entries.

For downloads, horizontally scaled or scale-to-zero HTTP deployments (Cloud Run, Kubernetes) can stage attachments in Google Cloud Storage instead of instance-local disk, whose /attachments/{id} URL may reach a different instance. Install the gcs extra and set WORKSPACE_MCP_FILES_GCS_BUCKET to a bucket name; objects are written under WORKSPACE_MCP_FILES_GCS_PREFIX (default attachments) and handed out as V4 signed URLs valid for one hour, which the client fetches straight from GCS. This also lets stateless mode return download URLs instead of inline files. stdio ignores the setting, since its client reads the local file path directly. The runtime service account needs object read and write access on the bucket — roles/storage.objectUser, or roles/storage.objectCreator plus roles/storage.objectViewer — and, without an exported private key, roles/iam.serviceAccountTokenCreator on itself so URLs can be signed through IAM. Read access is not optional: a signed URL carries the signer's authority, so without storage.objects.get the upload and the signing both succeed while the client's download fails with 403. Objects are not deleted by the server, so add a bucket lifecycle rule that removes them after a few hours.

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:

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

google_workspace_mcp (taylorwilsdon/google_workspace_mcp)

Searching Database…

这是什么?Google Workspace MCP Server 通过模型上下文协议(MCP)暴露的 120 多个工具,把 AI 助手接入十二项 Google Workspace 服务(Gmail、Calendar、Drive、Docs、Sheets、Slides、Forms、Tasks、Contacts、Chat 等),还附带一个用于脚本化的 CLI。
这是我自己运行的 MCP 服务器,还是托管式连接器?它是自运行的 MCP 服务器,可以在本地通过 stdio 启动,也可以通过流式 HTTP 远程运行;如果不想自己托管,也有单独提供的托管云实例,每月约 5 美元。
怎么把它跑起来?在 Google Cloud Console 创建 OAuth 客户端,启用所需的 Workspace API(文档中有一键链接),然后以 HTTP 模式启动服务器,并在客户端中把它添加为连接器;旧版客户端则可以通过 stdio 运行。
需要我自己的 Google Cloud OAuth 凭据吗?需要,你必须在自己的 Google Cloud 项目中创建 OAuth 2.1 机密客户端并启用相关 API——该服务器绝不使用共享凭据。
把 LLM 连到我的邮箱前需要注意什么?邮件、文档和日程中可能藏有隐蔽的提示注入指令,所以只应连接可信数据,并谨慎选择启用哪些写入类工具;Google Chat 还需要在 Workspace 账号上进行一次性应用配置。
可以连接哪些 AI 客户端?Claude Desktop/网页版/移动端(作为 Connector)、Claude Code、开发者模式下的 ChatGPT、VS Code、LM Studio、Open WebUI,以及任何其他通过 HTTP 或 stdio 接入的 MCP 客户端。
可以部署到我自己的基础设施上而不是本地吗?可以,它支持无状态容器部署(零磁盘写入)、Docker 构建、Kubernetes/Cloud Run,以及配合 GCS 附件存储的多实例横向扩展。
这个服务器会把我的 Workspace 数据偷偷上传吗?默认情况下,它只代表你把数据发送到 Google 自己的 API,没有任何使用情况上报、分析统计、许可证服务器或 SaaS 依赖。
这里的 MIT 许可证真的没有限制吗?是的——就是纯粹的 MIT,没有 CLA、没有双许可、没有 copyleft 依赖,也没有功能限制;你可以商用、分叉或自由嵌入。
workspace-cli 是做什么的?它是一个配套 CLI,可以针对运行中的实例列出并调用服务器的工具,支持基于磁盘的加密 OAuth 令牌缓存,认证一次之后即可编写脚本调用。
工具分级是怎样的?工具分为三个递进层级——core(必备)、extended(增加管理操作)和 complete(全部)——另有只读模式,让上下文窗口保持精简。
可以为整个组织集中托管吗?可以——它支持 OAuth 2.1 多用户认证、带全域委派的服务账号,以及可信网关身份验证(Pomerium、Cloudflare Access、oauth2-proxy),可以为团队集中、安全地托管。
它覆盖多少 Google 服务和工具?它覆盖十二项主要 Workspace 服务——Gmail、Drive、Calendar、Docs、Sheets、Slides、Forms、Tasks、Contacts、Chat、Search 和 Apps Script——共计 120 多个工具。
Size
19.2 MB
Stars
3.4K
Age
1y
Commits · 90 Days