Google Workspace MCP Server — Calendar, Drive, Gmail, Docs
Deploy an MCP server for Google Workspace to sync Calendar, Drive, Gmail and Docs with Streamable HTTP or SSE transport and full real-time support.
npx -y @taylorwilsdon/google_workspace_mcpOverview
This repository implements an MCP (Model Context Protocol) server for Google Workspace that synchronizes Calendar, Drive, Gmail and Docs with downstream agents or models. It exposes Workspace activity and content through streamable transports (HTTP streaming or Server-Sent Events) and is designed for real‑time workflows: change notifications and document edits are forwarded as continuous context updates so assistants and applications can stay in sync.
The server acts as a bridge between Google Workspace APIs and any MCP‑compatible consumer. It handles OAuth onboarding for Workspace accounts, watches or polls Workspace resources for changes, and emits standardized MCP events so models, chains, or other services can consume up‑to‑date context without repeatedly polling Google APIs.
Features
- Real‑time synchronization for Google Calendar, Drive, Gmail and Docs
- Streamable transports: HTTP stream or Server‑Sent Events (SSE)
- OAuth onboarding flow for Google Workspace accounts and service accounts
- Normalized MCP event payloads for easy consumption by models/agents
- Configurable resource subscriptions (which folders, labels, calendars, etc.)
- Lightweight server suitable for local development or containerized deployment
- Optional replay / history support for missed events
Installation / Configuration
Prerequisites: Docker (recommended) or a recent Node.js/Go/Python runtime depending on the chosen image. You also need Google Workspace API credentials (OAuth client ID/secret or service account) and workspace API access enabled in the Google Cloud Console.
Clone the repository:
Example using Docker:
# build and run (if Dockerfile provided)
Example .env file (used by docker-compose or local env):
PORT=8080
TRANSPORT=sse # or http_stream
GOOGLE_CLIENT_ID=xxx.apps.googleusercontent.com
GOOGLE_CLIENT_SECRET=yyy
GOOGLE_REDIRECT_URI=https://your-host/oauth/callback
MCP_API_KEY=replace-with-secret
SUBSCRIBE_RESOURCES=calendar,drive,gmail,docs
Common environment variables
| Variable | Purpose |
|---|---|
| PORT | Server listen port |
| TRANSPORT | Transport mode: sse or http_stream |
| GOOGLE_CLIENT_ID / SECRET | OAuth credentials |
| GOOGLE_REDIRECT_URI | OAuth callback URL |
| MCP_API_KEY | Key to authenticate MCP consumers |
| SUBSCRIBE_RESOURCES | Comma-separated list of resources to watch |
After starting the server, complete Google OAuth onboarding via the provided /auth or /connect endpoints, then create subscriptions for the resources you want to stream.
Available Resources
- GitHub repository: https://github.com/taylorwilsdon/google_workspace_mcp
- Google Workspace developer docs: https://developers.google.com/workspace
- OAuth 2.0 for Web Server Applications: https://developers.google.com/identity/protocols/oauth2
- Introduction to Server-Sent Events (MDN): https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events
(Consult the repo README and the code for exact endpoint names and runtime options.)
Use Cases
- Agent-assisted scheduling: stream Calendar events in real time to an assistant that suggests meeting times, detects conflicts, or drafts replies when events change.
- Document-aware chatbots: feed Google Docs edits to a model to maintain up‑to‑date context for summarization, Q&A, or version-aware suggestions.
- Enterprise search / indexing: forward Drive file updates and Gmail messages to an indexing pipeline or vector store so search results reflect current content.
- Alerting and automation: detect incoming emails or calendar changes and trigger workflows (Slack messages, tickets) based on MCP events.
- Multi-user collaboration dashboards: visualize live edits across Docs and Drive for auditing or team activity monitoring.
Example: subscribing to an SSE stream
Simple curl example to listen for MCP SSE events (replace token and endpoint):
SSE payloads will arrive as text/event-stream with lines like:
event: update
data: {"resource":"calendar","type":"event.created","payload":{...}}
Or use a minimal Node.js client:
;
;
es.onmessage ='mcp event', e.data;
For implementation-specific details, endpoint names, and advanced configuration (replay, rate limits, filtering), see the repository README and source. The server is intended as a foundation for integrating Google Workspace into model-driven workflows using the MCP pattern.