Google Workspace MCP Server
Provides tools to list and read Gmail threads, manage drafts (create, update, list, delete), list labels, and download attachments.
Provides tools to list, create, update, and delete Google Calendar events, including all-day events, attendees, locations, and custom calendar IDs.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Google Workspace MCP Server
An MCP (Model Context Protocol) server that gives AI assistants access to Gmail and Google Calendar through a standardized tool interface. Built with TypeScript.
Features
Gmail
Threads — List and read email threads with full text processing (quote stripping, signature removal, HTML-to-text conversion)
Drafts — Create, update, list, and delete email drafts with threaded reply support (draft-only, never sends)
Labels — List all Gmail labels (system + user)
Calendar
Events — Create, list, update, and delete calendar events with support for all-day events, attendees, and locations
Related MCP server: Gmail MCP Server
Prerequisites
Node.js 18+
A Google Cloud project with the Gmail API and Google Calendar API enabled
OAuth 2.0 client credentials (Desktop app type) from Google Cloud Console
Setup
1. Install dependencies
npm install2. Run the OAuth setup wizard
npm run setupThis will:
Prompt you for your OAuth Client ID and Client Secret
Prompt you for an account alias (e.g., "work", "personal")
Open a browser window for Google authorization
Start a local callback server on
http://localhost:3000/oauth2callbackSave tokens to
~/.config/google-workspace-mcp/tokens.jsonin multi-account formatVerify Gmail and Calendar API access
Run npm run setup again to add more accounts. The first account becomes the default.
Redirect URI: Make sure
http://localhost:3000/oauth2callbackis listed as an authorized redirect URI in your Google Cloud Console OAuth credentials.
No refresh token? If the setup fails because no refresh token was received, revoke app access at https://myaccount.google.com/permissions and run setup again.
3. Build and run
npm run build
npm startUsage with MCP Clients
Add to your MCP client config (Claude Desktop, Claude Code, etc.):
{
"mcpServers": {
"google-workspace": {
"command": "node",
"args": ["/absolute/path/to/google-workspace-mcp/dist/index.js"]
}
}
}Credentials are loaded from ~/.config/google-workspace-mcp/tokens.json (created by npm run setup). Environment variables (GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET, GOOGLE_REFRESH_TOKEN) are supported as a fallback for single-account use but npm run setup is the recommended approach.
Available Tools
All tools accept an optional account parameter to select which Google account to use (e.g., account: "work"). Omit it to use the default account.
Account Management
Tool | Description |
| List configured Google accounts and the default. Use to discover available account aliases |
Gmail
Tool | Description |
| List threads with optional search query ( |
| Read full thread content — all messages with bodies, or |
| Create a draft email with optional threading ( |
| Update an existing draft — only provide fields you want to change |
| Permanently delete a draft |
| List all drafts with IDs, subjects, and recipients |
| List all Gmail labels (system and user, including Superhuman auto-labels) |
| Download an attachment (by |
Calendar
Tool | Description |
| List events in a time range (defaults: now to 7 days). Validates |
| Create an event with summary, start/end, attendees, location, description |
| Update an event — only changed fields are sent (PATCH). At least one field must be provided |
| Delete an event |
OAuth Scopes
Scope | Purpose |
| Read threads, messages, labels |
| Create and manage drafts |
| List labels |
| Full calendar read/write |
Development
npm run build # Compile TypeScript (tsc → dist/)
npm test # Run all tests (vitest)
npx vitest run tests/drafts.test.ts # Run a single test fileProject Structure
src/
├── index.ts # MCP server — 13 tools with account param, transport
├── auth.ts # Multi-account OAuth2 factory, token migration, account resolution
├── utils.ts # compact() utility
├── gmail/
│ ├── threads.ts # Thread list/get with text processing pipeline
│ ├── drafts.ts # Draft CRUD, RFC 2822 email building
│ └── labels.ts # Label listing
└── calendar/
└── events.ts # Calendar event CRUD
tests/ # Vitest — mock-based, no real API calls
scripts/
└── setup-oauth.ts # Interactive OAuth setup wizard
specs/ # Planned feature specs (see specs/email-watcher.md)See CLAUDE.md for detailed architecture documentation and INDEX.md for a file-by-file reference.
License
MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Email inboxes and calendars for AI agents: send, receive, search, draft and schedule.
Email inboxes and calendars for AI agents: send, receive, search, draft and schedule.
Gmail, Outlook, Drive, OneDrive and calendars for AI agents. Many accounts, one endpoint, audit log.
Permissioned access to Gmail, Drive and Calendar via the user's own Google account
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants to manage Google Calendar events and Gmail emails through natural language. Supports creating/listing calendar events with smart color coding, sending/reading emails, and advanced search capabilities across both services.-
- AlicenseNot gradedqualityNot gradedmaintenanceEnables AI assistants to interact with Gmail through natural language, supporting email sending/reading, searching, draft management, label organization, and batch operations with secure OAuth authentication.-
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants to manage Gmail (list, search, send, label emails) and Google Calendar (list, create, update, delete events) via OAuth 2.0.-
- AlicenseAqualityBmaintenanceEnables AI assistants to search, read, draft, and send Gmail messages, as well as manage labels and trash using natural language.24127 npmMIT