Google Workspace MCP server
Search, read and organise the mail, calendars, Drive files, Docs, Sheets,
Slides, Google Tasks, contacts and Meet transcripts of several Google accounts
at once, from your AI assistant. It writes drafts, labels, filters, events,
tasks, files, documents, comments and sharing. Nothing is money, and nothing
deletes mail or a file for good: Gmail and Drive keep the trash for 30 days.
Mail stays a draft until you say send. Sending, sharing a file and
publishing a revision are write tools that tell your assistant to wait for
your explicit go. The server does not ask you itself; your client can, before
each call. MCP_MAX_ACCESS=read makes the server read-only.
You need one or more Google accounts, a browser, and about ten minutes
for npx -y @foreverworks/mcp-google setup, which walks you through the rest:
an OAuth client of your own in a free Google Cloud project, made with a few
clicks Google lets no program make, and one approval per product and account
(what it does). Nothing to set by hand. The
Workspace directory, Meet transcripts and smart notes, and focus time and out
of office events need a Google Workspace account.
What you can ask
- "What's on my calendar this week across both accounts, and does anything
clash?"
- "Find 45 minutes with Ana Popescu next week, mornings first."
- "Save every PDF that came to my work mailbox as an attachment in September."
- "Draft a reply to Ana's last email saying Thursday at 10 works. I'll send it
myself."
- "Add these invoices to the Invoices sheet, and update any row whose invoice
number is already there."
- "What did we decide in yesterday's call with Client SRL? Read me the
transcript."
Install

