gws-mcp
This server provides minimal Google Workspace functionality for Gmail, Drive, Docs, and Sheets across two fixed accounts (personal and professional).
Gmail:
Search messages using Gmail query syntax, with pagination and result limits.
Read the decoded body of a single message or an entire thread.
Send new emails (as drafts or immediately) with To, CC, BCC, subject, and body; optionally reply to a thread.
Modify labels (add/remove) on messages or threads to archive, mark read/unread, star, or trash.
Google Drive:
Search files and folders using Drive query syntax with optional MIME type filtering and pagination.
Retrieve file contents: exports Google Docs as Markdown, Google Sheets as CSV, and text files as raw.
Batch update files: move (change parent), rename, or trash multiple items at once.
Create new folders, optionally nested under a parent folder.
Google Docs:
Create a new Doc from Markdown content, with a title and optional parent folder.
Update a Doc by appending text or performing a find-and-replace on all occurrences of a string.
Google Sheets:
Read values from a specified A1 range.
Write or append a 2D array of values to a range; supports formula input via
USER_ENTEREDmode.
Constraints:
No permanent deletion – only trashing is available.
Every tool requires specifying the
accountparameter (personalorprofessional).Calendar event creation is listed in the README but is not currently available in the server schema.
Provides tools for searching, reading, sending, and modifying emails (labels, archive, read state, star, trash).
Provides tools for creating documents from Markdown and updating (append text, replace all occurrences).
Provides tools for searching files, getting content (Docs as Markdown, Sheets as CSV, text files), updating (move, rename, trash), and creating folders.
Provides tools for reading and writing to A1 ranges (write or append).
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., "@gws-mcpfind emails from Alice in my work Gmail"
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.
gws-mcp
The OAuth app behind this repo is published butnot verified by Google, and it serves only my own two Google accounts. The consent screen shows the "Google hasn't verified this app" warning by design, and its unverified user cap leaves no room for anyone else. To run this yourself, create your own Google Cloud project and Desktop OAuth client with the same three scopes. The setup section below covers every step, and the account emails come from environment variables, never from code. If enough demand shows up I may put the app through Google's verification process. Open an issue if you want that.
Minimal Google Workspace MCP server for Claude Code. Gmail, Drive, Docs,
Sheets, and Calendar across two fixed accounts. Thirteen tools, roughly
1,750 schema tokens.
It replaces workspace-mcp, whose same-service surface measured 65 tools and
roughly 28,000 tokens.
Tool surface
Tool | Purpose |
| Gmail query syntax in, message metadata out |
| Decoded body of one message or a whole thread |
| Send or draft, |
| Label names on messages or threads, covers archive, read state, star, trash |
| Drive query plus MIME filter |
| Docs export as Markdown, Sheets as CSV, text files raw |
| Batch move, rename, trash. Per-file results |
| New folder under a parent |
| New Doc from Markdown |
| Append text or replace all occurrences |
| A1 range in, values out |
| Write or append to an A1 range |
| New event, all-day or timed, optional RRULE recurrence and popup reminder |
Every tool takes account, an enum of personal and professional. The
alias-to-email map comes from GWS_MCP_PERSONAL_EMAIL and
GWS_MCP_PROFESSIONAL_EMAIL, set in .envrc.
No tool can permanently delete anything. Trashing is the only removal the
tool surface performs. The stored token itself carries the full drive
scope, which Google classifies as restricted, so guard the token store, and
know that the credential could do more than the tools allow.
Related MCP server: Google Workspace MCP
Google Cloud setup (one time)
Create a project at https://console.cloud.google.com/projectcreate. The string "google" is banned in project IDs and app names.
Enable five APIs: Gmail, Google Drive, Google Docs, Google Sheets, Google Calendar.
Google Auth Platform: External audience, no test users.
Publish to Production immediately. A Testing-status app expires every refresh token 7 days after consent.
Create a Desktop-app OAuth client. Copy the client ID and secret.
Do not submit the app for verification. The unverified-app warning at consent time is expected.
Secrets and environment
The client credentials live in safetybox:
gwsmcp/google-client-id -> GWS_MCP_GOOGLE_CLIENT_ID
gwsmcp/google-client-secret -> GWS_MCP_GOOGLE_CLIENT_SECRET.envrc is not committed. Copy .envrc.example, fill in the two account
emails, then run direnv allow. The safetybox line loads both client
credentials with one identity unlock, reading the passphrase from passage
via secret-get. Only the auth CLI reads these variables. OAuth tokens
land in ~/.local/share/gws-mcp/tokens.db, file mode 0600, directory
0700, never in the repo.
Install and authenticate
uv sync
uv run gws-mcp-auth personal
uv run gws-mcp-auth professionalEach run opens a browser. Sign in as the matching account and click through Advanced at the unverified-app warning. The CLI verifies the signed-in address against the alias and refuses to save a mismatch.
A scope added to SCOPES never reaches an already-stored grant. Re-run
gws-mcp-auth <alias> for each account, otherwise the new tool fails
with an insufficient-scope 403.
Then verify with the live read-only smoke script:
uv run python scripts/smoke.pyRegister with Claude Code
claude mcp add gws-mcp -s user -- uv run --directory /Users/samuelstidham/code/samuel-stidham/gws-mcp gws-mcpTesting
uv run pytestThe suite fakes every Google endpoint with respx and never touches the live APIs. It covers account routing, the single-refresh 401 rule, rate-limit backoff, MIME decoding, label resolution, batch Drive semantics, Sheets append, protocol round-trips, stdout cleanliness, and the schema budget.
Measure the schema at any time:
uv run python scripts/measure_schema.py
uv run python scripts/measure_schema.py --probe uvx workspace-mcp --tools gmail drive docs sheetsThe probe spawns the child with the MCP SDK's safe environment allowlist,
so no secret from your shell reaches it. Pass --env KEY=VALUE for
anything the probed server genuinely needs.
Known failure modes
A Google password change revokes that account's refresh token. Re-run
gws-mcp-auth <alias>. A running server picks up the new grant on its next refresh, no restart needed.A refresh token unused for six months expires.
The server refreshes once on 401 and then fails with the exact re-auth command in the error message. A dead grant fails a whole batch immediately instead of retrying per item.
sheets_writeusesUSER_ENTERED, so a value starting with=becomes a live formula. That is deliberate, and it means untrusted text should not be written to sheets verbatim.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityDmaintenanceA minimal MCP server that enables Claude to search, read, and manage Gmail messages and threads using official Google API libraries. It supports actions like sending emails, creating drafts, replying to threads, and managing labels through secure OAuth2 authentication.Last updatedMIT
- Alicense-qualityFmaintenanceMCP server that enables Claude to interact with Google Workspace services including Drive, Docs, Sheets, Slides, Calendar, Gmail, and Contacts.Last updated86738MIT
- Alicense-qualityCmaintenanceMCP server for Claude Code CLI that integrates with Google Workspace, enabling management of Docs, Sheets, Drive, Gmail, Calendar, and Apps Script.Last updated272MIT
- Alicense-qualityAmaintenanceMCP server that gives Claude natural-language access to Google Workspace (Sheets, Docs, Gmail, Calendar, Drive, Tasks, Contacts) via gogcli.Last updated1MIT
Related MCP Connectors
Streamable HTTP MCP server for Google Calendar and Sheets with OAuth login.
Hosted Google Calendar MCP server for AI agents. No self-hosting or Google Cloud setup.
MCP server for Google search results via SERP API
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/samuel-stidham/gws-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server