gmail-accounts
Provides multi-account Gmail integration allowing agents to search, read threads, list drafts, create and update drafts, and send emails with human-approved single-use tokens.
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-accountssearch work for the invoice thread"
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 multi-account Gmail MCP server for AI agents (Claude Code and anything else that speaks MCP), with one design goal above all: the agent can read and draft freely, but a human must approve every send.
Built because the hosted Gmail connectors bind one account at a time and send
without friction. This server binds any number of Gmail accounts behind short
aliases (work, school, ...) and splits capabilities by risk:
Capability | Who can do it |
Search, read threads, list drafts | Agent, freely |
Create and update drafts | Agent, freely |
Send | Only with a single-use approval token a human mints in a terminal |
The server is registered as gmail-accounts (not gmail) on purpose: if you also
run a hosted Gmail connector, near-identical tool names make an agent read the
wrong mailbox and report a confident false negative.
How the send gate works
The agent stages a draft and asks you to approve it.
You run
gmail-approvein your own terminal, review the exact RFC822 payload, and get a one-time token bound to that draft's content hash.The agent calls the send tool with the token. Wrong draft, edited draft, reused token, expired token: all refused.
The send tool also carries anthropic/requiresUserInteraction, so Claude Code
prompts a human even in bypassPermissions mode. The token CLI is a mistake
interlock; the harness prompt is the enforced boundary.
Related MCP server: Gmail Multi-Inbox MCP Server
Setup
Requires Python 3.12+ and uv.
1. Google Cloud OAuth client
Create a project at console.cloud.google.com, enable the Gmail API, create an OAuth client ID of type Desktop app, and download the JSON to:
~/.config/gmail-mcp/client_secret.json2. Declare your accounts
~/.config/gmail-mcp/accounts.json:
{
"accounts": [
{ "alias": "personal", "email": "alice.personal@gmail.com" },
{ "alias": "work", "email": "alice.work@gmail.com" }
]
}Adding an account later is a config edit plus one auth run; the file is re-read on every call, so no restart is needed.
3. Authorize each account
uv sync
scripts/auth-all.sh # runs the OAuth flow once per alias, skips done onesEach grant is verified against its alias: authorizing the wrong Google account in the browser is detected and refused, not silently stored.
4. Register with Claude Code
claude mcp add gmail-accounts -- uv run --directory /path/to/gmail-mcp --frozen --no-sync gmail-mcpEveryday use
Every tool takes an account alias. Ask the agent things like "search work for
the invoice thread" or "draft a reply on personal". When it is time to send:
gmail-approve # lists pending sends, shows the payload, mints a tokenHealth check:
uv run gmail-mcp-healthSecurity notes
Secrets never enter the repo:
client_secret.jsonand per-account tokens live in~/.config/gmail-mcp/(override withGMAIL_MCP_CONFIG).All config writes are atomic (tmp + fsync + rename); a crash mid-write never leaves a torn file.
stdout is the JSON-RPC channel; nothing in the package may
print()(enforced by ruff T201), so diagnostics cannot corrupt the protocol.
Tests
uv run pytestMaintenance
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
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to read, search, organize, and draft emails in Gmail inboxes with support for multiple accounts, OAuth authentication, and 26 comprehensive tools for email management.2053MIT
- AlicenseBqualityBmaintenanceEnables AI assistants to manage multiple Gmail accounts simultaneously with built-in OAuth authentication, supporting email reading, sending, drafts, labels, and account management.60482MIT
- FlicenseAqualityBmaintenanceConnects AI assistants to multiple Gmail accounts simultaneously, enabling search, read, draft, send, and reply operations with per-account permission controls.54
- FlicenseNot gradedqualityDmaintenanceEnables AI-powered email management through Gmail, including search, send, drafts, labels, and an intelligent agent with human approval workflow and optional customer database integration.
Related MCP Connectors
Authenticated email gateway for AI agents — per-agent inboxes, HITL approval, SPF/DKIM verified.
Authenticated email gateway for AI agents — per-agent inboxes, HITL approval, SPF/DKIM verified.
Manage Gmail end-to-end: search, read, send, draft, label, and organize threads. Automate workflow…
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/sviatil0/gmail-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server