With Claude Code:
claude mcp add google -- npx -y @foreverworks/mcp-google
Claude Desktop (Settings, Developer, Edit Config) and most other clients read the same command as JSON:
{
"mcpServers": {
"google": {
"command": "npx",
"args": ["-y", "@foreverworks/mcp-google"]
}
}
}
Each runs the published package on Node 22.19 or newer. VS Code and the Claude Desktop bundle ask for each setting as they add the server; leave an optional one empty. Cursor reads each from your environment instead (${env:CALENDAR_TIME_ZONE} and so on), so set them before you start Cursor. Every setting is optional; Configuration says which ones you need for which tools.
From a clone
git clone https://github.com/foreverworks/mcps.git && cd mcps
npm ci && npm run build
claude mcp add google -- node "$PWD/servers/google/dist/index.js"
In a JSON configuration, the command is node and its one argument the full path of servers/google/dist/index.js. To share one running copy between several clients over HTTP, see docs/deploying.md.
Then run setup once, in a terminal, before your first question:
npx -y @foreverworks/mcp-google setup
It asks which products and accounts to connect, opens each Google page you
need, picks up the file you download, and has you approve each product in
your browser. At the end it prints the command above, with GOOGLE_TOOLSETS
added if you chose only some products. Run it again to add an account or a
product; it keeps what is already done.
Over HTTP (MCP_HTTP_PORT), one process serves every session, with one token
cache per grant.
Configuration
Nothing needs setting. setup saves the OAuth client and every grant in the
server's state directory, ~/.local/state/mcps/google (on Windows
%APPDATA%\mcps\google), and the server finds them there. Each grant records
the address it was approved as, which is how the server knows which Google
account each label stands for. A label is lowercase letters, digits and
hyphens (personal, work, client-a), and stands for one Google identity
in every product.
The variables below are for a deployment that keeps these files elsewhere, or
lists its accounts itself. A variable that is set always wins over what
setup saved, and health says where each value came from.
| Variable |
Required |
Meaning |
GOOGLE_OAUTH_CLIENT_FILE |
no |
The OAuth client JSON from the Google Cloud console (a Desktop app client), on which new grants are made. Default: the one setup saved, oauth-client.json in the state directory. Without either, a consent borrows the client of a credentials file the account already has. |
GMAIL_ADDRESSES |
no |
label=address,...: the Google address each account label stands for, in every product. Default: the address each grant recorded. A consent approved as anyone else is refused, and health checks Gmail grants against it. |
GMAIL_MODIFY_ACCOUNTS |
no |
label=path,...: where each mailbox's own gmail.modify grant is kept, which begin_consent writes. Default: every gmail/<label>/credentials.json in the state directory is a mailbox. Set, it lists the mailboxes on its own. |
CALENDAR_TIME_ZONE |
no |
The IANA zone a time without an offset is read in, and working hours default to; default the process's zone (TZ). |
Everything the server writes (token caches, grants, waiting consents,
downloads) goes under GOOGLE_STATE_DIR: by default systemd's
STATE_DIRECTORY, else $XDG_STATE_HOME/mcps/google, unless a variable below
moves a product's part.
| Variable |
Meaning |
GMAIL_ACCOUNTS |
label=path,...: a read-only (gmail.readonly) grant per mailbox, made elsewhere, for instance by a mail-sync program. A mailbox whose gmail.modify grant file does not exist runs on this one: it reads, and every write refuses. |
GMAIL_DEFAULT_ACCOUNT |
The mailbox a one-mailbox read uses when none is named; default the first listed. |
GMAIL_STATE_DIR |
Gmail's token caches, <dir>/<label>/; default <GOOGLE_STATE_DIR>/gmail/state. |
GMAIL_ATTACHMENTS_DIR |
Where attachments are saved, <dir>/<label>/; default attachments/ in each mailbox's state folder. |
GMAIL_TIME_ZONE |
The zone a reply's "On <date> ... wrote:" line and a forward's Date line are written in, as Gmail writes them in its reader's zone; default CALENDAR_TIME_ZONE, else the process's zone. |
CALENDAR_ROOT |
Calendar grants, <root>/<label>/credentials.json (written by consent); default <GOOGLE_STATE_DIR>/calendar. |
CALENDAR_DEFAULT_ACCOUNT |
The account a one-account Calendar read uses; default the first by name. |
DRIVE_CREDENTIALS |
Drive's one grant (written by consent); default <GOOGLE_STATE_DIR>/drive/credentials.json. |
DRIVE_STATE_DIR |
Drive's token cache; default <GOOGLE_STATE_DIR>/drive/state. |
DRIVE_DOWNLOADS_DIR |
Where download_file and download_revision save; default <GOOGLE_STATE_DIR>/drive/downloads. |
DRIVE_MIRROR_ROOT |
A local copy of My Drive the server may read: upload_file also takes files from it, and sends each to the folder it mirrors. |
DRIVE_RCLONE_CONF |
An rclone config whose remote's grant Drive borrows until it has its own. The remote must carry its own client_id and client_secret, since rclone's built-in client cannot be refreshed from here. Unset: no rclone. |
DRIVE_RCLONE_REMOTE |
That remote's name; default gdrive. |
GOOGLE_EDITORS_ROOT |
Docs, Sheets and Slides grants, <root>/<label>/credentials.json; default <GOOGLE_STATE_DIR>/editors. |
GOOGLE_EDITORS_STATE_DIR |
Their token caches, <dir>/<label>/, for when the grants must stay read-only; default <root>/<label>/state. |
GOOGLE_EDITORS_DRIVE_ACCOUNT |
The label whose Docs, Sheets and Slides run on Drive's grant. Unset: none does. |
GOOGLE_EDITORS_DEFAULT_ACCOUNT |
The account a Docs, Sheets or Slides read uses when none is named; default the one on Drive's grant, else the first. |
TASKS_ROOT |
Google Tasks grants, <root>/<label>/credentials.json; default <GOOGLE_STATE_DIR>/tasks. |
CONTACTS_ROOT |
The same for contacts and the directory; default <GOOGLE_STATE_DIR>/contacts. |
MEET_ROOT |
The same for Meet's records; default <GOOGLE_STATE_DIR>/meet. |
GOOGLE_CONSENT_REDIRECT_URI |
The loopback address a consent redirects to; default http://localhost:8123/. |
GOOGLE_STATE_DIR |
The root of all of the above. |
GOOGLE_TOOLSETS |
The products whose tools the server loads, separated by commas; default every one (Toolsets). |
The variables every server shares (MCP_HTTP_PORT, MCP_MAX_ACCESS,
MCP_FILE_ROOTS, MCP_FILE_SCRIPT and the rest) are in
docs/configuration.md.
Toolsets
Every tool definition the server hands your client travels with each request
the client makes, so a client that only needs mail and calendars pays for
Drive, Docs, Sheets and the rest all the same. GOOGLE_TOOLSETS names the
products to load, separated by commas, the way GitHub's MCP server takes
GITHUB_TOOLSETS. The tools of a product not loaded are not there at all:
not in the tool list, not in the server's instructions, not in
list_accounts or health. Unset, empty or all, every product is loaded.