gmail-multi-mcp
Manage multiple Gmail accounts with tools for searching, reading, composing, sending, labeling, archiving, and trashing emails.
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-multi-mcpsearch personal inbox for unread emails"
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-mcp
Connect multiple Gmail accounts to Claude (or any MCP client) from one local server. The official Gmail connector only supports a single Google account β this lets you search, read, draft, send, label, and organize mail across as many accounts as you like, each addressed by a friendly alias.
Your OAuth tokens are stored locally on your machine only β never uploaded anywhere.
Features
π’ Unlimited accounts β every tool takes an
accountparameter ("personal","work", β¦)π Search & read β full Gmail search syntax, thread/message reading, attachment download
βοΈ Compose β create/list/delete drafts, send mail, replies with correct threading headers
π·οΈ Organize β full label management, archive, trash
π Local-first β standard Google OAuth; tokens live in
~/.gmail-mcp/, chmod 600π§© 22 tools, works with Claude Code, Claude Desktop, Cursor, and any MCP client
Related MCP server: Gmail MCP Server
Prerequisites
Node.js β₯ 20
A Google account (and a free Google Cloud project β setup below)
1. Install
git clone https://github.com/Vinksj/claude-gmail-multi.git
cd claude-gmail-multi
npm install
npm run build2. Create your Google OAuth app (one-time, ~10 min)
You register one OAuth "app" with Google; it then works for all the accounts you connect.
Go to console.cloud.google.com β create a project (e.g.
gmail-mcp).APIs & Services β Library β search Gmail API β Enable.
APIs & Services β OAuth consent screen:
User type External β Create.
App name + your support email + your contact email β Save and Continue.
Scopes page β Save and Continue. Test users page β Save and Continue.
Publish to production: on the OAuth consent screen, set Publishing status β Publish app. (In "Testing" mode Google expires your refresh token every 7 days. Publishing avoids that. You'll click through a one-time "Google hasn't verified this app" warning per account β that's normal for a personal app: choose Advanced β Continue.)
APIs & Services β Credentials β Create Credentials β OAuth client ID:
Application type Desktop app β Create β Download JSON.
Save that file as
~/.gmail-mcp/credentials.json:mkdir -p ~/.gmail-mcp && chmod 700 ~/.gmail-mcp mv ~/Downloads/client_secret_*.json ~/.gmail-mcp/credentials.json chmod 600 ~/.gmail-mcp/credentials.json
Note: newer Google Cloud UIs put these under "Google Auth Platform" (Branding / Audience / Clients) instead of "OAuth consent screen" β same steps, different labels.
3. Connect your accounts
npm run auth -- --alias personal --email you@gmail.com
npm run auth -- --alias work --email you@company.comEach opens a browser β pick the matching Google account β approve. The optional --email flag
aborts if the wrong account gets authorized (an easy mistake with multi-login browsers). Connect
as many as you want; re-run any time a token is revoked.
4. Register with your MCP client
Claude Code:
claude mcp add --scope user gmail-multi -- node "$(pwd)/dist/index.js"Claude Desktop / other clients β add to your MCP config:
{
"mcpServers": {
"gmail-multi": {
"command": "node",
"args": ["/absolute/path/to/gmail-multi-mcp/dist/index.js"]
}
}
}Tools appear as gmail-multi's search_threads, create_draft, etc. Ask things like
"search my work inbox for unread from this week" or "draft a reply in personal to Alice."
Tools
Group | Tools |
Accounts |
|
Read |
|
Compose |
|
Labels |
|
Cleanup |
|
Every tool except list_accounts takes an account parameter (alias or email). Replies via
replyToMessageId get correct In-Reply-To/References headers and threading automatically.
How it works
One self-owned Google Cloud OAuth app (Desktop client) authorizes any number of accounts.
Single scope:
https://www.googleapis.com/auth/gmail.modify(read, search, drafts, send, labels, archive, trash β narrower than fullhttps://mail.google.com/).Per-account refresh tokens stored in
~/.gmail-mcp/tokens/<alias>.json(chmod 600); the account registry is~/.gmail-mcp/config.json. Nothing leaves your machine.
~/.gmail-mcp/
βββ credentials.json # your OAuth client (you add this)
βββ config.json # alias β email map (auto-managed)
βββ tokens/<alias>.json # per-account refresh tokens (auto-managed)Security notes
Tokens are stored as plain files readable only by your user (chmod 600). On a single-user machine with full-disk encryption this is reasonable; moving token storage to the OS keychain is a sensible future hardening step.
Never commit
~/.gmail-mcp/β it lives in your home directory, outside this repo, and the repo's.gitignoreexcludes build artifacts and dependencies regardless.The
gmail.modifyscope cannot permanently delete mail βtrash_*tools move items to Trash (recoverable for 30 days).
Development
npm run build # tsc -> dist/
npm run inspect # MCP Inspector UI against the built server
npm run auth -- --alias <name> [--email <expected>]Important: stdout is the JSON-RPC channel β never console.log in server code; use console.error.
License
MIT Β© Saurabh Jain
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-qualityCmaintenanceEnables interaction with Gmail through MCP-compatible clients to list, read, search, and send emails. It supports advanced features such as managing labels, handling threaded replies, and utilizing Gmail's native search syntax.Last updated602MIT
- Alicense-qualityFmaintenanceEnables interaction with Gmail through the MCP protocol, supporting sending, reading, searching, replying, forwarding, managing drafts and labels, and saving attachments.Last updated303MIT
- Flicense-qualityCmaintenanceEnables interacting with multiple Gmail accounts through a single MCP server, supporting search, labels, drafts, and thread management with per-account OAuth.Last updated
- Flicense-qualityCmaintenanceMulti-user Gmail MCP server that enables sending/receiving emails, managing accounts, and searching mail via SMTP/IMAP with per-user isolation and encrypted app passwords.Last updated
Related MCP Connectors
Read, search, send, organize, draft and schedule email across your inboxes from any MCP client.
Manage Gmail end-to-end: search, read, send, draft, label, and organize threads. Automate workflowβ¦
Manage Gmail messages, threads, labels, drafts, and settings from your workflows. Send and organizβ¦
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/Vinksj/claude-gmail-multi'
If you have feedback or need assistance with the MCP directory API, please join our Discord server