Google Workspace MCP Server

Gmail, Drive, Calendar, Docs, Sheets and nine more Google Workspace services from one MCP server

By Taylor Wilsdon (individual) Python Local · stdio ProductivityCommunicationFiles and storage

91 popularity score ★ 3.5k ↓ 290k/mo

Connect your client

Local (PyPI)

Add in one click

Opens the app, which asks before it adds the server. Then replace each <NAME> in its settings with your value.

Or add it by command or config

It needs GOOGLE_OAUTH_CLIENT_ID, GOOGLE_OAUTH_CLIENT_SECRET. Replace each <NAME> with your value.

Claude CodeTerminal
claude mcp add google-workspace -e GOOGLE_OAUTH_CLIENT_ID=<GOOGLE_OAUTH_CLIENT_ID> -e GOOGLE_OAUTH_CLIENT_SECRET=<GOOGLE_OAUTH_CLIENT_SECRET> -- uvx workspace-mcp --tool-tier core
Claude Desktopclaude_desktop_config.json
{
  "mcpServers": {
    "google-workspace": {
      "command": "uvx",
      "args": [
        "workspace-mcp",
        "--tool-tier",
        "core"
      ],
      "env": {
        "GOOGLE_OAUTH_CLIENT_ID": "<GOOGLE_OAUTH_CLIENT_ID>",
        "GOOGLE_OAUTH_CLIENT_SECRET": "<GOOGLE_OAUTH_CLIENT_SECRET>"
      }
    }
  }
}
Cursor~/.cursor/mcp.json
{
  "mcpServers": {
    "google-workspace": {
      "command": "uvx",
      "args": [
        "workspace-mcp",
        "--tool-tier",
        "core"
      ],
      "env": {
        "GOOGLE_OAUTH_CLIENT_ID": "<GOOGLE_OAUTH_CLIENT_ID>",
        "GOOGLE_OAUTH_CLIENT_SECRET": "<GOOGLE_OAUTH_CLIENT_SECRET>"
      }
    }
  }
}
VS Code.vscode/mcp.json
{
  "servers": {
    "google-workspace": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "workspace-mcp",
        "--tool-tier",
        "core"
      ],
      "env": {
        "GOOGLE_OAUTH_CLIENT_ID": "<GOOGLE_OAUTH_CLIENT_ID>",
        "GOOGLE_OAUTH_CLIENT_SECRET": "<GOOGLE_OAUTH_CLIENT_SECRET>"
      }
    }
  }
}
Codex~/.codex/config.toml
[mcp_servers.google-workspace]
command = "uvx"
args = ["workspace-mcp", "--tool-tier", "core"]

[mcp_servers.google-workspace.env]
GOOGLE_OAUTH_CLIENT_ID = "<GOOGLE_OAUTH_CLIENT_ID>"
GOOGLE_OAUTH_CLIENT_SECRET = "<GOOGLE_OAUTH_CLIENT_SECRET>"
Gemini CLITerminal
gemini mcp add --scope user -e GOOGLE_OAUTH_CLIENT_ID=<GOOGLE_OAUTH_CLIENT_ID> -e GOOGLE_OAUTH_CLIENT_SECRET=<GOOGLE_OAUTH_CLIENT_SECRET> google-workspace uvx -- workspace-mcp --tool-tier core

Settings 12

Set together: oauth client
GOOGLE_OAUTH_CLIENT_ID Required: OAuth client ID from your Google Cloud project; GOOGLE_CLIENT_SECRET_PATH to a client_secret.json can supply it instead.
GOOGLE_OAUTH_CLIENT_SECRET secret Required: OAuth client secret; may come from the client_secret.json named by GOOGLE_CLIENT_SECRET_PATH instead.
GOOGLE_CLIENT_SECRET_PATH Optional: Path to a client_secret.json holding the client ID and secret; the two variables above win when set.
USER_GOOGLE_EMAIL Optional: Default Google account for single-user mode; ignored when OAuth 2.1 is on.
MCP_ENABLE_OAUTH21 Optional: true turns on OAuth 2.1 multi-user sign-in; needs --transport streamable-http. Default false.
WORKSPACE_MCP_PORT Optional: Port for the HTTP server (PORT, when set, takes precedence). Default 8000.
WORKSPACE_MCP_HOST Optional: Bind address; HTTP mode without OAuth 2.1 binds 127.0.0.1 unless this is set.
ALLOWED_FILE_DIRS Optional: Extra local folders tools may read, separated by the OS path separator; .ssh and .aws stay blocked.
WORKSPACE_MCP_DISABLE_LOCAL_FILES Optional: true stops tools reading server-side files; Drive create, update and import tools then offer return_upload_url. For return_upload_url.
WORKSPACE_MCP_ALLOWED_HOSTS Optional: Comma-separated hostnames (no ports) accepted in the Host header; unset accepts any host.
WORKSPACE_MCP_STATELESS_MODE Optional: true keeps nothing on disk, for containers; also disables local file reads. Default false.
WORKSPACE_MCP_MAX_CONTENT_CHARS Optional: Characters get_drive_file_content returns per call before it truncates and gives the next offset; 0 returns whole files. Default 40000. For get_drive_file_content.

