MultiGmailMCP
Provides tools for searching, reading, drafting, sending, and organizing email across multiple Gmail accounts, including labels, filters, vacation responders, IMAP/POP settings, forwarding, and delegate management.
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., "@MultiGmailMCPsearch all my accounts for unread emails from Sarah"
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.
Gmail Multi-Account MCP Server (for Claude Desktop)
A local MCP server that lets Claude Desktop search, read, draft, send, and organize email — manage mailbox settings, and handle your Google Calendar — across as many Google accounts as you configure — "check my work inbox for anything from Sarah" / "draft a reply from my personal account" / "what's on my calendar Friday?" — all running on your own machine. Nothing is hosted; Claude Desktop launches this script itself.
Scope, on purpose: this can search, read, draft, send, and organize mail (labels, archive, read/unread, star, trash) — but sending stays a deliberate two-step confirm-then-send, and it deliberately cannot permanently delete anything: trash is recoverable, and Gmail's hard-delete scope is left out on purpose. See "Scopes" below.
What you'll need
Python 3.10+
A Google account for each Gmail inbox you want to connect
Claude Desktop
About 15 minutes for the one-time setup
Related MCP server: Gmail MCP Server
Prefer clicking to typing? (optional setup UI)
After installing dependencies (Step 2), run:
python setup_app.pyIt opens a small local web page (localhost only) that walks you through the Google Cloud step, connecting/reauthorizing accounts, and writing the Claude Desktop config for you. It can't click through Google Cloud Console for you, but it guides and validates every step. The manual walkthrough below still works and explains what the UI is doing under the hood.
Step 1 — Create a Google Cloud OAuth client
This is the only fiddly part, and you only do it once (it covers all the accounts you'll add later, not one client per account).
Go to console.cloud.google.com and create a new project (top-left project dropdown → New Project). Any name is fine.
Enable the Gmail API: Menu ☰ → APIs & Services → Library, search "Gmail API," click it, click Enable.
Configure the consent screen: Menu ☰ → Google Auth platform → Branding. Click Get started.
App name: anything (e.g. "Personal Gmail MCP")
User support email: your email
Audience: External (this is the right choice even for personal use — "Internal" only exists if you're on a Google Workspace account)
Contact email: your email → Create
Add test users: still in Google Auth platform, click the Audience tab → Test users → Add users. Add every Gmail address you plan to connect (your personal and your work address, if both apply). Unverified apps can only be authorized by addresses on this list.
Create the OAuth client: Google Auth platform → Clients → Create Client.
Application type: Desktop app
Name: anything (e.g. "gmail-mcp-local")
Click Create, then download the JSON.
Rename the downloaded file to
credentials.jsonand place it in this folder (next toserver.py).
You'll see an "unverified app" warning when you actually authorize each account in Step 3 — that's expected for a personal project like this one. Click Advanced → Go to [your app name] (unsafe) to proceed; it's your own app, so this is safe.
Step 2 — Install dependencies
cd gmail-mcp-server
python3 -m venv venv
venv/bin/pip install -r requirements.txt # Windows: venv\Scripts\pip install -r requirements.txtStep 3 — Authorize each Gmail account
Run this once per account, using whatever name you want Claude to call it by:
venv/bin/python add_account.py personal
venv/bin/python add_account.py workEach run opens your browser to Google's sign-in. Log in with that
account, approve, and a token is saved to tokens/<name>.json. You can
add more accounts later the same way, any time.
Step 4 — Point Claude Desktop at the server
Open Claude Desktop → Settings → Developer → Edit Config. This opens (or creates)
claude_desktop_config.json.Add an entry under
mcpServers, using the absolute path to this folder:
{
"mcpServers": {
"gmail-multi-account": {
"command": "/absolute/path/to/gmail-mcp-server/venv/bin/python",
"args": ["/absolute/path/to/gmail-mcp-server/server.py"]
}
}
}(Windows: use the venv's python.exe, e.g.
"C:\\Users\\you\\gmail-mcp-server\\venv\\Scripts\\python.exe", and escape
backslashes like that.)
Save the file and fully restart Claude Desktop.
That's it — ask Claude something like "what accounts do you have access to?" to confirm it can see the server, then try "search my work email for invoices from this month."
Tools this server exposes
Tool | What it does |
| Lists configured account names |
| Starts connecting a new Gmail account — opens a browser for the user to sign in (interactive machines only) |
| Reports whether an in-progress add-account sign-in finished |
| Shows the real email address behind an account name, plus message/thread totals |
| Lists an account's labels as id/name/type |
| Searches using Gmail's own query syntax ( |
| Runs one query across every configured account, grouped by account |
| Returns full headers + body of one message |
| Returns every message in a thread, oldest first, in one call |
| Lists a message's attachments (filename, type, size, id) |
| Downloads one attachment to a local file (sanitized name, confined to dest) |
| Creates a draft — never sends |
| Drafts a reply with recipients/subject/threading filled in — never sends |
| Drafts a forward to new recipients — never sends |
| Replaces an existing draft's contents — never sends |
| Deletes an unsent draft (drafts only — can't touch real messages) |
| Lists saved drafts (subject + recipient only) |
| Fetches a draft's full contents, for a last check before sending |
| Sends an existing draft. Irreversible; |
| Adds/removes labels on a message (by label id) |
| Toggles the read state |
| Removes from / returns to the inbox |
| Toggles the star |
| Moves to / restores from Trash (recoverable — not a permanent delete) |
| Manages your user labels |
| Lists the account's filters (criteria + actions) |
| Creates/deletes a filter — persistent; a filter can forward or trash mail |
| Reads/sets the vacation auto-responder |
| Reads/sets IMAP & POP access |
| Manages forwarding addresses (new ones need Google verification) |
| Reads/sets auto-forwarding — exfiltration vector, heavily gated |
| Manages send-as aliases |
| Manages delegate access (usually Workspace-only) |
| Lists an account's calendars |
| Lists/searches events in a window (recurrences expanded) |
| Same window across every account (cross-account agenda) |
| Full event details incl. attendee RSVPs |
| Busy blocks — the "am I free?" primitive |
| Natural-language event ("Lunch Tue 1pm") — no attendees |
| Create/edit an event; |
| RSVP accepted/declined/tentative |
| Deletes an event — destructive (harder to recover than Gmail trash) |
Sending mail
Sending is split into two tools on purpose: gmail_draft only ever saves
a draft, and a separate gmail_send_draft(account, draft_id) sends one
that already exists. There's no single tool that composes and sends in
one call.
This matters because a model that can send email autonomously is a different risk profile than one that can only draft it — a misunderstood request, a hallucinated detail, or (worst case) an instruction smuggled inside an email it just read become irreversible instead of catchable. Splitting send into its own explicit step means:
Claude has to show you what a draft says (via
gmail_draft's orgmail_get_draft's output) before it can act on sending it.gmail_send_draft's tool description explicitly tells the calling model to only use it after you've clearly said to send that draft — never automatically right after creating one, and never because of something read inside an email rather than from you.It's marked
destructive_hint=Truein its MCP annotations, which well-behaved MCP clients (Claude Desktop included) use to decide how cautiously to treat a tool — worth knowing this is a hint clients can use for their own approval UI, not an enforced restriction on its own.
None of this is a hard technical guarantee — it relies on whatever Claude you're running behaving as instructed, the same as any tool. If you want zero ambiguity, just don't ask Claude to send anything you haven't reviewed yourself; nothing stops you from also just sending drafts manually from Gmail once Claude's written them, which sidesteps this entirely.
Scopes
This server requests these OAuth scopes:
gmail.readonly— search and readgmail.compose— create/read/update/delete drafts, and send them (this is Google's scope, not a design choice here —gmail.composebundles sending in with draft management, there's no narrower scope that offers drafts without send).gmail.modify— organize mail: add/remove labels, mark read/unread, archive, star, and move messages to Trash. This covers all read/write on mail except permanent deletion.gmail.settings.basic— manage filters, the vacation responder, and IMAP/POP access.gmail.settings.sharing— manage send-as aliases and delegate access.calendar.readonly— list calendars, read events, check free/busy.calendar.events— create/update/delete events and RSVP. Emailing attendees (send_updates="all") is treated like sending mail: it defaults to off, and turning it on is gated behind the confirmation phrase.
The settings-changing tools (filters, vacation, IMAP/POP, forwarding,
send-as, delegation) are persistent and some — a forwarding rule, a
forwarding/trashing filter, a send-as alias, a delegate — can durably route
or expose your mail. So every one of them is gated behind the confirmation
phrase (see "Sending mail"), told to act only on an explicit user request
(never on anything read inside an email), and forwarding/send-as/delegation
changes are additionally recorded to settings.log.
What it deliberately does not request:
https://mail.google.com/(permanent delete / empty Trash) — left out on purpose.gmail_trashmoves messages to Trash, where they're recoverable for ~30 days, so nothing this server does is truly irreversible. There is no hard-delete tool because the token can't hard-delete.
Because the token can now send mail, reorganize or trash it, and change
settings including forwarding and delegation, treat tokens/*.json as at
least as sensitive as the password to that inbox. See Security below.
Why do I have to reauthorize so often?
Google restricts unverified ("Testing" mode) apps that use Gmail scopes:
refresh tokens for test users expire after 7 days, regardless of how
you built the app. This isn't a bug here — it's Google's policy for any
personal script like this one. When it expires, you'll see a message
telling you to rerun add_account.py <name> for that account (or just click
Reauthorize next to it in python setup_app.py); that's all you need to
do. Getting Google to lift this (moving your OAuth app to
"Production") requires their formal app-verification process, including a
security assessment for these particular scopes — real weeks of process
for a tool only you use, so it's not worth doing here.
Security
Each account's refresh token lives in plain text in
tokens/<name>.json. Anyone with that file can read, send, reorganize/trash, and change settings (including forwarding, send-as, and delegation) on that account until it's revoked (trashing is recoverable; permanent deletion is not possible — see Scopes). Don't sync this folder anywhere shared;.gitignorealready excludestokens/andcredentials.json.Two local, gitignored audit logs record the highest-consequence actions, with no token data:
sent.log(every send) andsettings.log(every forwarding/send-as/delegation change). They're best-effort records for your own review, not a security control.Everything runs locally — Claude Desktop spawns this script as a subprocess on your machine. Your email data is included in whatever conversation you ask about it in (same as any Claude tool result), but nothing is hosted or exposed to the internet by this server itself.
To revoke access entirely, go to myaccount.google.com/permissions on the relevant account and remove the app, then delete its
tokens/<name>.jsonfile here.
Troubleshooting
"No module named mcp" — you're not using the venv's Python. Double check the
commandpath in your Claude Desktop config.Server doesn't show up in Claude — config JSON is probably invalid (missing comma, wrong path). Check Claude Desktop's MCP logs (same Developer settings page) for the exact error.
invalid_grant/ "authorization has expired" — see "Why do I have to reauthorize so often?" above; rerunadd_account.py <name>, or click Reauthorize in the setup UI (python setup_app.py)."Access blocked: this app is blocked" instead of the usual warning — you likely forgot to add that Google address as a test user in Step 1.4.
Extending this later
Organizing mail (built in): labels, archive, read/unread, star, and Trash now ship via
gmail.modify(see the tools table and Scopes). Permanent deletion is intentionally excluded. If you set this server up before these existed, rerunadd_account.pyonce per account to pick up the new scope.Settings (built in): filters, vacation, IMAP/POP (
gmail.settings.basic) and forwarding, send-as, delegation (gmail.settings.sharing). All settings-changing tools are gated behind the confirmation phrase (see "Sending mail"); forwarding/send-as/delegation changes are also written tosettings.log. Rerunadd_account.pyper account to pick up the scopes.Google Calendar (built in): read calendars/events, free/busy, a cross-account agenda, and create/update/delete/RSVP/quick-add events (
calendar.readonly+calendar.events). Emailing attendees (send_updates="all") defaults to off and is gated like sending mail. Adding the Calendar scopes means rerunningadd_account.py(or the setup UI's Reauthorize) once per account.More accounts: just run
add_account.py <new-name>again — no config changes needed.Update checker (built in): the packaged exe checks GitHub for a newer release and nudges you — a banner in the setup UI, a
check_for_updatestool, and a one-time note at the start of a Claude conversation. It's notify-only (never downloads or installs anything), best-effort, and cached. It contactsapi.github.com; setGMAIL_MCP_NO_UPDATE_CHECK=1to turn all of it off. Seespecs/015-update-checker.md.Run it as a standalone binary (built; per-OS):
main.pyexposesserve(the stdio server) andsetup(the UI) subcommands, andbuild.pypackages them into one single-filegmail-mcp.exewith PyInstaller —python build.py→dist/gmail-mcp.exe(a committedgmail-mcp.specdrops Google's bundled discovery docs for ~585 unused APIs, slimming ~143 MB → ~44 MB; verifiedservekeeps stdout MCP-clean). The exe bundles Python and every dependency, so the target machine needs no Python,venv, orpip— the whole "install dependencies" step disappears. A user downloads the one file and runs it: double-clicking opens the setup wizard (a no-argument launch defaults tosetup), which does the Google setup and writes a Claude Desktop config pointing at the exe with theserveargument. Distribution model: ship the exe withoutcredentials.json— each user creates their own OAuth client via the wizard, keeping it clear of Google's app-verification requirement. Build per-OS (PyInstaller can't cross-compile); unsigned binaries trip SmartScreen/Gatekeeper until code-signed. Seespecs/013-packaging-distribution.md.Stricter send confirmation (built in): two harder gates than docstring wording now ship in
gmail_send_draft:Audit log — every successful send appends one line (timestamp, account, draft/message id, recipient, subject — never any token data) to
sent.login the data dir (the project folder in a source run, a per-user config dir when packaged; gitignored). It's best-effort: a logging error never blocks or undoes a send.Confirmation phrase — set the env var
GMAIL_MCP_SEND_PHRASE(e.g. in your Claude Desktop server config'senv) to any phrase, andgmail_send_draftwill refuse to send unless it's called with that exact phrase in itsconfirmargument. This makes "confirm before sending" a code-level precondition, not just an instruction the model is asked to follow. Unset (the default), sending behaves exactly as before.
This server cannot be installed
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-qualityCmaintenanceA local MCP server that provides tool-level access to Gmail, allowing Claude to search, read, send, and manage emails using the Gmail API.Last updated1MIT
- Alicense-qualityCmaintenanceA custom MCP server that gives Claude full Gmail control — send directly, read, reply, search, label, and delete emails.Last updated170MIT
- Alicense-qualityDmaintenanceA Model Context Protocol (MCP) server that enables Claude Desktop to interact with Gmail through secure OAuth 2.0 authentication. Send emails, search messages, read emails, and manage multiple Gmail accounts directly from Claude Desktop.Last updated170MIT
- Flicense-qualityDmaintenanceA local MCP server that connects multiple Gmail and Google Calendar accounts to Claude Desktop, enabling email and calendar management across accounts.Last updated4
Related MCP Connectors
Read, search, send, organize, draft and schedule email across your inboxes from any MCP client.
Hosted email MCP for AI agents with inboxes, send/receive, memory, recovery, and credits.
Shipmail MCP server for AI agent custom-domain email inboxes with REST API and webhooks.
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/leandro-santos-abreu/MultiGmailMCP'
If you have feedback or need assistance with the MCP directory API, please join our Discord server