Many accounts, one server
Connect personal, work and side-project inboxes once. Every tool takes an account parameter, so you pick the inbox per request.
Open source, MIT licensed
A multi-account Gmail MCP server lets Claude, Cursor, Windsurf or any MCP client work with several Gmail inboxes through one connection. This open-source server connects as many Gmail accounts as you add, searches them all in one call, and archives, labels, drafts, sends and unsubscribes.
Source on GitHub · MIT · README
Works with Claude · Cursor · Windsurf · Cline · Continue · any MCP client
list_emailsaccount: "all" · q: "is:unread newer_than:2d"Most Gmail connectors in AI tools handle a single account. This one holds as many as you connect.
Connect personal, work and side-project inboxes once. Every tool takes an account parameter, so you pick the inbox per request.
Pass "account": "all" to list_emails or batch_process and get one merged answer, with Gmail's full search syntax.
RFC 8058 one-click or mailto, sent from the account that got the newsletter. It reports success only when the sender accepted, and hands you the link otherwise.
| Feature | Claude's built-in Gmail | Multi-account Gmail MCP |
|---|---|---|
| Gmail accounts at once | One | As many as you connect |
| Search across accounts in one call | No | Yes |
| Unsubscribe (RFC 8058 and mailto) | No | Yes |
| Works in Cursor, Windsurf, Cline | No | Yes |
| Self-hosted and open source | No | Yes, MIT |
Read, search, organize, write and unsubscribe, on any connected account. Full tool reference in the README.
| Tool | What it does |
|---|---|
list_accounts | List every connected Gmail account |
list_emails | Search with Gmail query syntax, in one account or all of them |
get_email | Read the full message, headers and unsubscribe links |
archive_email | Remove a message from the inbox |
apply_label | Add a label, creating it if needed |
create_draft | Write a new draft or a reply. Nothing is sent |
send_email | Send a message, a reply, or an existing draft |
unsubscribe_email | One-click or mailto unsubscribe, or the link to click |
batch_process | Fetch a batch of messages for triage, across accounts |
You host it, so your tokens and mail stay with you. The README has the full guide for Vercel, Railway and Docker, including how to keep accounts across Docker restarts.
In Google Cloud Console, enable the Gmail API, set up the OAuth consent screen with the gmail.readonly and gmail.modify scopes, and create a Web application OAuth client.
Deploy to Vercel, Railway, Docker or your own host, and set GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET, ENCRYPTION_KEY, ADMIN_PASSWORD, MCP_SECRET and SERVER_URL.
Open /setup on your server, enter the admin password, choose Add Gmail Account, and repeat for each inbox.
Point Claude, Cursor, Windsurf, Cline or Continue at https://your-server/mcp/<MCP_SECRET>, then ask it to list your connected accounts.
git clone https://github.com/navbuildz/multi-account-gmail-mcp.git
cd multi-account-gmail-mcp
npm install && npm run build
npm start Docker, Railway and Vercel are covered in the README.
{
"mcpServers": {
"gmail": {
"url": "https://your-server/mcp/<MCP_SECRET>"
}
}
} Windsurf uses serverUrl. In Claude, add it under Settings, Connectors, Add custom connector.
The details live in the code. Read the security section or browse the source.
gmail.readonly and gmail.modify. Never full mail.google.com access, so nothing is permanently deleted.create_draft never sends. send_email does, so set it to require approval in your client if you want a confirmation step.Not covered here? The README FAQ has the same answers, and you can ask on GitHub.
Yes. Connect each account once on the /setup page, then add the server to Claude as a custom connector. Every tool takes an account parameter, and list_emails and batch_process accept "all" to search every inbox in one call.
The built-in connector works with one account. This server holds as many as you connect, searches across all of them at once, unsubscribes from newsletters, and works with Cursor, Windsurf, Cline and any other MCP client, not just Claude.
Yes, through Claude's custom connector. In Claude go to Settings, then Connectors, then Add custom connector, and paste your /mcp/<MCP_SECRET> URL. The server runs on your own host (Vercel, Railway, Docker or a VPS); a local mode that Claude Desktop launches directly is not built yet.
It is built and tested with personal Gmail accounts. Workspace support is on the to-do list.
It asks only for gmail.readonly and gmail.modify, never full mail.google.com access, so nothing is permanently deleted. Refresh tokens are encrypted with AES-256-GCM, and you can revoke access any time from your Google Account permissions.
Yes. It uses the RFC 8058 one-click request or sends the mailto request from the right account, and it only reports success when the sender accepted it. Anything that needs a human click comes back as a link for you to open.
Free, open source and MIT licensed.