gworkspace-mcp
Provides tools for working with Gmail on a per-account basis: searching and reading threads and messages, listing labels and drafts, reading attachments (optionally converting PDF/Office files to text or saving them to a local path), and creating, updating, sending, replying to, forwarding, labeling, trashing and marking messages as spam, plus label management.
Signs in and stores a token for several Google accounts at once, each identified by a label, and lets every tool act on the chosen account (by label or email) with a configurable default, including per-account service, send and read-only restrictions.
Provides tools for interacting with Google Drive: searching, listing recent files, reading metadata, converting files to readable text (Docs as Markdown, Sheets as CSV, PDFs/Office files/images), downloading files, inspecting permissions, revisions, shared drives and comments, and creating, copying, updating, trashing, sharing and commenting on files.
Provides tools for working with Google Slides: reading a presentation and its outline, reading individual pages, rendering slide thumbnails as images, replacing text, sending raw batch update requests, and creating new presentations.
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.
gworkspace-mcp
gworkspace-mcp is a local MCP server that lets Claude, or any other MCP client, work in Google Drive, Docs, Sheets, Slides, Gmail and Calendar for several Google accounts at once. You sign in each account once, give it a short label such as work or personal, and every tool takes that label as its account argument.
Google's hosted connectors sign in to one Google account each. This server runs on your own machine and keeps one token per account. A single conversation can read a doc from one account and email it from another.
What you need
uv, which installs the right Python (3.12 or newer) for you.
A Google Cloud project where you can create an OAuth client. A free project is enough.
Related MCP server: mcp-google-multi
Setup
1. Create your own OAuth client
Each person who runs this server creates their own OAuth client. The project ships no shared client. Google classes full Drive and Gmail access as "restricted" scopes. A shared client with those scopes would need Google's app verification and a paid security audit before anyone else could sign in.
Create a project in the Google Cloud console, or pick an existing one.
Turn on the APIs the server calls. With the
gcloudCLI:gcloud services enable drive.googleapis.com docs.googleapis.com \ sheets.googleapis.com slides.googleapis.com gmail.googleapis.com \ calendar-json.googleapis.comYou can also turn each one on from APIs & Services > Library in the console. You only need the APIs for the services you plan to use.
Open Google Auth Platform in the console. Under Branding, enter an app name and your email. Google needs a home page and a privacy policy link before it will publish the app. You can use
https://github.com/gborges0727/gworkspace-mcpandhttps://github.com/gborges0727/gworkspace-mcp/blob/main/PRIVACY.md, withgithub.comas the authorized domain. Under Audience, choose External, then click Publish app. An app left in "Testing" status gets tokens that Google expires after 7 days, so you would sign in again every week. A published app that Google has not verified works for up to 100 users. Each account you sign in sees an "unverified app" warning once.Under Clients, create a client of type Desktop app and download its JSON file.
Save that file as
~/.config/gworkspace-mcp/client_secret.json:mkdir -p ~/.config/gworkspace-mcp mv ~/Downloads/client_secret_*.json ~/.config/gworkspace-mcp/client_secret.json
A Google Workspace account may block apps that Google has not verified. Sign-in then fails with a message that your administrator blocked the app. The Workspace admin can mark the app as trusted in the Admin console, under Security > Access and data control > API controls.
2. Add your accounts
Run accounts add once for each Google account, with a label of your choice:
uvx gworkspace-accounts-mcp accounts add work
uvx gworkspace-accounts-mcp accounts add personal --no-send --services drive,docs,gmailThe command prints a Google sign-in URL. Open it in a browser on any device and approve access. Google then sends the browser to a localhost address, and the page fails to load. That failure is expected. Copy the full URL from the address bar and paste it into the terminal. The command checks the URL, saves the account's token, and prints the email it signed in as.
This works over SSH and on machines with no browser, because nothing has to listen on localhost.
These options limit what an account can do:
--servicespicks which ofdrive,docs,sheets,slides,gmailandcalendarthe account grants. Google asks only for those permissions, and the server refuses the other services' tools for that account. Leaving it out grants all six. Choosingdocs,sheetsorslidesaddsdrivetoo, because those tools use Drive for links and folder moves.--no-sendkeeps the account from sending email. The server refusesgmail_send, andgmail_replyandgmail_forwardwork only withas_draft=true, which saves a draft you send yourself. Calendar changes that would email guests are refused too, unless the call passessend_updates="none". So is a Drive share that would email the person you share with, unless the call passessend_notification=false. Google has no permission that allows drafts without sending, so the server enforces this itself.--read-onlyasks Google only for read access. The server refuses every tool that would change something in that account, before it contacts Google. A read-only account cannot send email or save drafts.
3. Connect it to your MCP client
For Claude Code:
claude mcp add gworkspace --scope user -- uvx gworkspace-accounts-mcp serveFor Claude Desktop and other clients that use a JSON config, add:
{
"mcpServers": {
"gworkspace": {
"command": "uvx",
"args": ["gworkspace-accounts-mcp", "serve"]
}
}
}The server reads the account files on every call. An account you add while the server runs works on the next tool call, without a restart.
If Google's hosted Drive or Gmail connectors are also turned on in your client, Claude sees two sets of similar tools. Turn the hosted ones off, or tell Claude which to use.
Managing accounts
Command | What it does |
| Signs in a Google account under |
| Shows each label, its email, its services, whether it can write and send, and which one is the default. |
| Picks the account the tools use when a call names none. |
| Deletes the account's token file and asks Google to revoke the token. |
Labels use lowercase letters, digits, - and _, up to 32 characters.
A tool call can name an account by its label or by its email. When a call names no account, the server uses the default account. With no default set, it uses the only account if there is one, and otherwise returns an error that lists the labels.
Google revokes a token with Gmail access when you change that account's password. The next tool call then fails with the exact accounts add command that signs it in again.
Tools
Every tool name starts with its service, and every tool that touches Google takes an optional account argument. Tools that take a file accept either its ID or its full Google URL.
Service | Read | Write |
Accounts |
| |
Drive |
|
|
Docs |
|
|
Sheets |
|
|
Slides |
|
|
Gmail |
|
|
Calendar |
|
|
Some tools do more than pass one request through to Google:
drive_read_contentreturns a file as readable text. Docs come back as Markdown and Sheets as CSV, one section per tab. PDF, Word, Excel and PowerPoint files are converted on your machine, and images come back as images the model can see.drive_createuploads text or a file from a local path. A Markdown upload becomes a formatted Google Doc, and a CSV or.xlsxbecomes a Google Sheet.drive_downloadandgmail_read_attachmentcan save straight to a local path, so a large file never passes through the conversation. The rules under Safety settings decide which paths they accept.gmail_read_attachmentcan also return a PDF or Office attachment as text.docs_outlineandslides_outlinelist each paragraph or slide element with its position. The model can find where to edit without reading the full document structure, which runs to hundreds of KB for a long doc.sheets_a1_to_grid_rangeturns a range like'Q3 Budget'!B4:D10into the numeric sheet ID and 0-based indexes that Sheets edit requests need.slides_page_thumbnailreturns a slide as an image the model can look at.gmail_replyandgmail_forwardbuild the threading headers, quote the original, and carry its attachments over on a forward. Attachments on any outgoing email can come from a local path.calendar_find_meeting_timeschecks everyone's free and busy times and returns the open slots inside working hours.
docs_batch_update, sheets_batch_update and slides_batch_update send raw batch update requests to Google's APIs. The Docs and Slides tools take the document's revisionId from a recent read. Google then rejects the edit if someone changed the document after that read.
Calendar tools that change an event email its guests by default when it has any. Pass send_updates="none" to change the event without emailing anyone.
Differences from Google's hosted connectors
The tool set follows Google's hosted Drive, Docs, Sheets, Slides and Gmail connectors. Those connectors can do some things that Google's public APIs cannot:
Requesting access to a file you cannot open.
Reading the transcript of a video file.
Writing Docs edits as tracked suggestions. The public Docs API makes direct edits only.
Sharing with Google Chat spaces or Workspace target audiences.
drive_shareshares with people, groups, a whole domain, or anyone with the link.
Safety settings
Claude may follow instructions it reads in an email or a shared doc. The server limits what one tool call can do with your local files, your tokens and your sharing settings, so such an instruction does less harm.
Tools that read or write files on your machine (drive_create, drive_download, gmail_read_attachment, slides_page_thumbnail, and attachments on outgoing email) follow these rules:
They refuse the server's own config folder, which holds your tokens.
They refuse hidden files and anything inside a hidden folder in your home folder, such as
~/.ssh,~/.awsor~/.zshrc.They never replace an existing file unless the call passes
overwrite=true. They never follow a symlink when writing, and they never create folders.When
GWORKSPACE_MCP_FILE_ROOTSis set, they use only files inside the folders it lists. Separate the folders with:on macOS and Linux, or;on Windows, for exampleGWORKSPACE_MCP_FILE_ROOTS=~/Downloads:~/Documents/shared.
Without GWORKSPACE_MCP_FILE_ROOTS, a tool call can still attach any other file in your home folder to an email or upload it to Drive. Set it to the folders you actually use.
drive_share refuses link sharing ("anyone with the link") and sharing with a whole domain. Set GWORKSPACE_MCP_ALLOW_PUBLIC_SHARE=1 to allow both. A tool argument cannot turn either setting on, so text in an email or doc cannot change them.
Set these variables where your MCP client starts the server. For Claude Code:
claude mcp add gworkspace --scope user -e GWORKSPACE_MCP_FILE_ROOTS=~/Downloads \
-- uvx gworkspace-accounts-mcp serveFor a JSON config, add an "env" object next to "args".
Where your data lives
The server keeps everything under ~/.config/gworkspace-mcp/. It uses $XDG_CONFIG_HOME/gworkspace-mcp when that variable is set, and $GWORKSPACE_MCP_HOME overrides both. Set GWORKSPACE_MCP_CLIENT_SECRET to read the OAuth client from somewhere else.
client_secret.jsonholds your OAuth client.accounts/<label>.jsonholds one account's email, services, send and read-only settings, and its token. The server writes these files with mode 600 and the folders with mode 700.config.jsonrecords the default account.
The server talks only to Google. It never prints or returns a token. When it refreshes a token, it writes the new one back into the same account file.
Development
git clone https://github.com/gborges0727/gworkspace-mcp
cd gworkspace-mcp
uv sync
uv run pytest -qThe tests mock every Google call, so they need no account and no network.
Each service's tools live in their own module under src/gworkspace_mcp/tools/. The docstring at the top of src/gworkspace_mcp/context.py explains how to write a tool. It covers how a tool resolves its account, how it refuses writes and sends the account does not allow, and how it turns Google errors into short messages.
License
The project uses the MIT license, in LICENSE.
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
Hosted MCP for Google Workspace, Atlassian and Notion: one OAuth, per-user accounts, write access.
Permissioned access to Gmail, Drive and Calendar via the user's own Google account
Gmail, Outlook, Drive, OneDrive and calendars for AI agents. Many accounts, one endpoint, audit log.
Hosted MCP server for Gmail, Outlook, iCloud, Fastmail & Yahoo Mail with per-workspace controls.
Related MCP Servers
- AlicenseAqualityDmaintenanceMCP server for Google Workspace APIs - Docs, Sheets, Drive, Gmail, and Calendar. Enables reading, creating, and editing Google Docs and Sheets, managing comments, reading emails, and viewing calendar events.3417MIT
- AlicenseAqualityAmaintenanceGives MCP clients access to Google Workspace (Gmail, Drive, Calendar, Sheets, Docs, etc.) across multiple Google accounts simultaneously.191,534 npm23MIT
- FlicenseNot gradedqualityDmaintenanceEnables multi-user access to Google Workspace services (Gmail, Calendar, Docs, Sheets, Slides, Drive) via remote MCP with OAuth 2.1 authentication.-
- AlicenseBqualityBmaintenanceEnables MCP clients and assistants to read Google Workspace services such as Calendar, Sheets, Docs, Contacts, and Tasks, with writes available only when explicitly enabled.2Functional Source , Version 1.1, ALv2 Future