google-workspace-mcp
Send real emails, create drafts, and list drafts through the Gmail API.
List events, create, update, and delete calendar events, optionally with attendees.
Create files in Google Drive (limited to files the server created itself).
Read and write spreadsheet ranges by A1 notation.
Search videos, get video/channel metadata, manage playlists, post comments and replies, rate videos, and manage subscriptions.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@google-workspace-mcpsend an email to mom saying I'll be late"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
google-workspace-mcp
An MCP server that gives Claude Code write access to a personal Google account — Gmail, Drive, Calendar, Sheets, and YouTube — backed by a self-owned Google Cloud OAuth client rather than a hosted third-party connector. It can send real email, not just draft it.
23 tools across 5 Google APIs. Runs locally over stdio.
You: email me a summary of today's calendar
Claude: [calendar_list_events] → 4 events
[gmail_send_email] → deliveredWhy own the OAuth client
The hosted Google connectors are read-mostly. Making Claude Code act — send a real email, create a real invite, write a real spreadsheet cell — means holding the OAuth client yourself. That single decision drives most of what's interesting below.
Related MCP server: gogcli-mcp
Design notes
Least-privilege scopes, chosen to avoid a paid security review
Google classifies gmail.readonly and drive.readonly as Restricted scopes. Shipping an app that uses them requires a CASA security assessment — a paid, recurring third-party audit. That is not a sensible cost for a single-user personal tool, so this server requests only write scopes:
Scope | Why |
| Send and draft. Never reads the inbox. |
| Can only touch files it created itself — cannot read pre-existing Drive content. |
| Calendar is not a restricted scope. |
| Read and write sheets by ID. |
| Playlists, subscriptions, comments, ratings. |
Reading arbitrary Gmail and Drive content is left to the existing claude.ai connectors. The two halves compose: read there, act here.
The refresh token expires every ~7 days — this is expected
The OAuth client sits in Google's Testing publishing mode, and Google invalidates refresh tokens for testing-mode apps after 7 days of inactivity. Auth breaking after a week away is normal maintenance, not a bug:
npm run check-auth # is the stored token still good?
npm run authorize # re-consent in the browser; rewrites credentials/token.jsonMoving to "In production" would remove the expiry but triggers exactly the verification review the scope choices above were made to avoid. For a single-user setup, periodic re-authorization is the cheaper trade.
Irreversible tools say so in their own descriptions
A tool description is the only thing the model reads before deciding to call it, so the warnings live there rather than in a confirmation layer the model can route around. From src/gmail.js:
Sends an email immediately from the authorized Gmail account, optionally with file attachments. This is a real send with no draft/review step and cannot be undone.
calendar_create_event and sheets_write_range carry equivalent warnings.
Several tools are externally visible under your real identity: gmail_send_email delivers to real inboxes, calendar_create_event with attendees emails invitations, and the YouTube comment tools post publicly. They are ordinary tools — but they're the ones where a mistake is visible to other people.
Refreshed tokens are persisted
googleapis emits a tokens event when it silently refreshes an access token. src/auth.js listens and merges the result back to disk, so a long-lived session doesn't lose its refresh token across restarts.
Setup
Requires Node 20+.
1. Create the OAuth client
In the Google Cloud Console, create a project.
Enable the Gmail, Google Calendar, Google Drive, Google Sheets, and YouTube Data v3 APIs.
Under APIs & Services → OAuth consent screen: External, publishing status Testing, and add your own Google account under Test users.
Under Credentials, create an OAuth client ID of type Desktop app.
Download the JSON to
credentials/client_secret.json.
credentials/ is git-ignored. See credentials/client_secret.example.json for the expected shape.
2. Authorize
npm install
npm run authorizeOpens a loopback listener on localhost:53682, prints a consent URL, and writes the refresh token to credentials/token.json. Google shows an "unverified app" warning — expected for a Testing-status client only you can use.
3. Register with Claude Code
claude mcp add google-workspace --scope user -- node /absolute/path/to/google-workspace-mcp/src/index.jsThen claude mcp list to confirm it connected.
Tools
Gmail
Tool | Purpose |
| Send a real message — delivered immediately, not a draft |
| Compose without sending |
| List existing drafts |
Calendar
Tool | Purpose |
| Events in a time range |
| Create an event, optionally with attendees |
| Modify an existing event |
| Remove an event |
Drive / Sheets
Tool | Purpose |
| Create a file in Drive |
| Read an A1-notation range |
| Write an A1-notation range |
YouTube
Tool | Purpose |
| Search videos, channels, playlists |
| Metadata and statistics |
| Playlist contents |
| Build playlists |
| Comment threads |
| Like / dislike / clear |
| Subscriptions |
Layout
src/auth.js OAuth client construction, token load/refresh persistence
src/gmail.js MIME assembly (incl. base64 attachments) + gmail_* tools
src/calendar.js calendar_* tools
src/drive.js drive_* tools
src/sheets.js sheets_* tools
src/youtube.js youtube_* tools
src/index.js McpServer construction + stdio transport
scripts/authorize.js one-time / periodic OAuth consent flow
scripts/check-token.js token health check
scripts/smoke-test.js end-to-end check across the API surfaces
test/tools.test.js schema + MIME tests — no network, no credentialsTests
npm testExercises the tool registry and the MIME builder only: no network, no credentials, safe in CI. Asserts that all 23 tools register under unique names, that registration never eagerly reaches for a token, that the tools capable of irreversible external side effects declare that in their descriptions, and that Gmail MIME assembly produces well-formed multipart messages with RFC 2045 line wrapping and base64url encoding.
Auth files
Both live in credentials/, which is git-ignored:
client_secret.json— the OAuth client, downloaded from Google Cloud Consoletoken.json— access + refresh tokens, written bynpm run authorize
Neither has ever been committed. If credentials/ is lost, re-download the client secret and re-run npm run authorize.
Notes
Depends on
googleapis, which is heavy (~109 MB of the ~126 MBnode_modules). That is the package, not a mistake.Scopes are requested up front at authorize time. Adding a new API later means re-running
npm run authorizeso the new scope is granted.
Privacy policy
Google requires a published policy on the consent screen even for a Testing-status app: brettadams0.github.io/google-workspace-mcp-policy (source).
License
MIT — see LICENSE.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/brettadams0/google-workspace-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server