home / mcp / google workspace mcp server

Google Workspace MCP Server

A production-ready MCP server that integrates Google Workspace services with multi-user OAuth 2.1 support for automation and AI-assisted tooling.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "taylorwilsdon-google_workspace_mcp": {
      "url": "http://localhost:8000/mcp",
      "headers": {
        "USER_GOOGLE_EMAIL": "[email protected]",
        "GOOGLE_PSE_API_KEY": "AIza...",
        "MCP_ENABLE_OAUTH21": "true",
        "WORKSPACE_MCP_PORT": "8000",
        "GOOGLE_PSE_ENGINE_ID": "0123456789",
        "GOOGLE_OAUTH_CLIENT_ID": "your-client-id",
        "WORKSPACE_EXTERNAL_URL": "https://your-domain.com",
        "WORKSPACE_MCP_BASE_URI": "http://localhost",
        "EXTERNAL_OAUTH21_PROVIDER": "true",
        "GOOGLE_OAUTH_REDIRECT_URI": "https://your-domain.com/oauth2callback",
        "GOOGLE_OAUTH_CLIENT_SECRET": "your-client-secret",
        "OAUTHLIB_INSECURE_TRANSPORT": "1",
        "WORKSPACE_MCP_STATELESS_MODE": "true"
      }
    }
  }
}

You can run and integrate Google Workspace services through a dedicated MCP server that exposes Google Calendar, Drive, Gmail, Docs, Sheets, Slides, Forms, Tasks, and Chat APIs to your applications. It supports single-user and multi-user authentication, plus flexible tool loading and OAuth 2.1 bearer token flows for secure, scalable usage across clients.

How to use

Start by selecting the startup method that fits your environment. For quick local testing, run the server with standard Python tooling and load the specific Google Workspace tools you need. For development or multi-user deployments, you can enable OAuth 2.1 and run the server in a transport mode suitable for your frontend.

How to install

Prerequisites include Python 3.10 or newer and a runtime like uvx for instant installation or uv for development. You also need a Google Cloud Project with OAuth 2.0 credentials enabled for the Google Workspace APIs you plan to use.

Step-by-step commands to get started locally:

# Prerequisites
# Ensure Python 3.10+ is installed
# Install uvx (or use uv in development)

# Configure credentials (examples shown; replace with real values)
export GOOGLE_OAUTH_CLIENT_ID="your-client-id"
export GOOGLE_OAUTH_CLIENT_SECRET="your-secret"

# Start the server (core tooling)
uv run main.py --tools gmail drive calendar

# Alternative single-tool start (example):
uv run main.py --tools docs sheets

Additional setup and notes

You can also run the server through a higher-level orchestrator (uvx) to specify tool tiers or multiple tools at once. For example:

- Start with core tools only
- Start with core + extended features
- Start with all available tools

If you plan to expose the server behind a reverse proxy, consider setting external URLs so OAuth endpoints are reachable from clients using the public domain.

Configuration highlights

OAuth 2.1 bearer token support enables multi-user sessions and bearer-based authentication. To enable OAuth 2.1, set MCP_ENABLE_OAUTH21 to true and start the server in a transport mode that supports HTTP-based clients if needed. You can also opt into external OAuth providers or stateless container-friendly modes for deployment.

Security and development tips

Store credentials securely and avoid embedding secret values in source control. Use environment variables or dedicated secret stores. When operating in stateless mode, remember that tokens are handled per request and no persistent state is stored on disk.

Available tools

list_calendars

List accessible calendars for a user or account in the Calendar service.

get_events

Retrieve events within a specified time range from calendars.

create_event

Create events with options for attachments and reminders.

modify_event

Update properties of existing calendar events.

delete_event

Remove events from calendars.

search_drive_files

Search Google Drive files using query syntax.

get_drive_file_content

Read contents of Drive files, including Office formats.

get_drive_file_download_url

Get a download URL for a Drive file.

create_drive_file

Create new files in Drive or fetch from external URLs.

share_drive_file

Share a Drive file with users, groups, or make it public.

get_drive_shareable_link

Obtain a public or shareable link for a Drive file.

list_drive_items

List items within a Drive folder.