What it does

Google Workspace MCP Server (the workspace-mcp package on PyPI) gives an assistant tools for twelve Google services: Gmail, Drive, Calendar, Docs, Sheets, Slides, Forms, Tasks, Contacts, Chat, Apps Script and Programmable (Custom) Search. It can search and send mail and manage labels and filters. On Drive it finds, creates, copies and shares files, and it imports Markdown or Office files into Docs, Sheets or Slides. It also edits documents and spreadsheets, manages calendar events, and can write and run Apps Script projects.

core/tool_tiers.yaml names 119 tools, split into tiers that you pick with --tool-tier (core is the smallest). You can also choose services with --tools or drop single tools with --disabled-tools. To keep it to read scopes, use --read-only or per-service --permissions.

Long Drive files now come back in pages. get_drive_file_content returns up to 40,000 characters per call by default (WORKSPACE_MCP_MAX_CONTENT_CHARS changes that, 0 turns paging off), ends a cut page with the offset to ask for next, and takes full_content=true for the whole file at once. If the file's Drive version changes between pages, the tool stops and tells the caller to start over from offset 0 (gdrive/drive_tools.py). A value for the setting that is not a whole number of zero or more stops the server at startup (main.py).

It runs on your machine over stdio by default, or as a streamable HTTP server that several people can share, with OAuth 2.1 sign-in. There is also a stateless mode for containers, and service accounts with domain-wide delegation are supported. For hosted setups, WORKSPACE_MCP_ALLOWED_HOSTS turns on Host-header checks, and with WORKSPACE_MCP_DISABLE_LOCAL_FILES=true the Drive create, update and import tools can hand back an upload URL (return_upload_url) for the caller to PUT the file to. The repository also holds a workspace-cli tool for calling tools from a shell.

What it needs

RuntimePython 3.10+
Runs onmacOS, Windows, Linux
Google account or Google WorkspaceFreePlus a Google Cloud project with an OAuth client and the APIs of the services you use enabled; Google Chat needs a Workspace account
Also
  • uv, for the uvx command

Create an OAuth client in the Google Cloud Console and enable the Google APIs for the services you plan to use (the docs give enable links and one gcloud command). Put its ID and secret in GOOGLE_OAUTH_CLIENT_ID and GOOGLE_OAUTH_CLIENT_SECRET, or point GOOGLE_CLIENT_SECRET_PATH at a client_secret.json. The README says the client does not need Google's AI-agent setting; an organisation that wants agent traffic labelled should make a separate client with it, since that setting cannot be changed on an existing client after November 12, 2026. Google Chat also needs a one-time Chat app setup.

Limits

  • Not covered Google Chat tools need a Google Workspace account and a one-time Chat app configuration.
  • Limit OAuth 2.1 multi-user sign-in works only with --transport streamable-http, not stdio.
  • Limit Streamable HTTP without OAuth 2.1 binds to 127.0.0.1 unless WORKSPACE_MCP_HOST is set (main.py).
  • Read only --read-only asks only for read scopes and turns off every tool that needs write access.
  • Limit Local file reads are limited to its attachment folder; ALLOWED_FILE_DIRS adds folders, separated by the OS path separator (core/utils.py).
  • Size cap get_drive_file_content returns 40,000 characters per call by default; set WORKSPACE_MCP_MAX_CONTENT_CHARS, or pass offset or full_content=true, for more.
  • Limit A negative or non-integer WORKSPACE_MCP_MAX_CONTENT_CHARS stops startup (main.py, core/file_limits.py).
  • Limit WORKSPACE_MCP_ALLOWED_HOSTS takes hostnames without ports; a port, wildcard or @ in an entry is an error (core/server.py).
  • Limit Do not install workspace-cli from PyPI: the README says an abandoned package holds that name. Install the CLI from the repository.

