gmail-mcp
Provides tools for searching, reading, drafting, sending, and labeling emails across multiple Gmail accounts with send safety policies, as well as scheduled cross-inbox digest checks.
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., "@gmail-mcpCheck all my inboxes and tell me what needs my attention."
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-mcp
A local MCP server that gives Claude access to several Gmail accounts at once — search, read, draft, send, label, and a scheduled cross-inbox digest — without switching mailboxes.
Runs entirely on your machine. Nothing is hosted; mail goes only to Google.
The problem
Running several mailboxes — personal, sales, support, billing — means switching between them all day. AI assistants don't fix it: they connect to one account, or take broad access with no way to say this one may send, that one may not. Unrestricted send access to a client-facing address is why most people never connect one at all.
Related MCP server: Gmail MCP Server
Who it's for
Freelancers, agencies and small teams with several Gmail or Workspace mailboxes who want an assistant across all of them, and a hard guarantee about what it can send.
What it does
Ten tools, each taking an explicit account alias so the mailbox is never
ambiguous.
Tool | Purpose |
| Aliases, addresses, send policies |
| Gmail query syntax against one account |
| Full body; threads with quotes collapsed |
| Compose, gated by policy |
| Labels — also marks read and archives |
| New unread across every account, for scheduled use |
Send safety is the core design decision. Each mailbox declares send,
confirm, or draft_only in config, enforced in code rather than in a
prompt — so neither the model nor anything written into the mail it reads
can talk it out of it. check_inboxes reads untrusted email on a schedule,
which is exactly why that control can't live in an instruction.
Architecture
flowchart TD
H["Claude Desktop · Claude Code"] -->|stdio| S["server.py<br/>10 tools — validate, delegate, shape"]
S --> P{"send policy gate<br/>send · confirm · draft_only"}
P -->|blocked| D["draft"]
P -->|allowed| T["transmit"]
S --> G["gmail/<br/>search · messages · compose · labels"]
S --> C["check.py<br/>parallel watermarked sweep"]
G --> CL["client.py<br/>retry · error mapping · per-account cache"]
C --> CL
T --> CL
CL --> A["auth.py — OAuth refresh"]
A --> ST["storage.py<br/>OS keyring, or 0600 file"]
CL --> API[("Gmail API — gmail.modify")]Every Gmail call passes through one choke point owning retries and error
mapping, and each account gets its own service object — which is what makes
the parallel sweep safe. check_inboxes keeps a per-account watermark, so
a scheduled run reports only genuinely new mail.
Setup
Full guide: docs/SETUP.md.
1. Google Cloud — enable the Gmail API, configure an OAuth consent
screen (Internal for a Workspace domain, External for consumer Gmail), add
the single scope gmail.modify, create a Desktop app OAuth client, and
save the JSON as client_secret.json in your config directory.
2. Install
git clone <this repo> && cd gmail-mcp
uv sync
cp config.example.toml <config-dir>/config.toml # then edit it
uv run gmail-mcp auth add <alias> # once per account
uv run gmail-mcp doctor # verify every accountOS | Config directory |
Linux |
|
macOS |
|
Windows |
|
3a. Claude Code — any OS:
claude mcp add gmail --scope user -- \
/absolute/path/to/uv --directory /absolute/path/to/gmail-mcp run gmail-mcp serve3b. Claude Desktop — add to claude_desktop_config.json:
{
"mcpServers": {
"gmail": {
"command": "/absolute/path/to/uv",
"args": ["--directory", "/absolute/path/to/gmail-mcp",
"run", "gmail-mcp", "serve"]
}
}
}OS | Config file |
macOS |
|
Windows |
|
Linux |
|
Absolute paths in both: neither host inherits a shell PATH, and a bare
command name is the usual reason a server silently fails to start.
Demo
📹 Recording: add link here
Local server, so no hosted instance. Two moves:
"Check all my inboxes and tell me what needs my attention." Ask again — nothing new, because each account remembers where it got to.
"Send this from my personal account." It returns a draft and names the policy that stopped it.
Design notes
Least privilege. One scope,
gmail.modify— which cannot permanently delete mail. Chosen, not inherited.Credentials live in the OS keyring (Keychain, Credential Manager, Secret Service), falling back to a
0600file. Deliberately not encrypted: the server starts unattended, so any key would sit beside the ciphertext.Failure isolation. A revoked token fails one mailbox and names the fix; the others keep working.
Correct replies.
In-Reply-ToandReferencesare set, so replies thread in Outlook and Apple Mail — not only Gmail.Cross-platform via
platformdirsandkeyring.
Development
uv sync && uv run pytest193 tests, written test-first, running offline against a fake Gmail API — no network, credentials, or live mailbox needed. One opt-in integration test covers the real OAuth round trip.
License
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
- AlicenseBqualityFmaintenanceMCP server that connects Claude with Gmail to read, send, delete, and manage messages and labels via the Google Gmail API.Last updated3MIT
- Alicense-qualityDmaintenanceA 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
- AlicenseAqualityDmaintenanceA Gmail MCP server that enables Claude to send, search, and read emails using either Gmail API or SMTP/IMAP backend.Last updated3MIT
- Flicense-qualityCmaintenanceA local MCP server that connects multiple Gmail and Google Calendar accounts to Claude Desktop, enabling email and calendar management across accounts.Last updated3
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/Helmo21/Multi-Account-Gmail-MCP-Server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server