Multi-account Gmail on a Cloudflare Worker you deploy yourself: read, send, reply, labels, threads
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent โ or use 1-click editor setup below.
๐ก Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
Gmail for your AI assistant โ several accounts at once, on a server you own.
gmail-mcp connects Gmail to Claude and any other MCP client. It can search and read mail, send and reply-all with quoted history, forward, handle attachments and inline images, and manage drafts, labels, and threads โ across several Google accounts at the same time.
It runs as a remote server on your own Cloudflare Worker, so the same connection answers from Claude Code on a laptop, claude.ai in a browser, and Claude on a phone. Each connection signs in to one Google account, and the Google refresh token stays in your Cloudflare account.
Two things push people here. The Gmail connectors built into Claude and Google read mail and write drafts, but cannot send, and hold one Google account per assistant account. Servers that can send are usually local processes โ fine at a desk, invisible from a phone.
| gmail-mcp | Claude ยท Google built-in | taylorwilsdon/ google_workspace_mcp | ArtyMcLabin/ Gmail-MCP-Server | shinzo-labs/ gmail-mcp | aaronsb/ google-workspace-mcp | |
|---|---|---|---|---|---|---|
| Where it runs | Cloudflare Workers | vendor-hosted | your server or local | local | local | local |
| Reachable from a phone | โ | โ | โ | โ | โ | โ |
| Several mailboxes at once | โ bound per connection | โ | โ chosen per call | โ aliases only | โ | โ chosen per call |
| Send mail | โ | โ | โ | โ | โ | โ |
Attachments ยท inline cid: images | โ | undocumented | โ | โ | โ | โ |
| Reply-all with quoted history | โ | โ | drafts only | no quoting | โ | โ |
| Forward | โ | โ | โ | โ | โ | โ |
| Honors each part's charset | โ | โ | โ UTF-8 assumed | โ UTF-8 assumed | โ | โ |
| Rejects CRLF header injection | โ | โ | โ framework | โ strips | โ none | โ |
| Mailbox settings (filters, vacation) | โ out of scope | โ | filters | filters | โ | โ |
| Tool count | 24 | 11โ16 | 14 (Gmail) | 30 | 64 | 11 |
| Who holds your refresh token | you | vendor | you | you | you | you |
google_workspace_mcp is the most complete project here. It covers all of Workspace rather than Gmail alone, and it appends your Gmail signature and pulls attachments straight from a URL, neither of which gmail-mcp does. shinzo-labs/gmail-mcp reaches vacation responders, delegates, and S/MIME through its 64 tools; those live under gmail.settings.*, a scope gmail-mcp never requests, so they stay beyond its reach whatever happens to a grant.
Two design differences decide most of the rest. Routing accounts by a call argument lets one grant touch every connected mailbox, while binding the mailbox to the connection means a wrong argument reaches nothing. And on reading, the local servers decode every part as UTF-8: ISO-2022-JP and Shift_JIS mail arrives garbled, and long messages that Gmail stores as attachment blobs come back with an empty body.
About ten minutes. You need a Cloudflare account, bun, and a Google account. A domain on the Cloudflare account is optional โ without one the Worker answers on workers.dev.
Google exposes no API for the next two steps, so they happen in the Cloud console:
https://<your-host>/callback as an authorized redirect URI. Keep the client ID and secret.<your-host> is the domain you point at the Worker, or the workers.dev hostname it gets otherwise. Deploying first and coming back to fill this in works โ the guide the Worker serves at / shows the exact value.
The button copies the repository into your GitHub account, creates the KV namespace and the Durable Object, and asks for the four secrets. It deploys to workers.dev; a custom domain is attached afterwards under Settings โ Domains & Routes.
From a terminal instead:
bun run setup asks which domain to answer on, creates or reuses the OAUTH_KV namespace, takes the client ID and secret, generates a cookie key, and deploys. Those first two answers land in wrangler.local.jsonc, which git ignores โ wrangler.jsonc names no account's namespace and no one's domain, so a clone deploys anywhere. Re-running setup to rotate a single secret is safe.
Leave the client ID and secret fields empty โ MCP clients register themselves.
Run /mcp in Claude Code to sign each connection in to its Google account. In claude.ai it is Settings โ Connectors โ Add custom connector with the same URL. Any single-segment label works after /mcp/, which is how one deployment serves several mailboxes to clients that reject two servers sharing a URL.
Your deployment serves this guide at https://<your-host>/.
| ๐ Read | โ๏ธ Write | ๐ท Organize |
|---|---|---|
|
|
|
|
Messages leave the way a mail client sends them: plain text with an HTML alternative, file attachments, and inline images referenced by cid:, nested as multipart/mixed โบ multipart/related โบ multipart/alternative. Subjects and display names use RFC 2047, filenames use RFC 2231, so Japanese, Chinese, and emoji survive the trip.
reply_all reads the original's Reply-To, From, To, and Cc, drops your own address and any address you send mail as, answers from the one the sender wrote to, carries the References chain, and quotes the original in whichever parts you send. forward_message reproduces the forwarded envelope and can re-attach the original's files.
No reviews yet โ be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/gmail-mcp-2)<a href="https://allmcps.com/mcp/gmail-mcp-2"><img src="https://allmcps.com/api/badge/gmail-mcp-2?style=directory" alt="Gmail MCP on AllMCPs" /></a>