update_drive_file

Update metadata or move files between folders.

batch_share_drive_file

Share multiple files with several recipients in a batch operation.

update_drive_permission

Modify file permission roles.

remove_drive_permission

Revoke access to a Drive file.

transfer_drive_ownership

Transfer file ownership to another user.

get_drive_file_permissions

Retrieve detailed permissions for a Drive file.

check_drive_file_public_access

Check if a Drive file is publicly accessible.

search_gmail_messages

Search Gmail messages using advanced operators.

get_gmail_message_content

Retrieve content of a Gmail message.

get_gmail_messages_content_batch

Batch retrieve content for multiple messages.

send_gmail_message

Send an email via Gmail.

get_gmailThread_content

Retrieve full thread content.

modify_gmail_message_labels

Modify labels on Gmail messages.

list_gmail_labels

List available Gmail labels.

manage_gmail_label

Create, update, or delete Gmail labels.

draft_gmail_message

Create email drafts in Gmail.

get_gmail_threads_content_batch

Batch retrieve thread content.

batch_modify_gmail_message_labels

Batch modify labels on multiple messages.

start_google_auth

Initialize Google authentication flow.

get_doc_content

Extract text from Google Docs.

create_doc

Create new Google Docs.

modify_doc_text

Modify text within a Google Doc.

search_docs

Find documents by name or content.

find_and_replace_doc

Find and replace text within documents.

list_docs_in_folder

List documents in a Drive/Docs folder.

insert_doc_elements

Insert tables, lists, or pages into Docs.

insert_doc_image

Insert images into Docs from Drive or URLs.

update_doc_headers_footers

Modify headers and footers in Docs.

batch_update_doc

Execute multiple operations in a single call.

inspect_doc_structure

Analyze document structure and metadata.

export_doc_to_pdf

Export Docs to PDF.

create_table_with_data

Create tables populated with data in Docs.

debug_table_structure

Diagnose table structure issues in Docs.

*_document_comments

Read, reply, create, or resolve comments in Docs.

read_sheet_values

Read cell ranges in Google Sheets.

modify_sheet_values

Write, update, or clear cells in Sheets.

create_spreadsheet

Create new Google Sheets files.

list_spreadsheets

List accessible spreadsheets.

get_spreadsheet_info

Get metadata for a spreadsheet.

create_sheet

Add new sheets to an existing spreadsheet.

*_sheet_comment

Read, create, reply, or resolve comments on sheets.

create_presentation

Create new Google Slides presentations.

get_presentation

Retrieve presentation details.

batch_update_presentation

Apply multiple updates to a presentation.

get_page

Get information about a specific slide.

get_page_thumbnail

Generate a thumbnail for a slide.

*_presentation_comment

Read, create, reply, or resolve comments on presentations.

create_form

Create new Google Forms.

get_form

Retrieve form details and access URLs.

set_publish_settings

Configure form publish settings.

get_form_response

Retrieve individual form responses.

list_form_responses

List all form responses with pagination.

list_tasks

List Google Tasks with filtering.

get_task

Retrieve details for a Google Task.

create_task

Create tasks with hierarchical structure.

update_task

Modify task properties.

delete_task

Remove tasks.

move_task

Reposition tasks to re-order lists.

clear_completed_tasks

Hide or clear completed tasks.

*_task_list

List/get/create/update/delete task lists.

list_spaces

List Google Chat spaces.

get_messages

Retrieve messages from a chat space.

send_message

Send a message to a chat space.

search_messages

Search across chat history.

search_custom

Perform web searches via Custom Search API.

get_search_engine_info

Retrieve metadata for the search engine.

search_custom_siterestrict

Search within specific sites or domains.

list_script_projects

List Apps Script projects.

get_script_project

Get a full Apps Script project.

get_script_content

Retrieve a script file's content.

create_script_project

Create a new Apps Script project.

update_script_content

Update Apps Script project files.

run_script_function

Execute a function in Apps Script with parameters.

create_deployment

Create a new Apps Script deployment.

list_deployments

List deployments for a project.

update_deployment

Update deployment configuration.

delete_deployment

Remove a deployment.

list_script_processes

View recent script executions and status.