The Google Workspace MCP server provides a comprehensive interface for accessing Google Workspace services through AI assistants and developer tools. It enables natural language control over Gmail, Drive, Calendar, Docs, and more.
google_workspace_mcp.dxt
from the Releases pageCreate OAuth 2.0 credentials in Google Cloud Console:
http://localhost:8000/oauth2callback
Enable the necessary APIs in Google Cloud Console:
Configure credentials using one of these methods:
Option A: Environment Variables (Recommended for Production)
export GOOGLE_OAUTH_CLIENT_ID="your-client-id.apps.googleusercontent.com"
export GOOGLE_OAUTH_CLIENT_SECRET="your-client-secret"
export GOOGLE_OAUTH_REDIRECT_URI="http://localhost:8000/oauth2callback" # Optional
Option B: File-based (Traditional)
client_secret.json
in project rootGOOGLE_CLIENT_SECRET_PATH
environment variableOption C: .env File (Recommended for Development)
cp .env.oauth21 .env
# Edit .env to add your credentials
Additional environment variables:
export OAUTHLIB_INSECURE_TRANSPORT=1 # Development only
export [email protected] # Optional: Default email for auth
export GOOGLE_PSE_API_KEY=your-custom-search-api-key # Optional: For Google Custom Search
export GOOGLE_PSE_ENGINE_ID=your-search-engine-id # Optional: For Google Custom Search
# Default (stdio mode for MCP clients)
uv run main.py
# HTTP mode (for web interfaces and debugging)
uv run main.py --transport streamable-http
# Single-user mode (simplified authentication)
uv run main.py --single-user
# Selective tool registration
uv run main.py --tools gmail drive calendar tasks
# Requires Python 3.10+ and uvx
export GOOGLE_OAUTH_CLIENT_ID="xxx"
export GOOGLE_OAUTH_CLIENT_SECRET="yyy"
uvx workspace-mcp --tools gmail drive calendar
To enable OAuth 2.1 for multi-user support:
export MCP_ENABLE_OAUTH21=true
uv run main.py --transport streamable-http
python install_claude.py
This script automatically configures Claude Desktop with your credentials.
{
"mcpServers": {
"google_workspace": {
"command": "uvx",
"args": ["workspace-mcp"],
"env": {
"GOOGLE_OAUTH_CLIENT_ID": "your-client-id.apps.googleusercontent.com",
"GOOGLE_OAUTH_CLIENT_SECRET": "your-client-secret",
"OAUTHLIB_INSECURE_TRANSPORT": "1"
}
}
}
}
list_calendars
: List accessible calendarsget_events
: Retrieve events with time range filteringget_event
: Fetch detailed information of a single eventcreate_event
: Create events with optional attachmentsmodify_event
: Update existing eventsdelete_event
: Remove eventssearch_drive_files
: Search files with query syntaxget_drive_file_content
: Read file content (supports Office formats)list_drive_items
: List folder contentscreate_drive_file
: Create new files or fetch from URLssearch_gmail_messages
: Search with Gmail operatorsget_gmail_message_content
: Retrieve message contentsend_gmail_message
: Send emailsdraft_gmail_message
: Create draftssearch_docs
: Find documents by nameget_doc_content
: Extract document textlist_docs_in_folder
: List docs in foldercreate_doc
: Create new documentsread_doc_comments
: Read all comments and repliescreate_doc_comment
: Create new commentsreply_to_comment
: Reply to existing commentsresolve_comment
: Resolve commentslist_spreadsheets
: List accessible spreadsheetsget_spreadsheet_info
: Get spreadsheet metadataread_sheet_values
: Read cell rangesmodify_sheet_values
: Write/update/clear cellscreate_spreadsheet
: Create new spreadsheetscreate_sheet
: Add sheets to existing filesread_sheet_comments
: Read all comments and repliescreate_sheet_comment
: Create new commentsreply_to_sheet_comment
: Reply to existing commentsresolve_sheet_comment
: Resolve commentsWhen calling a tool:
The server features transport-aware OAuth callback handling that works seamlessly in both stdio and HTTP modes.
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "google_workspace" '{"command":"uvx","args":["workspace-mcp"]}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"google_workspace": {
"command": "uvx",
"args": [
"workspace-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"google_workspace": {
"command": "uvx",
"args": [
"workspace-mcp"
]
}
}
}
3. Restart Claude Desktop for the changes to take effect