Who it suits

Suits someone who wants one server for most of Google Workspace and is willing to set up their own Google Cloud OAuth client. Tiers and --tools keep the tool list small for a single user on stdio, and the HTTP mode with OAuth 2.1, stateless storage and host checks fits a team running one shared instance. It is not published by Google. Because it can send mail, change sharing and run Apps Script, start with --read-only or a narrow --permissions set if you only need to read, and think about prompt injection in incoming mail and documents before turning on write tools.

Tools 54 of 119

22 only read, 23 change things, 9 can delete or overwrite. A ? marks an optional parameter.

search_gmail_messages
Searches mail with Gmail query syntax.
get_gmail_message_content
Reads one message.
get_gmail_thread_content
Reads a whole thread.
get_gmail_attachment_content
Fetches a message attachment.
send_gmail_message changes
Sends mail, including replies, forwards and attachments.
draft_gmail_message changes
Saves a draft.
modify_gmail_message_labels changes
Adds or removes labels on a message.
manage_gmail_label deletes
Creates, renames or deletes labels.
manage_gmail_filter deletes
Creates or deletes Gmail filters.
search_drive_files
Searches Drive files and folders.
list_drive_items
Lists what a folder holds.
get_drive_file_content
Reads a file's text, exporting Google formats, a page at a time for long files.user_google_email: stringfile_id: stringoffset?: integerfull_content?: boolean
get_drive_file_download_url
Gives a download link for a Drive file.
create_drive_file changes
Makes a Drive file from text, base64 bytes, a URL or an upload URL.user_google_email: stringfile_name: stringcontent?: stringfolder_id?: stringmime_type?: stringfileUrl?: stringbase64_content?: stringcontent_mime_type?: stringbase64_sha256?: stringreturn_upload_url?: boolean
create_drive_folder changes
Makes a folder.
update_drive_file deletes
Changes a file's content or details.
copy_drive_file changes
Copies a file.
manage_drive_access changes
Grants, changes or removes sharing, or hands over ownership.
check_drive_file_public_access
Checks whether a file is shared publicly.
import_to_google_doc changes
Turns Markdown, DOCX, TXT, HTML, RTF or ODT into a Google Doc.user_google_email: stringfile_name: stringcontent?: stringfile_path?: stringfile_url?: stringsource_format?: stringfolder_id?: stringbase64_content?: stringbase64_sha256?: stringreturn_upload_url?: boolean
import_to_google_sheets changes
Turns a spreadsheet file such as XLSX into a Google Sheet.
import_to_google_slides changes
Turns a presentation file such as PPTX into Google Slides.
list_calendars
Lists the calendars the user can see.
get_events
Fetches events in a time range.
manage_event deletes
Creates, edits or deletes an event.
query_freebusy
Checks free and busy times.
manage_out_of_office changes
Sets up or removes Out of Office events.
manage_focus_time changes
Sets up or removes Focus Time blocks.
get_doc_content
Reads a Google Doc.
create_doc changes
Makes a new document.
modify_doc_text changes
Inserts, replaces or styles text in a document.
find_and_replace_doc changes
Replaces text across a document.
get_doc_as_markdown
Returns a document as Markdown.
export_doc_to_pdf changes
Saves a document as a PDF in Drive.
read_sheet_values
Reads cells from a range.
modify_sheet_values deletes
Writes or clears cells in a range.
create_spreadsheet changes
Makes a new spreadsheet.
format_sheet_range changes
Applies formatting to a range.
create_presentation changes
Makes a new presentation.
batch_update_presentation changes
Applies a batch of slide changes.
render_page_to_image
Renders a slide as an image.
create_form changes
Makes a Google Form.
list_form_responses
Lists a form's responses.
list_tasks
Lists tasks in a task list.
manage_task deletes
Creates, edits, moves or deletes a task.
search_contacts
Searches the user's contacts.
manage_contact deletes
Creates, edits or deletes a contact.
send_message changes
Posts a message to a Chat space.
search_messages
Searches Chat messages.
search_custom
Runs a Programmable Search Engine query.
manage_script_content deletes
Reads or rewrites an Apps Script project's files.
run_script_function changes
Runs a function in an Apps Script project.
manage_deployment deletes
Creates, updates or deletes Apps Script deployments.
start_google_auth
Starts the Google sign-in flow and returns the link.

Similar servers