Google Workspace (GWS) MCP Server
This server provides AI assistants with controlled access to Google Workspace services through 25 curated tools, translating MCP tool calls into gws CLI commands for Google Drive, Sheets, Calendar, Docs, and Gmail.
Google Drive (9 tools)
Search and list files (including shared drives)
Get file metadata by ID
Create new files with optional content upload
Copy files (useful for format conversion)
Update file metadata or content
Delete files permanently
Export Google Workspace files (Docs, Sheets, Slides) to PDF, DOCX, XLSX, CSV, plain text, etc.
Download file content inline (text or base64 for binary), with automatic export for Google-native files
Share files by managing permissions for users, groups, domains, or anyone
Google Sheets (4 tools)
Get spreadsheet metadata
Read cell values from a specified range
Write cell values to a specified range
Append rows after the last row in a range
Google Calendar (5 tools)
List events with time range and search query filtering
Get a single event by ID
Create new events (title, time, location, description)
Update existing events
Delete events
Google Docs (3 tools)
Get document content and metadata
Create new empty documents
Apply batch updates (insert text, formatting, etc.)
Gmail (4 tools)
Search and list messages using Gmail query syntax
Read a single message in various formats (full, metadata, minimal, raw)
Search and list email threads
Read a full thread with all messages in a conversation
You can also configure which services to expose to avoid unnecessary context window usage.
Allows for searching and reading Gmail messages and threads to manage email communication programmatically.
Provides tools for managing Google Workspace services, including file operations in Google Drive, spreadsheet manipulation in Google Sheets, event management in Google Calendar, and document editing in Google Docs.
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 (GWS) MCP ServerSearch my Gmail for recent messages about the project status"
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-server
Google Workspace for AI agents: Gmail, Calendar, Drive, Sheets, Docs, and Tasks as a curated set of 39 Model Context Protocol tools, built on the official Google Workspace CLI (gws).
Why?
The gws CLI had a built-in MCP server that was removed in v0.8.0 because it exposed 200-400 tools — causing context window bloat in MCP clients. This server takes a curated approach: you choose which Google services to expose, and only a focused set of high-value, narrowly scoped operations are registered as tools. Every tool declares all four MCP annotation hints — readOnlyHint, destructiveHint, idempotentHint, openWorldHint — so clients can reason about side effects, know which writes are safe to retry, and surface clearer consent prompts.
Related MCP server: google-connections-mcp
Prerequisites
Node.js 18+
gwsCLI installed and authenticated (npm install -g @googleworkspace/cli && gws auth login)
Grant fewer scopes than the default
This server exposes no send tool — the closest thing is gmail_drafts_create, which explicitly does not send. The token gws auth login mints is broader than that.
gws auth login opens a scope picker listing nine scopes. The default grant is seven: full read-write drive, spreadsheets, gmail.modify (Google documents it as "Read, compose, and send emails"), calendar, documents, presentations, and tasks — the same seven you get running non-interactively as DEFAULT_SCOPES.
The other two rows are Cloud Pub/Sub and Cloud Platform, and neither is part of the default grant — gws auth login --help describes --full as "Request all scopes incl. pubsub + cloud-platform."
Which rows start checked has not been verified against a live picker — the seven above are the documented default grant, not an observation of the TUI. Read the checkboxes before pressing Enter rather than trusting this paragraph.
So the token on disk can send mail and rewrite Drive even though nothing here will. Deselect what you do not need in the picker, or:
gws auth login --readonly # read-only across services
-s gmail limits the picker to Gmail, per the flag's own help text ("Comma-separated service names to limit scope picker"). It cannot pull in cloud-platform or pubsub, because those two are reachable only through --full.
On Linux there is no keyring, and the encryption key is a file next to the data it encrypts. gws enables the keyring crate's native backends only for macOS and Windows; on every other platform the dependency is declared with no backend feature, so the store falls through to writing .encryption_key into ~/.config/gws/. That file is not a backup of a key held elsewhere — it is the key, and the credential store's own doc comment says it is never deleted. Setting GOOGLE_WORKSPACE_CLI_KEYRING_BACKEND=file changes nothing there because that is already the only path. On macOS and Windows the key file is removed once the OS keyring holds the key. If you run this headless on Linux, treat ~/.config/gws/ as a password file: anyone who can read the directory has the credentials.
Quick start
# Install
npm install -g gws-mcp-server
# Or run from source
git clone https://github.com/conorbronsdon/gws-mcp-server.git
cd gws-mcp-server
npm install && npm run buildConfiguration
Claude Code (.mcp.json)
{
"mcpServers": {
"google-workspace": {
"command": "npx",
"args": [
"gws-mcp-server",
"--services", "drive,sheets,calendar,docs,gmail,tasks"
]
}
}
}Claude Desktop (claude_desktop_config.json)
{
"mcpServers": {
"google-workspace": {
"command": "npx",
"args": [
"gws-mcp-server",
"--services", "drive,sheets,calendar"
]
}
}
}Options
Flag | Description | Default |
| Comma-separated list of services to expose | All services |
| Path to the |
|
| Register only the read-only tools | off |
--read-only
--read-only registers 17 tools instead of 39. Every tool that writes to Google is left unregistered, so it never appears in tools/list and there is nothing for an agent to call — including gmail_drafts_create, which is a write even though it never sends. drive_files_download stays, since it reads.
gws-mcp-server --read-only
gws-mcp-server --read-only --services drive,calendar # combines with -sThis constrains the agent, not the credential. The token on disk keeps whatever scopes it was granted, and anything else on the machine can still use it. gws auth login --readonly is what narrows the token; the two are complementary. For an MCP server the agent is the threat model, but that is the limit of the claim.
Available services & tools
drive (9 tools)
drive_files_list— Search and list filesdrive_files_get— Get file metadatadrive_files_create— Create files (with optional upload)drive_files_copy— Copy files (useful for format conversion)drive_files_update— Update file metadata/contentdrive_files_delete— Delete filesdrive_files_export— Export Google Workspace files (Doc, Sheet, Slide) to other formatsdrive_files_download— Download file content (text inline, binary as base64 or saved to a path; Google-native files are exported to a readable format)drive_permissions_create— Share files
sheets (4 tools)
sheets_get— Get spreadsheet metadatasheets_values_get— Read cell valuessheets_values_update— Write cell valuessheets_values_append— Append rows
calendar (5 tools)
calendar_events_list— List eventscalendar_events_get— Get event detailscalendar_events_insert— Create eventscalendar_events_update— Update events (only supplied fields change)calendar_events_delete— Delete events
docs (3 tools)
docs_get— Get document contentdocs_create— Create documentsdocs_batchUpdate— Apply document updates
gmail (6 tools)
gmail_messages_list— Search messagesgmail_messages_get— Read a messagegmail_threads_list— Search threadsgmail_threads_get— Read a full threadgmail_threads_modify— Add/remove labels on a thread (archive, mark read, star)gmail_drafts_create— Create a draft (plain text and/or HTML, with reply threading viathreadId). Drafts are never auto-sent
tasks (12 tools)
tasks_tasklists_list— List task liststasks_tasklists_get— Get a task listtasks_tasklists_insert— Create a task listtasks_tasklists_update— Update a task list (only supplied fields change)tasks_tasklists_delete— Delete a task listtasks_tasks_list— List tasks (filters: completed/hidden/due dates)tasks_tasks_get— Get a tasktasks_tasks_insert— Create a task (optionally nested or positioned)tasks_tasks_update— Update a task (only supplied fields change; common use: mark complete)tasks_tasks_move— Move a task within/across lists or reordertasks_tasks_delete— Delete a tasktasks_tasks_clear— Hide all completed tasks in a list
Update semantics: the
*_updatetools (calendar events, tasks, task lists) use the Google API'spatchverb — they merge the fields you supply and leave the rest untouched. To clear an existing value, pass it explicitly (e.g. an empty string) rather than omitting it.
Total: 39 tools (vs 200-400 in the old implementation)
Adding new tools
Edit src/services.ts to add tool definitions. Each tool maps directly to a gws CLI command:
{
name: "drive_files_list", // MCP tool name
description: "List files in Drive", // Shown to AI
command: ["drive", "files", "list"],// gws CLI args
params: [ // Maps to --params JSON
{ name: "q", description: "Search query", type: "string", required: false },
],
bodyParams: [ // Maps to --json body
{ name: "name", description: "File name", type: "string", required: true },
],
}Typed errors
Tool call failures are mapped to a typed error hierarchy (src/errors.ts): AuthenticationError (401/403), RateLimitError (429), ValidationError (400), NotFoundError (404, with a shared-drive access hint for drive commands), and ServerError (5xx), all extending a base GwsError. Unlike an HTTP API client, this server has no response object to read a status code from — it spawns the gws CLI as a subprocess and only sees plain text (stdout/stderr, or a rejected promise's .message). mapGwsErrorToTyped() recovers a status-like code from that text, handling both a raw JSON error body (Google's own {"error":{"code":...,"message":...}} shape) and plain text containing an HTTP-status-like token (e.g. "Error 404: ..."). If neither pattern is found, the original message passes through unchanged rather than forcing an invented status onto it.
Architecture
MCP Client (Claude) ←→ stdio ←→ gws-mcp-server ←→ gws CLI ←→ Google APIsThe server is a thin wrapper: it translates MCP tool calls into gws CLI invocations, passes --params and --json as appropriate, and returns the JSON output. Authentication stays in the gws CLI — this server never sees or stores your Google credentials.
Development
git clone https://github.com/conorbronsdon/gws-mcp-server.git
cd gws-mcp-server
npm ci
npm run lint # type-check
npm run build
npm test # vitest, mocks the executor layer — no real gws callsContributing
Issues and pull requests are welcome. The most useful contributions are new tool definitions in src/services.ts for high-value gws operations (see "Adding new tools" above). Keep the curated contract: a focused set of narrowly scoped tools, not a 1:1 mirror of every Google API surface. See SECURITY.md for how to report vulnerabilities.
About
Built and maintained by Conor Bronsdon. I host the Chain of Thought podcast, which covers AI infrastructure, developer tools, and how practitioners actually use this stuff. I built this to give the agent workflows that run the show safe, curated access to Gmail, Calendar, Drive, Sheets, Docs, and Tasks.
Companion tools:
Transistor-MCP: the Transistor.fm MCP server. Episodes, transcripts, and download counts.
substack-mcp: read posts and manage drafts on Substack, safe for agent workflows.
podcastindex-mcp: the Podcast Index MCP server, search by person or topic, trending shows, feed health.
op3-mcp: podcast analytics through OP3. Downloads, geography, apps. Read-only.
ai-tools-for-creators: a curated list of AI skills and MCP servers for people who ship ideas for a living.
More at chainofthought.show and on X.
Disclaimer
This is an independent personal project, not affiliated with, sponsored by, or endorsed by any company. All views expressed are my own.
License
MIT
Maintenance
Related MCP Servers
- Alicense-qualityDmaintenanceEnables interaction with Google Drive files and Google Sheets through search, read, and write operations. Supports automatic conversion of Google Workspace files to readable formats and direct spreadsheet cell updates.Last updated7,774MIT
- Flicense-qualityDmaintenanceProvides AI assistants with access to Google Workspace APIs including Sheets, Calendar, Gmail, Tasks, Drive, and Docs. Enables full CRUD operations and management of Google services through natural language.Last updated1
- Alicense-qualityCmaintenanceEnables management of Google Workspace apps (Docs, Sheets, Gmail, Calendar, Drive) from the command line via Gemini CLI.Last updated625Apache 2.0
- Alicense-qualityBmaintenanceEnables AI agents to control Google Workspace services (Slides, Docs, Sheets, Drive) with granular tools and provides a universal CLI escape hatch for all Workspace APIs.Last updatedMIT
Related MCP Connectors
Securely search and manage workspace context files for AI agents and teams.
Gateway between LLM agents and world data through eight tools and a bundled endpoint catalog.
Schedule and manage Google Calendar events directly from your workspace. Check availability, view…
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/conorbronsdon/gws-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server