google_workspace_mcp

taylorwilsdon/google_workspace_mcp
2,737 starsMITCommunity

Install to Claude Code

This server doesn't publish a one-line install command. Follow the setup in the source repository.

Summary

Comprehensive Google Workspace MCP server with full support for Google Calendar, Drive, Gmail, and Docs, Forms, Chats, Slides and Sheets over stdio, Streamable HTTP and SSE transports.

README.md

<!-- mcp-name: io.github.taylorwilsdon/workspace-mcp -->

<div align="center">

<span style="color:#cad8d9">Google Workspace MCP Server</span> <img src="https://github.com/user-attachments/assets/b89524e4-6e6e-49e6-ba77-00d6df0c6e5c" width="80" align="right" />

![License: MIT](https://opensource.org/licenses/MIT) ![Python 3.10+](https://www.python.org/downloads/) ![PyPI](https://pypi.org/project/workspace-mcp/) ![PyPI Downloads](https://pepy.tech/projects/workspace-mcp) ![Website](https://workspacemcp.com)

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, it can do things that Google's own tooling and the built in integrations with Claude and ChatGPT can't even dream of. With Remote OAuth2.1 multi-user support, fine-grained editing tools and the most extensive coverage of any Google Workspace tool in existance, Workspace MCP is in a different class. Offering native OAuth 2.1, stateless mode and external auth server support, it's also the only Workspace MCP you can host for your whole organization centrally & securely!

Support for all free Google accounts & Google Workspace plans (Starter, Standard, Plus, Enterprise, Non Profit) with expanded app options like Chat & Spaces. <br/><br /> Interested in a private, managed cloud instance? That can be arranged.

</div>

<p align="center"> <a href="https://workspacemcp.com/docs"> <img src="https://img.shields.io/badge/Read%20the%20Docs-0969DA?style=for-the-badge&logo=readthedocs&logoColor=white" alt="Read the Docs"> </a><br /><a href="https://workspacemcp.com/quick-start"> <img src="https://img.shields.io/badge/Quick%20Start-2EA44F?style=for-the-badge" alt="Quick Start Guide"> </a> </p>

<div align="center"> <a href="https://www.pulsemcp.com/servers/taylorwilsdon-google-workspace"> <img width="375" src="https://github.com/user-attachments/assets/0794ef1a-dc1c-447d-9661-9c704d7acc9d" align="center"/> </a> </div>

---

<div align="center"> <table> <tr> <td align="center"> <b>⚑ Start</b><br> <sub> <a href="#quick-start">Quick Start</a> Β· <a href="#prerequisites">Prerequisites</a><br> <a href="#configuration">Google Cloud</a> Β· <a href="#-credential-configuration">Credentials</a> </sub> </td> <td align="center"> <b>🧰 Tools</b><br> <sub> <a href="#-available-tools">All Tools</a> Β· <a href="#tool-tiers">Tool Tiers</a><br> <a href="#cli">CLI</a> Β· <a href="#start-the-server">Start Server</a> </sub> </td> <td align="center"> <b>πŸ”Œ Connect</b><br> <sub> <a href="#quick-start--connect-claude-to-google-workspace">Quick Start</a> Β· <a href="#connect-to-claude-desktop">Claude Desktop</a><br> <a href="#claude-code-mcp-client-support">Claude Code</a> Β· <a href="#vs-code-mcp-client-support">VS Code</a> Β· <a href="#connect-to-lm-studio">LM Studio</a> </sub> </td> <td align="center"> <b>πŸš€ Deploy</b><br> <sub> <a href="#oauth-21-support-multi-user-bearer-token-authentication">OAuth 2.1</a> Β· <a href="#stateless-mode-container-friendly">Stateless</a><br> <a href="#external-oauth-21-provider-mode">External OAuth</a> Β· <a href="#reverse-proxy-setup">Reverse Proxy</a> </sub> </td> <td align="center"> <b>πŸ“ Develop</b><br> <sub> <a href="#-development">Architecture</a> Β· <a href="#local-development-setup">Dev Setup</a><br> <a href="#-security">Security</a> Β· <a href="#-license">License</a> </sub> </td> </tr> </table> </div>

See it in action: <div align="center"> <video width="400" src="https://github.com/user-attachments/assets/a342ebb4-1319-4060-a974-39d202329710"></video> </div>

---

<span style="color:#adbcbc">Overview</span>

Workspace MCP is the single most complete MCP server, the only that integrates all major Google Workspace services with AI assistants and all agent platforms. The entire toolset is available for CLI usage supporting both local and remote instances.

<span style="color:#adbcbc">Features</span>

12 services &ensp;β€”&ensp; Gmail Β· Drive Β· Calendar Β· Docs Β· Sheets Β· Slides Β· Forms Β· Chat Β· Apps Script Β· Tasks Β· Contacts Β· Search

<table> <tr> <td valign="top" width="50%">

πŸ“§ Gmail β€” Complete email management, end-to-end coverage<br> πŸ“ Drive β€” File operations with sharing, permissions, Office files, PDFs & images<br> πŸ“… Calendar β€” Full event management with advanced features<br> πŸ“ Docs β€” Deep, fine-grained editing, formatting & comments<br> πŸ“Š Sheets β€” Flexible cell management, formatting & conditional rules<br> πŸ–ΌοΈ Slides β€” Presentation creation, updates & content manipulation<br> πŸ“‹ Forms β€” Creation, publish settings & response management<br> πŸ’¬ Chat β€” Space management, messaging & reactions

</td> <td valign="top" width="50%">

⚑ Apps Script β€” Cross-application workflow automation<br> <sub>&ensp;Projects Β· deployments Β· versions Β· execution Β· debugging</sub>

βœ… Tasks β€” Task & list management with hierarchy<br> πŸ‘€ Contacts β€” People API with groups & batch operations<br> πŸ” Custom Search β€” Programmable Search Engine integration

---

πŸ” Authentication & Security<br> <sub>OAuth 2.0 & 2.1 Β· auto token refresh Β· multi-user bearer tokens Β· transport-aware callbacks Β· CORS proxy</sub>

</td> </tr> </table>

---

<span style="color:#adbcbc">Security & Compliance</span>

<table> <tr> <td valign="top" width="50%">

For Security Teams

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 telemetry, no usage reporting, no analytics, no license server, and no SaaS dependency. The entire data path is: your infrastructure β†’ Google APIs.

  • Fully open source β€” every line is auditable in this repo
  • Your OAuth client, your GCP project β€” credentials never leave your environment
  • You control the scopes β€” read-only, granular per-service permissions, or full access
  • You control the network β€” deploy behind your reverse proxy, in your VPC, on your own terms
  • No third-party services β€” no intermediary servers, no token relays, no hosted backends
  • 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.

</td> <td valign="top" width="50%">

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 telemetry to disclose β€” nothing to flag in a privacy review
  • 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

The license is 21 lines and says what it means.

</td> </tr> </table>

---

Quick Start

Set credentials β†’ pick a launch command β†’ connect your client

<div align="center">

πŸ’‘ New to Workspace MCP? Check out the Interactive Quick Start Guide β†’ with step-by-step setup, screenshots, and troubleshooting tips!

</div>

<table> <tr> <td valign="top" width="50%">

Confidential Client Quick Start

# 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
uv run main.py --tools gmail drive calendar

</td> <td valign="top" width="50%">

Secretless / Public OAuth 2.1 (PKCE) Quick Start

# 1. Credentials
export MCP_ENABLE_OAUTH21=true
export GOOGLE_OAUTH_CLIENT_ID="..."
export WORKSPACE_MCP_PORT=8000
export GOOGLE_OAUTH_REDIRECT_URI="http://localhost:${WORKSPACE_MCP_PORT}/oauth2callback"
export OAUTHLIB_INSECURE_TRANSPORT=1
# Leave GOOGLE_OAUTH_CLIENT_SECRET unset for public PKCE clients
export FASTMCP_SERVER_AUTH_GOOGLE_JWT_SIGNING_KEY="$(openssl rand -hex 32)"

# 2. Launch β€” OAuth 2.1 requires HTTP transport
uvx workspace-mcp --transport streamable-http --tool-tier core
uvx workspace-mcp --transport streamable-http --tool-tier extended
uvx workspace-mcp --transport streamable-http --tool-tier complete

# Or cherry-pick services
uv run main.py --transport streamable-http --tools gmail drive calendar

</td> </tr> </table>

<sub>Credential setup β†’ Β· All launch options β†’ Β· Tier details β†’</sub>

<details open> <summary><b>Environment Variable Reference</b></summary> <sub>

| Variable | | Purpose | |----------|:---:|---------| | πŸ” Authentication | | | | GOOGLE_OAUTH_CLIENT_ID | required | OAuth client ID from Google Cloud | | GOOGLE_OAUTH_CLIENT_SECRET | | OAuth client secret for confidential clients; optional for public OAuth 2.1 PKCE clients | | OAUTHLIB_INSECURE_TRANSPORT | required&ast; | Set to 1 for development β€” allows http:// redirect | | USER_GOOGLE_EMAIL | | Default email for single-user auth | | GOOGLE_CLIENT_SECRET_PATH | | Custom path to client_secret.json | | GOOGLE_MCP_CREDENTIALS_DIR | | Credential directory β€” default ~/.google_workspace_mcp/credentials | | πŸ–₯️ Server | | | | WORKSPACE_MCP_BASE_URI | | Base server URI (no port) β€” default http://localhost | | WORKSPACE_MCP_PORT | | Listening port β€” default 8000. Also controls the stdio-mode OAuth callback port. The PORT env var takes precedence if set. | | WORKSPACE_MCP_HOST | | Bind host β€” default 0.0.0.0 for OAuth 2.1 HTTP, 127.0.0.1 for legacy streamable HTTP. | | WORKSPACE_MCP_TRANSPORT | | stdio or streamable-http; used when --transport is not passed | | WORKSPACE_MCP_HTTP_PORT | | Advanced legacy-stdio sidecar /mcp port for local workspace-cli access. Disabled when empty. Binds to 127.0.0.1 only and is accessible to local processes. | | WORKSPACE_EXTERNAL_URL | | External URL for reverse proxy setups | | WORKSPACE_MCP_BRAND_NAME | | OAuth 2.1 consent-page server name β€” default FastMCP's name | | WORKSPACE_MCP_BRAND_ICON_URL | | OAuth 2.1 consent-page logo (hosted URL or data: URI), shown at 64px wide β€” default FastMCP's logo | | WORKSPACE_MCP_BRAND_WEBSITE_URL | | OAuth 2.1 consent-page website link | | WORKSPACE_ATTACHMENT_DIR | | Downloaded attachments dir and default trusted local attachment directory β€” default ~/.workspace-mcp/attachments/ | | WORKSPACE_MCP_URL | | Remote MCP endpoint URL for CLI | | ALLOWED_FILE_DIRS | | Colon-separated allowlist for local file reads | | 🧰 Tool Selection | | | | WORKSPACE_MCP_TOOLS | | Comma-separated services, e.g. gmail,drive,calendar; empty means all services | | WORKSPACE_MCP_TOOL_TIER | | core, extended, or complete; empty means all tools | | WORKSPACE_MCP_READ_ONLY | | true, 1, or yes to request read-only scopes and filter write tools | | WORKSPACE_MCP_PERMISSIONS | | Space-separated service:level entries, e.g. gmail:send drive:readonly; mutually exclusive with tools and read-only | | πŸ”‘ OAuth 2.1 & Multi-User | | | | MCP_ENABLE_OAUTH21 | | true to enable OAuth 2.1 multi-user support. Required for remote or shared HTTP endpoints (--transport streamable-http); optional for local-only legacy HTTP, which binds to 127.0.0.1 by default. | | EXTERNAL_OAUTH21_PROVIDER | | true for external OAuth flow with bearer tokens | | WORKSPACE_MCP_STATELESS_MODE | | true for stateless container-friendly operation | | WORKSPACE_MCP_LOG_DIR | | Directory for mcp_server_debug.log β€” defaults to ~/.google_workspace_mcp/logs | | GOOGLE_OAUTH_REDIRECT_URI | | Override OAuth callback URL β€” default auto-constructed | | OAUTH_CUSTOM_REDIRECT_URIS | | Comma-separated additional redirect URIs | | OAUTH_ALLOWED_ORIGINS | | Comma-separated additional CORS origins | | WORKSPACE_MCP_OAUTH_PROXY_STORAGE_BACKEND | | memory, disk, or valkey β€” see storage backends | | FASTMCP_SERVER_AUTH_GOOGLE_JWT_SIGNING_KEY | | Custom encryption key for OAuth proxy storage; required for public OAuth 2.1 clients when GOOGLE_OAUTH_CLIENT_SECRET is omitted | | WORKSPACE_MCP_ALLOWED_CLIENT_REDIRECT_URIS | | Comma-separated allowlist of redirect URIs that dynamically-registered OAuth clients may use. Default is unset (any URI permitted, per DCR). Supports FastMCP's glob patterns (, .example.com) | | πŸ—„οΈ Credential Store | | | | WORKSPACE_MCP_CREDENTIAL_STORE_BACKEND | | local_directory (default) or gcs β€” see credential store system | | WORKSPACE_MCP_CREDENTIALS_DIR | | Directory for the local_directory backend | | GOOGLE_MCP_CREDENTIALS_DIR | | Backward-compatible alias for WORKSPACE_MCP_CREDENTIALS_DIR | | WORKSPACE_MCP_GCS_BUCKET | | Required when backend is gcs β€” GCS bucket name | | WORKSPACE_MCP_GCS_PREFIX | | Optional object-name prefix for the gcs backend | | WORKSPACE_MCP_GCS_REQUIRE_CMEK | | true to require a bucket default KMS key at startup (fails fast if unset) | | πŸ”§ Service Account | | | | GOOGLE_SERVICE_ACCOUNT_KEY_FILE | | Path to service account JSON key file (domain-wide delegation) | | GOOGLE_SERVICE_ACCOUNT_KEY_JSON | | Inline service account JSON key (alternative to file) | | DWD_ALLOWED_DOMAINS | | Comma-separated domain allowlist for per-request impersonation (optional) | | πŸ” Custom Search | | | | GOOGLE_PSE_API_KEY | | API key for Programmable Search Engine | | GOOGLE_PSE_ENGINE_ID | | Search Engine ID for PSE |

&ast;Required for development only. Claude Desktop stores credentials securely in the OS keychain β€” set them once in the extension pane.

</sub> </details>

---

Quick Start β€” Connect Claude to Google Workspace

The recommended setup is to run an instance and connect Claude to it via a Connector. Full instructions at workspacemcp.com/quick-start.

<div align="center"> <video width="832" src="https://github.com/user-attachments/assets/83cca4b3-5e94-448b-acb3-6e3a27341d3a"></video> </div>

---

Prerequisites

Python 3.10+ Β· uv/uvx Β· Google Cloud Project with OAuth 2.0 credentials

If you want the GCS credential store backend, install the optional dependency first:

uv sync --extra gcs
# or
pip install "workspace-mcp[gcs]"

Configuration

<details open> <summary><b>Google Cloud Setup</b></summary>

  1. Create Project β€” Open Console β†’ β†’ Create new project
  2. Create OAuth Credentials β€” APIs & Services β†’ Credentials β†’ Create Credentials β†’ OAuth Client ID
  • Choose Desktop Application for a public PKCE client (no redirect URIs needed) or Web Application for a confidential client
  • Download and note your Client ID and, if issued, Client Secret
  1. Enable APIs β€” APIs & Services β†’ Library, then enable each service:

| | | | | |:--|:--|:--|:--| | Calendar | Drive | Gmail | Docs | | Sheets | Slides | Forms | Tasks | | Chat | People | Custom Search | Apps Script |

Google Chat needs extra setup. Enabling the API is not enough β€” you must also configure a Chat app and use a Workspace account. See Chat setup under the tool list.

  1. Set Credentials β€” see Environment Variable Reference above, or:
   export GOOGLE_OAUTH_CLIENT_ID="your-client-id"
   export GOOGLE_OAUTH_CLIENT_SECRET="your-secret"

For public OAuth 2.1 PKCE clients, omit GOOGLE_OAUTH_CLIENT_SECRET and set FASTMCP_SERVER_AUTH_GOOGLE_JWT_SIGNING_KEY instead.

<sub>Full OAuth documentation β†’ Β· Credential setup details β†’</sub>

</details>

Google Custom Search Setup

<details open> <summary>β—† <b>Custom Search Configuration</b> <sub><sup>← Enable web search capabilities</sup></sub></summary>

<table> <tr> <td width="33%" align="center">

1. Create Search Engine ```text programmablesearchengine.google.com /controlpanel/create

β†’ Configure sites or entire web β†’ Note your Engine ID (cx) ``` <sub>Open Control Panel β†’</sub>

</td> <td width="33%" align="center">

2. Get API Key ```text developers.google.com /custom-search/v1/overview

β†’ Create/select project β†’ Enable Custom Search API β†’ Create credentials (API Key) ``` <sub>Get API Key β†’</sub>

</td> <td width="34%" align="center">

3. Set Variables ``bash export GOOGLE_PSE_API_KEY=\ "your-api-key" export GOOGLE_PSE_ENGINE_ID=\ "your-engine-id" `` <sub>Configure in environment</sub>

</td> </tr> <tr> <td colspan="3">

<details open> <summary>≑ <b>Quick Setup Guide</b> <sub><sup>← Step-by-step instructions</sup></sub></summary>

Complete Setup Process:

  1. Create Search Engine - Visit the Control Panel
  • Choose "Search the entire web" or specify sites
  • Copy the Search Engine ID (looks like: 017643444788157684527:6ivsjbpxpqw)
  1. Enable API & Get Key - Visit Google Developers Console
  • Enable "Custom Search API" in your project
  • Create credentials β†’ API Key
  • Restrict key to Custom Search API (recommended)
  1. Configure Environment - Add to your shell or .env:
   export GOOGLE_PSE_API_KEY="AIzaSy..."
   export GOOGLE_PSE_ENGINE_ID="01764344478..."

≑ Full Documentation β†’

</details>

</td> </tr> </table>

</details>

Start the Server

πŸ“Œ Transport Mode Guidance: Use streamable HTTP mode (--transport streamable-http) for all modern MCP clients including Claude Code, VS Code MCP, and MCP Inspector. For Claude Desktop, run an instance and connect via a Connector. Stdio mode is a legacy fallback. For deployments, prefer OAuth 2.1 with stateless mode (MCP_ENABLE_OAUTH21=true, WORKSPACE_MCP_STATELESS_MODE=true) unless you need local attachment or credential storage.

OAuth state safety: Legacy stdio starts a local-only OAuth callback server. In single-user mode only, it may recover a missing Google state parameter by consuming the most recent pending local OAuth state. This fallback is intentionally disabled outside single-user mode because it can cross session boundaries. Do not enable or emulate this behavior in streamable HTTP, hosted, or multi-user deployments; those modes must require an explicit state match.

<details open> <summary>β–Ά <b>Launch Commands</b> <sub><sup>← Choose your startup mode</sup></sub></summary>

<table> <tr> <td width="33%" align="center">

β–Ά Legacy Mode ``bash uv run main.py `` <sub>⚠️ Stdio mode (incomplete MCP clients only)</sub>

</td> <td width="33%" align="center">

β—† HTTP Mode (Recommended) ``bash export MCP_ENABLE_OAUTH21=true export GOOGLE_OAUTH_CLIENT_ID="..." uv run main.py \ --transport streamable-http `` <sub>βœ… Full MCP spec compliance & OAuth 2.1</sub>

</td> <td width="34%" align="center">

@ Single User ``bash uv run main.py \ --single-user `` <sub>Simplified authentication</sub> <sub>⚠️ Cannot be used with OAuth 2.1 mode</sub>

</td> </tr> <tr> <td colspan="3">

<details open> <summary>β—† <b>Advanced Options</b> <sub><sup>← Tool selection, tiers & Docker</sup></sub></summary>

β–Ά Selective Tool Loading ```bash

Load specific services only

uv run main.py --tools gmail drive calendar uv run main.py --tools sheets docs

Combine with other flags

uv run main.py --single-user --tools gmail ```

πŸ”’ Read-Only Mode ```bash

Requests only read-only scopes & disables write tools

uv run main.py --read-only

Combine with specific tools or tiers

uv run main.py --tools gmail drive --read-only uv run main.py --tool-tier core --read-only ``` Read-only mode provides secure, restricted access by:

  • Requesting only *.readonly OAuth scopes (e.g., gmail.readonly, drive.readonly)
  • Automatically filtering out tools that require write permissions at startup
  • Allowing read operations: list, get, search, and export across all services

πŸ” Granular Permissions ```bash

Per-service permission levels

uv run main.py --permissions gmail:organize drive:readonly

Combine permissions with tier filtering

uv run main.py --permissions gmail:send drive:full --tool-tier core ``` Granular permissions mode provides service-by-service scope control:

  • Format: service:level (one entry per service)
  • Gmail levels: readonly, organize, drafts, send, full (cumulative)
  • Tasks levels: readonly, manage, full (cumulative; manage allows create/update/move but denies delete and clear_completed)
  • Other services currently support: readonly, full
  • --permissions and --read-only are mutually exclusive
  • --permissions cannot be combined with --tools; enabled services are determined by the --permissions entries (optionally filtered by --tool-tier)
  • With --tool-tier, only tier-matched tools are enabled and only services that have tools in the selected tier are imported

The WORKSPACE_MCP_TOOLS, WORKSPACE_MCP_TOOL_TIER, WORKSPACE_MCP_READ_ONLY, and WORKSPACE_MCP_PERMISSIONS environment variables provide the same controls for plugin and container installs. Empty strings are ignored. Non-empty malformed values fail closed at startup. Explicit CLI flags take precedence over mutually exclusive env vars.

Advanced legacy stdio sidecar ```bash

Optional bridge only for local legacy stdio sessions

WORKSPACE_MCP_HTTP_PORT=8001 uv run main.py workspace-cli --url http://127.0.0.1:8001/mcp list `` The sidecar is disabled unless WORKSPACE_MCP_HTTP_PORT is set. It only exists to bridge local workspace-cli calls into a legacy stdio server. Do not use it for normal Claude Code, VS Code, hosted, or multi-user deployments; use streamable HTTP with OAuth 2.1 instead. When enabled, it validates ports in the 1..65535 range, binds to 127.0.0.1`, and logs a warning if the port is already in use while keeping stdio running.

β˜… Tool Tiers ``bash uv run main.py --tool-tier core # ● Essential tools only uv run main.py --tool-tier extended # ◐ Core + additional uv run main.py --tool-tier complete # β—‹ All available tools ``

β—† Docker Deployment ```bash docker build -t workspace-mcp . docker run -p 8000:8000 -v $(pwd):/app \ -e MCP_ENABLE_OAUTH21=true \ -e GOOGLE_OAUTH_CLIENT_ID="..." \ workspace-mcp --transport streamable-http

With tool selection via environment variables

docker run -e TOOL_TIER=core workspace-mcp docker run -e TOOLS="gmail drive calendar" workspace-mcp ```

Available Services: gmail β€’ drive β€’ calendar β€’ docs β€’ sheets β€’ forms β€’ tasks β€’ contacts β€’ chat β€’ search

</details>

</td> </tr> </table>

</details>

CLI

The workspace-cli command lists tools and calls them against a running server β€” with encrypted, disk-backed OAuth token caching so you only authenticate once. On first run it opens a browser for Google consent; subsequent runs reuse the cached tokens automatically.

Tokens are stored encrypted at ~/.workspace-mcp/cli-tokens/ using a Fernet key auto-generated at ~/.workspace-mcp/.cli-encryption-key.

To use workspace-cli globally, you'll want to start in this repo and run uv tool install .

Once complete, you'll have workspace-cli available globally via workspace-cli

Note: there is a public (but abandoned) pypi package with the same name - do not use uvx, as it will pull the wrong thing.

<details open> <summary>β–Ά <b>workspace-cli Commands</b> <sub><sup>← Persistent OAuth, no re-auth on every call</sup></sub></summary>

<table> <tr> <td width="50%" align="center">

β–Ά List Tools ```bash uv run workspace-cli list uv run workspace-cli --url https://custom.server/mcp list

Or, if installed globally:

workspace-cli list workspace-cli --url https://custom.server/mcp list ``` <sub>View all available tools</sub>

</td> <td width="50%" align="center">

β—† Call a Tool ``bash uv run workspace-cli call search_gmail_messages \ query="is:unread" max_results=5 `` <sub>Execute a tool with key=value arguments</sub>

</td> </tr> </table>

Set URL for remote endpoints with --url or the WORKSPACE_MCP_URL environment variable.

<details open> <summary>≑ <b>Advanced: FastMCP CLI</b> <sub><sup>← inspect, install, discover</sup></sub></summary>

The upstream FastMCP CLI is also bundled and provides additional commands for schema inspection, client installation, and editor discovery. Note that fastmcp uses in-memory token storage, so each invocation may re-trigger the OAuth flow.

fastmcp inspect fastmcp_server.py                        # print tools, resources, prompts
fastmcp install claude-code fastmcp_server.py             # one-command client setup
fastmcp install cursor fastmcp_server.py
fastmcp discover                                          # find servers configured in editors

See fastmcp --help or the FastMCP CLI docs for the full command reference.

</details>

</details>

Tool Tiers

The server organizes tools into three progressive tiers for simplified deployment. Choose a tier that matches your usage needs and API quota requirements.

<table> <tr> <td width="65%" valign="top">

<span style="color:#72898f">Available Tiers</span>

<span style="color:#2d5b69">●</span> Core (--tool-tier core) Essential tools for everyday tasks. Perfect for light usage with minimal API quotas. Includes search, read, create, and basic modify operations across all services.

<span style="color:#72898f">●</span> Extended (--tool-tier extended) Core functionality plus management tools. Adds labels, folders, batch operations, and advanced search. Ideal for regular usage with moderate API needs.

<span style="color:#adbcbc">●</span> Complete (--tool-tier complete) Full API access including comments, headers/footers, publishing settings, and administrative functions. For power users needing maximum functionality.

</td> <td width="35%" valign="top">

<span style="color:#72898f">Important Notes</span>

<span style="color:#72898f">β–Ά</span> Start with core and upgrade as needed <span style="color:#72898f">β–Ά</span> Tiers are cumulative – each includes all previous <span style="color:#72898f">β–Ά</span> Mix and match with --tools for specific services <span style="color:#72898f">β–Ά</span> Configuration in core/tool_tiers.yaml <span style="color:#72898f">β–Ά</span> Authentication included in all tiers

</td> </tr> </table>

<span style="color:#72898f">Usage Examples</span>

# Basic tier selection
uv run main.py --tool-tier core                            # Start with essential tools only
uv run main.py --tool-tier extended                        # Expand to include management features
uv run main.py --tool-tier complete                        # Enable all available functionality

# Selective service loading with tiers
uv run main.py --tools gmail drive --tool-tier core        # Core tools for specific services
uv run main.py --tools gmail --tool-tier extended          # Extended Gmail functionality only
uv run main.py --tools docs sheets --tool-tier complete    # Full access to Docs and Sheets

# Combine tier selection with granular permission levels
uv run main.py --permissions gmail:organize drive:full --tool-tier core

πŸ“‹ Credential Configuration

<details open> <summary>πŸ”‘ <b>OAuth Credentials Setup</b> <sub><sup>← Essential for all installations</sup></sub></summary>

<table> <tr> <td width="33%" align="center">

πŸš€ Environment Variables ``bash export GOOGLE_OAUTH_CLIENT_ID=\ "your-client-id" export GOOGLE_OAUTH_CLIENT_SECRET=\ "your-secret" `` <sub>Best for production</sub>

</td> <td width="33%" align="center">

πŸ“ File-based ```bash

Download & place in project root

client_secret.json

Or specify custom path

export GOOGLE_CLIENT_SECRET_PATH=\ /path/to/secret.json ``` <sub>Traditional method</sub>

</td> <td width="34%" align="center">

⚑ .env File ```bash cp .env.oauth21 .env

Edit .env with credentials

<sub>Best for development</sub>

</td>
</tr>
<tr>
<td colspan="3">

<details open>
<summary>πŸ“– <b>Credential Loading Details</b> <sub><sup>← Understanding priority & best practices</sup></sub></summary>

**Loading Priority**
1. Environment variables (`export VAR=value`)
2. `.env` file in project root (warning - if you run via `uvx` rather than `uv run` from the repo directory, you are spawning a standalone process not associated with your clone of the repo and it will not find your .env file without specifying it directly)
3. `client_secret.json` via `GOOGLE_CLIENT_SECRET_PATH`
4. Default `client_secret.json` in project root

**Why Environment Variables?**
- βœ… **Docker/K8s ready** - Native container support
- βœ… **Cloud platforms** - Heroku, Railway, Vercel
- βœ… **CI/CD pipelines** - GitHub Actions, Jenkins
- βœ… **No secrets in git** - Keep credentials secure
- βœ… **Easy rotation** - Update without code changes

</details>

</td>
</tr>
</table>

</details>

---

## 🧰 Available Tools

> **Note**: All tools support automatic authentication via `@require_google_service()` decorators with 30-minute service caching.

<div align="center">

> πŸ“– **Looking for detailed parameters?** Visit the **[Complete Documentation β†’](https://workspacemcp.com/docs)** for comprehensive tool reference, examples, and API guides!

</div>

#### πŸ“… Google Calendar <sub>[`calendar_tools.py`](gcalendar/calendar_tools.py)</sub>

| <sub>Tool</sub> | <sub>Tier</sub> | <sub>Description</sub> |
|------|------|-------------|
| <sub>`list_calendars`</sub> | <sub>Core</sub> | <sub>List accessible calendars</sub> |
| <sub>`get_events`</sub> | <sub>Core</sub> | <sub>Retrieve events with time range filtering</sub> |
| <sub>`manage_event`</sub> | <sub>Core</sub> | <sub>Create, update, or delete calendar events</sub> |
| <sub>`create_calendar`</sub> | <sub>Extended</sub> | <sub>Create a new secondary Google Calendar</sub> |
| <sub>`query_freebusy`</sub> | <sub>Extended</sub> | <sub>Query free/busy information for calendars</sub> |
| <sub>`manage_out_of_office`</sub> | <sub>Extended</sub> | <sub>Create, list, update, or delete Out of Office events</sub> |
| <sub>`manage_focus_time`</sub> | <sub>Extended</sub> | <sub>Create, list, update, or delete Focus Time events</sub> |

#### πŸ“ Google Drive <sub>[`drive_tools.py`](gdrive/drive_tools.py)</sub>

| <sub>Tool</sub> | <sub>Tier</sub> | <sub>Description</sub> |
|------|------|-------------|
| <sub>`search_drive_files`</sub> | <sub>Core</sub> | <sub>Search files with query syntax</sub> |
| <sub>`get_drive_file_content`</sub> | <sub>Core</sub> | <sub>Read file content (Office, PDF, image)</sub> |
| <sub>`get_drive_file_download_url`</sub> | <sub>Core</sub> | <sub>Download Drive files to local disk</sub> |
| <sub>`create_drive_file`</sub> | <sub>Core</sub> | <sub>Create files or fetch from URLs</sub> |
| <sub>`create_drive_folder`</sub> | <sub>Core</sub> | <sub>Create empty folders in Drive or shared drives</sub> |
| <sub>`import_to_google_doc`</sub> | <sub>Core</sub> | <sub>Import files (MD, DOCX, HTML, etc.) as Google Docs</sub> |
| <sub>`import_to_google_slides`</sub> | <sub>Core</sub> | <sub>Import presentation files (PPTX, PPT, ODP) as Google Slides</sub> |
| <sub>`import_to_google_sheets`</sub> | <sub>Core</sub> | <sub>Import spreadsheet files (XLSX, CSV, TSV, etc.) as Google Sheets</sub> |
| <sub>`get_drive_shareable_link`</sub> | <sub>Core</sub> | <sub>Get shareable links for a file</sub> |
| <sub>`list_drive_items`</sub> | <sub>Extended</sub> | <sub>List folder contents or shared drives</sub> |
| <sub>`copy_drive_file`</sub> | <sub>Extended</sub> | <sub>Copy existing files (templates) with optional renaming</sub> |
| <sub>`update_drive_file`</sub> | <sub>Extended</sub> | <sub>Update metadata, move files, or replace Google Apps content</sub> |
| <sub>`manage_drive_access`</sub> | <sub>Extended</sub> | <sub>Grant, update, revoke permissions, and transfer ownership</sub> |
| <sub>`set_drive_file_permissions`</sub> | <sub>Extended</sub> | <sub>Set link sharing and file-level sharing settings</sub> |
| <sub>`get_drive_file_permissions`</sub> | <sub>Complete</sub> | <sub>Get file metadata, parents, and permissions</sub> |
| <sub>`check_drive_file_public_access`</sub> | <sub>Complete</sub> | <sub>Check public sharing status</sub> |

#### πŸ“§ Gmail <sub>[`gmail_tools.py`](gmail/gmail_tools.py)</sub>

| <sub>Tool</sub> | <sub>Tier</sub> | <sub>Description</sub> |
|------|------|-------------|
| <sub>`search_gmail_messages`</sub> | <sub>Core</sub> | <sub>Search with Gmail operators</sub> |
| <sub>`get_gmail_message_content`</sub> | <sub>Core</sub> | <sub>Retrieve message content</sub> |
| <sub>`get_gmail_messages_content_batch`</sub> | <sub>Core</sub> | <sub>Batch retrieve message content</sub> |
| <sub>`send_gmail_message`</sub> | <sub>Core</sub> | <sub>Send emails</sub> |
| <sub>`get_gmail_thread_content`</sub> | <sub>Extended</sub> | <sub>Get full thread content</sub> |
| <sub>`modify_gmail_message_labels`</sub> | <sub>Extended</sub> | <sub>Modify message labels</sub> |
| <sub>`list_gmail_labels`</sub> | <sub>Extended</sub> | <sub>List available labels</sub> |
| <sub>`list_gmail_filters`</sub> | <sub>Extended</sub> | <sub>List Gmail filters</sub> |
| <sub>`manage_gmail_label`</sub> | <sub>Extended</sub> | <sub>Create/update/delete labels</sub> |
| <sub>`manage_gmail_filter`</sub> | <sub>Extended</sub> | <sub>Create or delete Gmail filters</sub> |
| <sub>`draft_gmail_message`</sub> | <sub>Extended</sub> | <sub>Create drafts</sub> |
| <sub>`get_gmail_threads_content_batch`</sub> | <sub>Complete</sub> | <sub>Batch retrieve thread content</sub> |
| <sub>`batch_modify_gmail_message_labels`</sub> | <sub>Complete</sub> | <sub>Batch modify labels</sub> |
| <sub>`start_google_auth`</sub> | <sub>Complete</sub> | <sub>Legacy OAuth 2.0 auth (disabled when OAuth 2.1 is enabled)</sub> |

<details open>
<summary><b>πŸ“Ž Email Attachments</b> <sub><sup>← Send emails with files</sup></sub></summary>

Both `send_gmail_message` and `draft_gmail_message` support attachments via two methods:

**Option 1: File Path** (local server only)

attachments=[{"path": "/path/to/report.pdf"}] `` Reads file from disk, auto-detects MIME type. Optional filename` override.

Option 2: Base64 Content (works everywhere) ``python attachments=[{ "filename": "report.pdf", "content": "JVBERi0xLjQK...", # base64-encoded "mime_type": "application/pdf" # optional }] ``

⚠️ Centrally Hosted Servers: When the MCP server runs remotely (cloud, shared instance), it cannot access your local filesystem. Use Option 2 with base64-encoded content. Your MCP client must encode files before sending.

</details>

<details open> <summary><b>πŸ“₯ Downloaded Attachment Storage</b> <sub><sup>← Where downloaded files are saved</sup></sub></summary>

When downloading Gmail attachments (get_gmail_attachment_content) or Drive files (get_drive_file_download_url), files are saved to a persistent local directory rather than a temporary folder in the working directory.

Default location: ~/.workspace-mcp/attachments/

Files are saved with their original filename plus a short UUID suffix for uniqueness (e.g., invoice_a1b2c3d4.pdf). In stdio mode, the tool returns the absolute file path for direct filesystem access. In HTTP mode, it returns a download URL via the /attachments/{file_id} endpoint.

To customize the storage directory: ``bash export WORKSPACE_ATTACHMENT_DIR="/path/to/custom/dir" ``

Saved files expire after 1 hour and are cleaned up automatically.

</details>

πŸ“ Google Docs <sub>docs_tools.py</sub>

| <sub>Tool</sub> | <sub>Tier</sub> | <sub>Description</sub> | |------|------|-------------| | <sub>get_doc_content</sub> | <sub>Core</sub> | <sub>Extract document text</sub> | | <sub>create_doc</sub> | <sub>Core</sub> | <sub>Create new documents</sub> | | <sub>modify_doc_text</sub> | <sub>Core</sub> | <sub>Insert, replace, and richly format text with tab/segment targeting, append-to-segment support, advanced typography, and link management</sub> | | <sub>search_docs</sub> | <sub>Extended</sub> | <sub>Find documents by name</sub> | | <sub>find_and_replace_doc</sub> | <sub>Extended</sub> | <sub>Find and replace text</sub> | | <sub>list_docs_in_folder</sub> | <sub>Extended</sub> | <sub>List docs in folder</sub> | | <sub>insert_doc_elements</sub> | <sub>Extended</sub> | <sub>Add tables, lists, page breaks</sub> | | <sub>update_paragraph_style</sub> | <sub>Extended</sub> | <sub>Apply advanced paragraph styling including headings, spacing, direction, pagination controls, shading, and bulleted/numbered/checkbox lists with nesting</sub> | | <sub>get_doc_as_markdown</sub> | <sub>Extended</sub> | <sub>Export document as formatted Markdown with optional comments</sub> | | <sub>insert_doc_image</sub> | <sub>Complete</sub> | <sub>Insert images from Drive/URLs</sub> | | <sub>update_doc_headers_footers</sub> | <sub>Complete</sub> | <sub>Create or update headers and footers with correct segment-aware writes</sub> | | <sub>batch_update_doc</sub> | <sub>Complete</sub> | <sub>Execute atomic multi-step Docs API operations including named ranges, section breaks, document/section layout, header/footer creation, segment-aware inserts, images, tables, and rich formatting</sub> | | <sub>inspect_doc_structure</sub> | <sub>Complete</sub> | <sub>Analyze document structure, including safe insertion points, tables, section breaks, headers/footers, and named ranges</sub> | | <sub>export_doc_to_pdf</sub> | <sub>Extended</sub> | <sub>Export document to PDF</sub> | | <sub>create_table_with_data</sub> | <sub>Complete</sub> | <sub>Create data tables</sub> | | <sub>debug_table_structure</sub> | <sub>Complete</sub> | <sub>Debug table issues</sub> | | <sub>list_document_comments</sub> | <sub>Complete</sub> | <sub>List all document comments</sub> | | <sub>manage_document_comment</sub> | <sub>Complete</sub> | <sub>Create, reply to, or resolve comments</sub> | | <sub>manage_doc_tab</sub> | <sub>Complete</sub> | <sub>Create, rename, delete, or populate tabs from markdown</sub> |

πŸ“Š Google Sheets <sub>sheets_tools.py</sub>

| <sub>Tool</sub> | <sub>Tier</sub> | <sub>Description</sub> | |------|------|-------------| | <sub>read_sheet_values</sub> | <sub>Core</sub> | <sub>Read cell ranges</sub> | | <sub>modify_sheet_values</sub> | <sub>Core</sub> | <sub>Write/update/clear cells</sub> | | <sub>create_spreadsheet</sub> | <sub>Core</sub> | <sub>Create new spreadsheets</sub> | | <sub>list_spreadsheets</sub> | <sub>Extended</sub> | <sub>List accessible spreadsheets</sub> | | <sub>get_spreadsheet_info</sub> | <sub>Extended</sub> | <sub>Get spreadsheet metadata</sub> | | <sub>format_sheet_range</sub> | <sub>Extended</sub> | <sub>Apply colors, number formats, text wrapping, alignment, bold/italic, font size</sub> | | <sub>list_sheet_tables</sub> | <sub>Extended</sub> | <sub>List structured tables with IDs, names, ranges, and columns</sub> | | <sub>create_sheet</sub> | <sub>Complete</sub> | <sub>Add sheets to existing files</sub> | | <sub>move_sheet_rows</sub> | <sub>Complete</sub> | <sub>Move rows between sheets within a spreadsheet</sub> | | <sub>append_table_rows</sub> | <sub>Complete</sub> | <sub>Append rows to a structured table, auto-extending the table range</sub> | | <sub>list_spreadsheet_comments</sub> | <sub>Complete</sub> | <sub>List all spreadsheet comments</sub> | | <sub>manage_spreadsheet_comment</sub> | <sub>Complete</sub> | <sub>Create, reply to, or resolve comments</sub> | | <sub>manage_conditional_formatting</sub> | <sub>Complete</sub> | <sub>Add, update, or delete conditional formatting rules</sub> |

πŸ–ΌοΈ Google Slides <sub>slides_tools.py</sub>

| <sub>Tool</sub> | <sub>Tier</sub> | <sub>Description</sub> | |------|------|-------------| | <sub>create_presentation</sub> | <sub>Core</sub> | <sub>Create new presentations</sub> | | <sub>get_presentation</sub> | <sub>Core</sub> | <sub>Retrieve presentation details</sub> | | <sub>batch_update_presentation</sub> | <sub>Extended</sub> | <sub>Apply multiple updates</sub> | | <sub>get_page</sub> | <sub>Extended</sub> | <sub>Get specific slide information</sub> | | <sub>get_page_thumbnail</sub> | <sub>Extended</sub> | <sub>Generate slide thumbnails</sub> | | <sub>list_presentation_comments</sub> | <sub>Complete</sub> | <sub>List all presentation comments</sub> | | <sub>manage_presentation_comment</sub> | <sub>Complete</sub> | <sub>Create, reply to, or resolve comments</sub> |

πŸ“‹ Google Forms <sub>forms_tools.py</sub>

| <sub>Tool</sub> | <sub>Tier</sub> | <sub>Description</sub> | |------|------|-------------| | <sub>create_form</sub> | <sub>Core</sub> | <sub>Create new forms</sub> | | <sub>get_form</sub> | <sub>Core</sub> | <sub>Retrieve form details & URLs</sub> | | <sub>set_publish_settings</sub> | <sub>Complete</sub> | <sub>Configure form settings</sub> | | <sub>get_form_response</sub> | <sub>Complete</sub> | <sub>Get individual responses</sub> | | <sub>list_form_responses</sub> | <sub>Extended</sub> | <sub>List all responses with pagination</sub> | | <sub>batch_update_form</sub> | <sub>Complete</sub> | <sub>Apply batch updates (questions, settings)</sub> |

βœ“ Google Tasks <sub>tasks_tools.py</sub>

| <sub>Tool</sub> | <sub>Tier</sub> | <sub>Description</sub> | |------|------|-------------| | <sub>list_tasks</sub> | <sub>Core</sub> | <sub>List tasks with filtering</sub> | | <sub>get_task</sub> | <sub>Core</sub> | <sub>Retrieve task details</sub> | | <sub>manage_task</sub> | <sub>Core</sub> | <sub>Create, update, delete, or move tasks</sub> | | <sub>list_task_lists</sub> | <sub>Complete</sub> | <sub>List task lists</sub> | | <sub>get_task_list</sub> | <sub>Complete</sub> | <sub>Get task list details</sub> | | <sub>manage_task_list</sub> | <sub>Complete</sub> | <sub>Create, update, delete task lists, or clear completed tasks</sub> |

πŸ‘€ Google Contacts <sub>contacts_tools.py</sub>

| <sub>Tool</sub> | <sub>Tier</sub> | <sub>Description</sub> | |------|------|-------------| | <sub>search_contacts</sub> | <sub>Core</sub> | <sub>Search contacts by name, email, phone</sub> | | <sub>get_contact</sub> | <sub>Core</sub> | <sub>Retrieve detailed contact info</sub> | | <sub>list_contacts</sub> | <sub>Core</sub> | <sub>List contacts with pagination</sub> | | <sub>manage_contact</sub> | <sub>Core</sub> | <sub>Create, update, or delete contacts</sub> | | <sub>list_contact_groups</sub> | <sub>Extended</sub> | <sub>List contact groups/labels</sub> | | <sub>get_contact_group</sub> | <sub>Extended</sub> | <sub>Get group details with members</sub> | | <sub>manage_contacts_batch</sub> | <sub>Complete</sub> | <sub>Batch create, update, or delete contacts</sub> | | <sub>manage_contact_group</sub> | <sub>Complete</sub> | <sub>Create, update, delete groups, or modify membership</sub> |

πŸ’¬ Google Chat <sub>chat_tools.py</sub>

| <sub>Tool</sub> | <sub>Tier</sub> | <sub>Description</sub> | |------|------|-------------| | <sub>list_spaces</sub> | <sub>Extended</sub> | <sub>List chat spaces/rooms</sub> | | <sub>get_messages</sub> | <sub>Core</sub> | <sub>Retrieve space messages</sub> | | <sub>send_message</sub> | <sub>Core</sub> | <sub>Send messages to spaces</sub> | | <sub>search_messages</sub> | <sub>Core</sub> | <sub>Search across chat history</sub> | | <sub>create_reaction</sub> | <sub>Core</sub> | <sub>Add emoji reaction to a message</sub> | | <sub>download_chat_attachment</sub> | <sub>Extended</sub> | <sub>Download attachment from a chat message</sub> |

<details> <summary>πŸ’¬ <b>Chat setup β€” required before any Chat tool works</b></summary>

Unlike other Workspace services, enabling the Chat API is not enough β€” the Chat API refuses every request until you configure a Chat app, and it only works with Google Workspace accounts. Two extra steps are required:

1. Configure the Chat app

Enabling chat.googleapis.com alone causes every Chat tool to fail. You must also complete the Configuration tab so the API has an app identity to attach requests to:

  • Open Chat API β†’ Configuration (APIs & Services β†’ Enabled APIs β†’ Google Chat API β†’ Configuration)
  • Fill in the three required fields under Application info:
  • App name β€” e.g. Workspace MCP (up to 25 characters)
  • Avatar URL β€” any HTTPS URL to a square PNG/JPEG (e.g. https://developers.google.com/chat/images/quickstart-app-avatar.png)
  • Description β€” e.g. Workspace MCP (up to 40 characters)
  • Click Save

This server authenticates as the signed-in user (user OAuth), not as a bot. You do not need to enable interactive features, create a service account, or publish the app β€” the Configuration form above is the only Chat-specific setup required.

2. Use a Google Workspace account

The Chat API is not available to personal @gmail.com accounts. Configuring it with one returns:

Google Chat API is only available to Google Workspace users.

Sign in with a Business/Enterprise Google Workspace account (the same account you pass as user_google_email).

The required scopes (chat.spaces.readonly, chat.messages.readonly, chat.messages, chat.spaces) are requested automatically during the OAuth flow β€” no manual scope configuration is needed.

<sub>Configure the Chat API β†’ Β· User authentication β†’</sub>

</details>

πŸ” Google Custom Search <sub>search_tools.py</sub>

| <sub>Tool</sub> | <sub>Tier</sub> | <sub>Description</sub> | |------|------|-------------| | <sub>search_custom</sub> | <sub>Core</sub> | <sub>Perform web searches (supports site restrictions via sites parameter)</sub> | | <sub>get_search_engine_info</sub> | <sub>Complete</sub> | <sub>Retrieve search engine metadata</sub> |

⚑ Google Apps Script <sub>apps_script_tools.py</sub>

| <sub>Tool</sub> | <sub>Tier</sub> | <sub>Description</sub> | |------|------|-------------| | <sub>list_script_projects</sub> | <sub>Core</sub> | <sub>List accessible Apps Script projects</sub> | | <sub>get_script_project</sub> | <sub>Core</sub> | <sub>Get complete project with all files</sub> | | <sub>get_script_content</sub> | <sub>Core</sub> | <sub>Retrieve specific file content</sub> | | <sub>create_script_project</sub> | <sub>Core</sub> | <sub>Create new standalone or bound project</sub> | | <sub>update_script_content</sub> | <sub>Core</sub> | <sub>Update or create script files</sub> | | <sub>run_script_function</sub> | <sub>Core</sub> | <sub>Execute function with parameters</sub> | | <sub>list_deployments</sub> | <sub>Extended</sub> | <sub>List all project deployments</sub> | | <sub>manage_deployment</sub> | <sub>Extended</sub> | <sub>Create, update, or delete script deployments</sub> | | <sub>list_script_processes</sub> | <sub>Extended</sub> | <sub>View recent executions and status</sub> |

<sub>

Tool Tier Legend:<br> <span style="color:#2d5b69">●</span> Core β€” Essential tools for basic functionality Β· Minimal API usage Β· Getting started<br> <span style="color:#72898f">●</span> Extended β€” Core + additional features Β· Regular usage Β· Expanded capabilities<br> <span style="color:#adbcbc">●</span> Complete β€” All available tools including advanced features Β· Power users Β· Full API access

</sub>

---

Connect to Claude Desktop

The recommended way to use Google Workspace MCP with Claude Desktop is to run a server instance and connect Claude to it via a Connector. This provides proper OAuth flow, multi-user support, and the best experience.

See the Quick Start Guide for setup instructions.

<details> <summary>πŸ“ <b>Legacy: Manual stdio configuration</b> <sub><sup>← For clients without Connector support</sup></sub></summary>

⚠️ Note: Stdio mode is a legacy fallback for clients that don't support Connectors. Prefer the Connector-based approach above. OAuth callback caveat: The legacy stdio callback path includes a local recovery fallback for rare Google redirects that omit the state parameter, but only when --single-user is active. That recovery can only be safe in a single-user local process; in HTTP or hosted multi-user scenarios it could consume another user's pending OAuth state. There is no environment variable to enable this globally.

  1. Open Claude Desktop Settings β†’ Developer β†’ Edit Config
  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  1. Add the server configuration:
{
  "mcpServers": {
    "google_workspace": {
      "command": "uvx",
      "args": ["workspace-mcp"],
      "env": {
        "GOOGLE_OAUTH_CLIENT_ID": "your-client-id",
        "GOOGLE_OAUTH_CLIENT_SECRET": "your-secret",
        "OAUTHLIB_INSECURE_TRANSPORT": "1"
      }
    }
  }
}

</details>

Connect to LM Studio

Add a new MCP server in LM Studio (Settings β†’ MCP Servers) using the same JSON format:

{
  "mcpServers": {
    "google_workspace": {
      "command": "uvx",
      "args": ["workspace-mcp"],
      "env": {
        "GOOGLE_OAUTH_CLIENT_ID": "your-client-id",
        "GOOGLE_OAUTH_CLIENT_SECRET": "your-secret",
        "OAUTHLIB_INSECURE_TRANSPORT": "1",
      }
    }
  }
}

2. Advanced / Cross-Platform Installation

If you’re developing, deploying to servers, or using another MCP-capable client, keep reading.

Instant CLI (uvx)

<details open> <summary>⚑ <b>Quick Start with uvx</b> <sub><sup>← No installation required!</sup></sub></summary>

# Requires Python 3.10+ and uvx
# First, set credentials (see Credential Configuration above)
uvx workspace-mcp --tool-tier core  # or --tools gmail drive calendar

Note: Configure OAuth credentials before running. Supports environment variables, .env file, or client_secret.json.

</details>

Local Development Setup

<details open> <summary>πŸ› οΈ <b>Developer Workflow</b> <sub><sup>← Install deps, lint, and test</sup></sub></summary>

# Install everything needed for linting, tests, and release tooling
uv sync --group dev

# Run the same linter that git hooks invoke automatically
uv run ruff check .

# Execute the full test suite (async fixtures require pytest-asyncio)
uv run pytest
  • uv sync --group test installs only the testing stack if you need a slimmer environment.
  • MCP_ENABLE_OAUTH21=true GOOGLE_OAUTH_CLIENT_ID=... uv run main.py --transport streamable-http launches the HTTP server with your checked-out code for manual verification.
  • Ruff is part of the dev group because pre-push hooks call ruff check automaticallyβ€”run it locally before committing to avoid hook failures.

</details>

OAuth 2.1 Support (Multi-User Bearer Token Authentication)

The server includes OAuth 2.1 support for bearer token authentication, enabling multi-user session management. OAuth 2.1 automatically reuses your existing GOOGLE_OAUTH_CLIENT_ID and, for confidential clients, GOOGLE_OAUTH_CLIENT_SECRET credentials - no additional Google-side configuration needed. Public PKCE clients are also supported: if you omit GOOGLE_OAUTH_CLIENT_SECRET, set FASTMCP_SERVER_AUTH_GOOGLE_JWT_SIGNING_KEY explicitly.

When to use OAuth 2.1:

  • Multiple users accessing the same MCP server instance
  • Need for bearer token authentication instead of passing user emails
  • Building web applications or APIs on top of the MCP server
  • Production environments requiring secure session management
  • Browser-based clients requiring CORS support

⚠️ Important: Mutually exclusive authentication modes

OAuth 2.1 mode (MCP_ENABLE_OAUTH21=true) cannot be used together with --single-user or service account mode:

  • Single-user mode: For legacy clients that pass user emails in tool calls
  • OAuth 2.1 mode: For modern multi-user scenarios with bearer token authentication
  • Service account mode: For headless/server-to-server use via domain-wide delegation

Choose one authentication method - combining incompatible modes will result in a startup error.

Enabling OAuth 2.1: To enable OAuth 2.1, set the MCP_ENABLE_OAUTH21 environment variable to true.

# OAuth 2.1 requires HTTP transport mode
export MCP_ENABLE_OAUTH21=true
uv run main.py --transport streamable-http

If MCP_ENABLE_OAUTH21 is not set to true, the server uses legacy authentication. In streamable-http mode, legacy authentication binds to 127.0.0.1 by default to keep cached Google credentials local. Set WORKSPACE_MCP_HOST explicitly only for trusted networks; use OAuth 2.1 for remote or shared HTTP deployments.

Streamable HTTP requests with an Origin header are checked against loopback origins, WORKSPACE_EXTERNAL_URL, and OAUTH_ALLOWED_ORIGINS to reduce DNS-rebinding risk. Non-browser MCP clients that omit Origin are unaffected.

vscode-webview origins: Origins with the vscode-webview:// scheme are scoped per-extension using the authority component (e.g. vscode-webview://publisher.extension). Adding a vscode-webview URI to OAUTH_ALLOWED_ORIGINS permits only the specific extension identified by that authority; other extensions are rejected.

<details open> <summary>πŸ” <b>How the FastMCP GoogleProvider handles OAuth</b> <sub><sup>← Advanced OAuth 2.1 details</sup></sub></summary>

FastMCP ships a native GoogleProvider that we now rely on directly. It solves the two tricky parts of using Google OAuth with MCP clients:

  1. Dynamic Client Registration: Google still doesn't support OAuth 2.1 DCR, but the FastMCP provider exposes the full DCR surface and forwards registrations to Google using your fixed credentials. MCP clients register as usual and the provider hands them your Google client ID and, when configured, client secret under the hood.
  1. CORS & Browser Compatibility: The provider includes an OAuth proxy that serves all discovery, authorization, and token endpoints with proper CORS headers. We no longer maintain custom /oauth2/* routesβ€”the provider handles the upstream exchanges securely and advertises the correct metadata to clients.

The result is a leaner server that still enables any OAuth 2.1 compliant client (including browser-based ones) to authenticate through Google without bespoke code.

Restricting DCR client redirect URIs:

By default, any client going through Dynamic Client Registration can declare any redirect_uri. For publicly-exposed deployments, this is a phishing vector β€” an attacker can register a client with a redirect_uri they control and harvest authorization codes from tricked users. Set WORKSPACE_MCP_ALLOWED_CLIENT_REDIRECT_URIS to a comma-separated allowlist of permitted URIs:

# Public deployment β€” restrict to Claude's hosted OAuth callbacks
export WORKSPACE_MCP_ALLOWED_CLIENT_REDIRECT_URIS="https://claude.ai/api/mcp/auth_callback,https://claude.com/api/mcp/auth_callback"

# Add Claude Code CLI (loopback redirects on ephemeral ports)
export WORKSPACE_MCP_ALLOWED_CLIENT_REDIRECT_URIS="https://claude.ai/api/mcp/auth_callback,https://claude.com/api/mcp/auth_callback,http://localhost:*/callback,http://127.0.0.1:*/callback"

Patterns use FastMCP's matcher: wildcards any port or path component; .example.com matches subdomains. Leaving the variable unset preserves the default DCR behaviour (any URI accepted), which is appropriate for local development but unsafe for public deployments.

</details>

Stateless Mode (Container-Friendly)

The server supports a stateless mode designed for containerized environments where file system writes should be avoided:

Enabling Stateless Mode: ```bash

Stateless mode requires OAuth 2.1 to be enabled

export MCP_ENABLE_OAUTH21=true export GOOGLE_OAUTH_CLIENT_ID="..." export WORKSPACE_MCP_STATELESS_MODE=true uv run main.py --transport streamable-http ```

Key Features:

  • No file system writes: Credentials are never written to disk
  • No debug logs: File-based logging is completely disabled
  • Memory-only sessions: All tokens stored in memory via OAuth 2.1 session store
  • Container-ready: Perfect for Docker, Kubernetes, and serverless deployments
  • Token per request: Each request must include a valid Bearer token

Requirements:

  • Must be used with MCP_ENABLE_OAUTH21=true
  • Incompatible with single-user mode
  • Clients must handle OAuth flow and send valid tokens with each request

This mode is ideal for:

  • Cloud deployments where persistent storage is unavailable
  • Multi-tenant environments requiring strict isolation
  • Containerized applications with read-only filesystems
  • Serverless functions and ephemeral compute environments

MCP Inspector: No additional configurat

Related MCP servers

Browse all β†’