mcp-google-workspace
MCP server integrating multiple Google Workspace services including Gmail, Calendar, Drive, Sheets, Docs, Tasks, People, Forms, and Slides, enabling users to manage emails, events, files, documents, and more through natural language.
README
mcp-google-workspace
Production-ready Google Workspace MCP package with:
- Gmail MCP: send/read/search emails, attachment handling, label management, batch operations.
- Google Calendar MCP: events, availability, create/update/delete operations.
- Google Drive MCP: files/folders CRUD, uploads/downloads/exports, sharing permissions, Shared Drives operations.
- Google Sheets MCP: spreadsheet metadata, values reads/writes, and raw batch updates.
- Google Docs MCP: document fetch/create flows plus convenience text mutations and raw batch updates.
- Google Tasks MCP: task lists, tasks, completion, movement, and deletion.
- Google People MCP: personal contacts and contact groups.
- Google Forms MCP: forms CRUD, publish settings, and response reads.
- Google Slides MCP: presentations, slide pages, thumbnails, text replacement, and raw batch updates.
- MCP Apps Dashboard: workspace dashboard app-layer tools/resources with interactive UI.
- Optional Google Keep MCP, Google Chat MCP, Google Meet MCP, and Gemini media integrations behind feature flags.
- FastMCP advanced features: Context logging, progress updates, user elicitation, sampling, resources, and prompts.
- Composed server architecture: Gmail + Calendar + Drive + Sheets + Docs + Tasks + People + Forms + Slides mounted by default, with optional Apps/Keep/Chat/Meet/Gemini namespaces.
Requirements
- Python 3.12+
- UV package manager
- Node.js 18+ and npm (required for MCP Apps UI in
src/mcp_google_workspace/apps/ui) - Google Cloud OAuth desktop credentials (
credentials.json) - Google APIs enabled in your Google Cloud project: Gmail, Calendar, Drive, Sheets, Docs, Tasks, People, Forms, and Slides
- Optional APIs when enabling feature-flagged integrations: Google Keep, Google Chat, and Google Meet
- Gemini Developer API key when enabling Gemini media tools
Installation
uv sync --all-extras --dev
If you are working on MCP Apps UI, install frontend dependencies and build the bundle:
cd src/mcp_google_workspace/apps/ui
npm ci
npm run build
OAuth setup
Place credentials.json in one of:
- project root:
./credentials.json - package credentials folder:
./src/credentials/credentials.json
On first run, the server launches a browser for OAuth consent and writes token.json.
Optional service feature flags
Sheets, Docs, Tasks, People, Forms, and Slides are mounted by default and their scopes are always requested.
If you are upgrading from an older checkout, delete token.json once so OAuth can re-consent the expanded scope set.
Google Keep OAuth scope can return invalid_scope in standard user OAuth flows.
Keep integration is therefore disabled by default.
Enable Keep when your Google Workspace setup supports it:
$env:ENABLE_KEEP="true"
Google Chat OAuth scopes also commonly require Google Workspace accounts. Chat integration is therefore disabled by default.
Enable Chat when your Google Workspace setup supports it:
$env:ENABLE_CHAT="true"
Google Meet integration is also disabled by default. Enable it only after enabling the Meet API for the same OAuth client:
$env:ENABLE_MEET="true"
Gemini media integration is also disabled by default. Enable it with a Gemini Developer API key:
$env:ENABLE_GEMINI="true"
$env:GEMINI_API_KEY="your-api-key"
Capability-specific Gemini model defaults:
$env:GEMINI_IMAGE_GENERATE_MODEL="gemini-3.1-flash-image-preview"
$env:GEMINI_IMAGE_EDIT_MODEL="gemini-3.1-flash-image-preview"
$env:GEMINI_VIDEO_UNDERSTANDING_MODEL="gemini-3-flash-preview"
$env:GEMINI_AUDIO_UNDERSTANDING_MODEL="gemini-3-flash-preview"
$env:GEMINI_REASONING_MODEL="gemini-3.1-pro-preview"
Whenever you enable one of these optional integrations or otherwise change the scope set, delete token.json and re-authenticate to refresh granted scopes.
Apps dashboard rollout flag
The MCP app-layer dashboard namespace is opt-in for controlled rollout.
Enable apps namespace:
$env:ENABLE_APPS_DASHBOARD="true"
Run (STDIO)
uv run python -m mcp_google_workspace
MCP Bundle (MCPB)
This repository now includes a native uv-based MCP Bundle manifest and packaging assets.
Install on Claude Desktop:
- Download the latest
.mcpbfrom GitHub Releases. - In Claude Desktop, open the MCP bundle install flow.
- Select the downloaded
mcp-google-workspace-*.mcpbfile. - Choose the credentials directory that contains
credentials.json, or leave it empty to use the repo defaults. - Enable optional integrations only if your Google Workspace account and OAuth client support their scopes.
- Finish the install and authenticate in the browser on first launch.
Gemini media tools are API-key-based rather than OAuth-based. If you enable Gemini in the bundle UI, also set the Gemini API key and optional model defaults there.
Build a local .mcpb archive only if you are developing or testing bundle changes:
uv run python scripts/build_mcpb.py
Note: Claude Desktop currently rejects extra server metadata keys such as package_manager, python_version, and working_dir, so this bundle keeps the uv server block to the manifest fields Claude accepts.
Bundle-specific documentation, runtime settings, and validation steps live in docs/MCPB.md.
Run (SSE)
$env:MCP_HOST="127.0.0.1"
$env:MCP_PORT="8000"
uv run python -m mcp_google_workspace.server_sse
Notable MCP tools
Gmail (namespaced as gmail_* in composed server):
send_emailread_emailsearch_emailslist_emailslist_labels,create_label,update_label,delete_label,apply_labelslist_attachments,download_attachmentmark_as_read,mark_as_unread,move_email,delete_emailuntrash_email,mark_as_spam,mark_as_not_spambatch_modify,batch_deletelist_filters,create_filter,delete_filter- Drafts:
list_drafts,get_draft,create_draft,update_draft,delete_draft,send_draft - Threads:
list_threads,get_thread,modify_thread,trash_thread,untrash_thread,delete_thread list_history- Forwarding addresses:
list_forwarding_addresses,get_forwarding_address,create_forwarding_address,delete_forwarding_address - Vacation settings:
get_vacation_settings,update_vacation_settings summarize_email(sampling-powered)
Calendar (namespaced as calendar_*):
get_events,get_event,list_calendars,get_timezone_info,get_current_datecheck_availability,create_event,update_event,delete_event- Smart scheduling:
find_common_free_slots - Event attachments:
list_event_attachments,add_event_attachment,remove_event_attachment,download_event_attachment - Event styling + conferencing fields on create/update:
color_id,visibility,transparency,conference_data - Conflict prevention: create/update run a FreeBusy overlap check and return
status: "CONFLICT"when slot is not available
Calendar smart scheduling (find_common_free_slots)
find_common_free_slots returns candidate meeting slots (not raw FreeBusy output) for all participants in a time window.
Inputs:
participants: list of calendar IDs/emailstime_min,time_max: RFC3339 windowslot_duration_minutes: desired meeting durationgranularity_minutes: candidate step sizemax_results: result captime_zone: optional timezone used in FreeBusy queryworking_hours_start,working_hours_end: optional daily working-hours filter (HH:MM, 24h)
Compatibility notes:
participantsshould be sent as a JSON array (for example["primary", "rodrigo@example.com"]).- Legacy callers can still use
meeting_durationas an alias forslot_duration_minutes.
Working-hours defaults:
working_hours_start:08:00working_hours_end:17:00
Drive (namespaced as drive_*):
- Files/content:
list_files,get_file,create_folder,create_file_metadata,upload_file - File mutations:
update_file_metadata,update_file_content,move_file,copy_file,delete_file - Content retrieval:
download_file,export_google_file,get_file_content_capabilities - Sharing:
list_permissions,get_permission,create_permission,update_permission,delete_permission - Shared Drives:
list_drives,get_drive,hide_drive,unhide_drive - Progress reporting:
upload_file,update_file_content,download_file, andexport_google_fileemit MCP progress updates - Use Drive for file discovery when you need Docs, Sheets, Slides, or Forms file IDs by MIME type or name
Sheets (namespaced as sheets_*):
get_spreadsheet,create_spreadsheet- Values:
get_sheet_values,batch_get_sheet_values,append_sheet_values,update_sheet_values - Raw request escape hatch:
batch_update_spreadsheet
Docs (namespaced as docs_*):
get_document,create_document- Convenience text mutations:
append_document_text,replace_document_text - Raw request escape hatch:
batch_update_document
Tasks (namespaced as tasks_*):
- Task lists:
list_tasklists,get_tasklist,create_tasklist - Tasks:
list_tasks,get_task,create_task,update_task,complete_task,move_task,delete_task
People (namespaced as people_*):
- Contacts:
list_contacts,search_contacts,get_contact,create_contact,update_contact,delete_contact - Contact groups:
list_contact_groups,create_contact_group,modify_contact_group_members - Scope note: v1 is personal contacts only; Workspace directory lookup is intentionally excluded
Forms (namespaced as forms_*):
get_form,create_form,batch_update_form- Publishing:
set_form_publish_settings - Responses:
list_form_responses,get_form_response
Slides (namespaced as slides_*):
get_presentation,create_presentation- Slide reads:
get_slide_page,get_slide_thumbnail - Text mutation and raw request escape hatch:
replace_text_in_presentation,batch_update_presentation
Apps (namespaced as apps_*, mounted when ENABLE_APPS_DASHBOARD=true):
- State/navigation:
get_state,set_state,patch_state,today,next_range,prev_range - Dashboard:
get_dashboard - Weekly calendar layout:
get_weekly_calendar_view(Google Calendar-like week columns) - Detail views:
get_event_detail,get_email_detail,get_email_attachment - Scheduling actions:
find_meeting_slots,create_meeting_from_slot,reschedule_meeting,cancel_meeting,respond_to_event
Keep (namespaced as keep_*):
create_note,get_note,list_notes,delete_noteshare_note,unshare_notesummarize_note(sampling-powered)- compatibility stubs for unsupported Keep v1 operations:
update_notearchive_note,unarchive_notelist_keep_labels,create_keep_label,delete_keep_label- checklist mutation helpers
Note: Keep tools/resources are mounted only when ENABLE_KEEP=true.
Chat (namespaced as chat_*):
list_spaces,get_spacelist_messages,get_messagecreate_message,update_message,delete_messagesummarize_space_messages(sampling-powered)
Note: Chat tools/resources are mounted only when ENABLE_CHAT=true.
Meet (namespaced as meet_*, mounted when ENABLE_MEET=true):
- Spaces:
create_space,get_space,update_space,end_active_conference - Conference records:
list_conference_records,get_conference_record
Gemini (namespaced as gemini_*, mounted when ENABLE_GEMINI=true):
generate_image,edit_imagedescribe_video,analyze_audio- local filesystem or Drive file ID inputs for media tools
- generated images are written locally under
GEMINI_OUTPUT_DIR - Artifacts and attendance metadata:
list_conference_participants,list_conference_recordings,list_conference_transcripts - v1 scope boundary: metadata only; transcript or recording file downloads still belong in Drive if added later
MCP Resources and Prompts
Gmail resources:
gmail://inbox/summarygmail://labelsgmail://email/{message_id}
Calendar resources:
calendar://todaycalendar://week
Drive resources:
drive://recentdrive://shared-drivesdrive://file/{file_id}
Keep resources:
keep://notes/recentkeep://note/{note_id}
Chat resources:
chat://spaceschat://space/{space_id}/messageschat://space/{space_id}/memberschat://users/{user_ref}chat://users/me
Apps resources (mounted when ENABLE_APPS_DASHBOARD=true):
apps://dashboard/currentapps://dashboard/day/{ymd}apps://dashboard/week/{ymd}apps://calendar/week/{ymd}
Prompts:
compose_email_promptreply_email_promptsummarize_inbox_promptsummarize_keep_note_promptextract_actions_from_keep_notes_promptdraft_chat_announcement_promptsummarize_chat_thread_prompt
MCP Client-Dependent Features
These features depend on active MCP client support and may be silently unavailable in clients that do not implement the corresponding MCP capabilities.
MCP Apps (UI Dashboard)
When ENABLE_APPS_DASHBOARD=true, the apps_get_dashboard and apps_get_weekly_calendar_view tools carry an _meta.ui.resourceUri annotation pointing to ui://apps/dashboard-ui. MCP clients that support the Apps rendering protocol (e.g. Claude Desktop) will embed an interactive workspace dashboard UI alongside the tool response.
The UI is a TypeScript web component that communicates with the server via PostMessage. It renders:
- A weekly calendar view (all-day events + timed event columns)
- An inbox summary with email detail drill-down
- Scheduling action buttons (RSVP, reschedule, cancel)
Session-scoped state (current view, anchor date, selected calendars, inbox query) is stored server-side per session and managed through apps_get_state / apps_set_state / apps_patch_state.
Requires: MCP client with App/iframe rendering support.
Progress Notifications
Long-running tools emit incremental notifications/progress messages via ctx.report_progress(current, total, description). Clients that handle progress notifications can display progress bars or status messages during API-heavy operations.
Tools that emit progress:
| Namespace | Tools |
|---|---|
| Drive | upload_file, update_file_content, download_file, export_google_file |
| Apps | get_dashboard, get_weekly_calendar_view, get_event_detail, get_email_detail, get_email_attachment |
| Chat | list_spaces, list_messages |
Requires: MCP client that handles notifications/progress.
Sampling
Several tools use MCP sampling (ctx.sample()) to generate LLM-powered summaries within the tool response, using the host client's configured model for inference.
Sampling-powered tools:
gmail_summarize_email— summarizes an email body in up to 5 bulletskeep_summarize_note— summarizes a Keep notechat_summarize_space_messages— summarizes recent messages in a Chat space
Requires: MCP client with sampling/createMessage support (e.g. Claude Desktop). Without sampling support these tools will fail or return an empty summary.
Tool Input Compatibility
All request-schema-based tools now apply the same input normalization layer:
- Accepts
camelCaseandsnake_caseparameter keys for object payloads. - Accepts full request payload as JSON string (must decode to an object).
- For list/dict fields, accepts JSON-string values; list fields also accept comma-separated strings.
find_common_free_slotsandapps_find_meeting_slotsacceptmeeting_durationas alias forslot_duration_minutes.
Recommendation: send a normal JSON object with native arrays/objects whenever possible.
Google Keep API limitations
Google Keep API v1 currently exposes create, get, list, and delete for notes, plus permission batch create/delete. It does not expose a direct update/patch endpoint, archive/unarchive endpoints, or dedicated label endpoints in v1. The MCP server returns explicit unsupported responses for those operations.
Marketplace packaging
This repo includes:
.claude-plugin/marketplace.json.claude-plugin/plugin.json
and a compatibility manifest at:
plugins/google-workspace/.claude-plugin/plugin.json
Reference docs:
Install with Claude Code marketplace
From within Claude Code:
/plugin marketplace add guinacio/mcp-google-workspace
/plugin install google-workspace@google-workspace-mcp
Local checkout flow (from this repository root):
/plugin marketplace add .
/plugin install google-workspace@google-workspace-mcp
Optional refresh after updates:
/plugin marketplace update google-workspace-mcp
Claude Desktop JSON (mcpServers)
If you want to run it directly in Claude Desktop without marketplace install, add this to your Claude Desktop config JSON under mcpServers.
Windows config file:
%APPDATA%\Claude\claude_desktop_config.json
macOS config file:
~/Library/Application Support/Claude/claude_desktop_config.json
Linux config file:
~/.config/Claude/claude_desktop_config.json
{
"mcpServers": {
"google-workspace": {
"command": "uv",
"args": [
"run",
"--directory",
"c:/path/to/mcp-google-workspace",
"python",
"-m",
"mcp_google_workspace"
],
"env": {
"ENABLE_APPS_DASHBOARD": "true",
"ENABLE_KEEP": "false",
"ENABLE_CHAT": "false",
"ENABLE_MEET": "false"
}
}
}
}
Replace c:/path/to/mcp-google-workspace with your local repo path.
Tests
uv run pytest -q
Apps smoke test:
# in-process mode (auto-enables apps namespace)
uv run python scripts/qa_apps_smoke.py
# or against a running SSE server
uv run python scripts/qa_apps_smoke.py --sse-url http://127.0.0.1:8001/sse
Existing calendar project reference
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。