Multi-Gmail MCP Server
Allows searching and reading email threads and messages from multiple Gmail accounts simultaneously, with the ability to specify which account to query.
Click on "Deploy 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., "@Multi-Gmail MCP Serversearch my business Gmail for invoices from May"
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.
Multi-Gmail MCP Server
Connects more than one Gmail account to Claude at the same time. Claude's
built-in Google connector only holds one account — this runs locally instead
and exposes search_threads / get_thread / get_message, each taking an
account label so you (and Claude) can pick which mailbox to query.
Read this whole file before running anything — steps 1–4 happen on Google's site, not in this project.
1. Create a Google Cloud OAuth client (one-time, ~10 minutes)
You have to do this part yourself — it needs your own Google login.
Go to https://console.cloud.google.com/ and create a new project (top left project picker → New Project). Name doesn't matter, e.g. "Personal Gmail MCP".
Enable the Gmail API: left sidebar → APIs & Services → Library → search "Gmail API" → Enable.
Configure the OAuth consent screen: APIs & Services → OAuth consent screen.
User type: External
App name / support email: anything, e.g. "Personal Gmail MCP" / your email
Scopes: leave blank here, the app requests the scope itself
Test users: add every Gmail address you plan to connect (both the personal and the business one). While the app is in "Testing" status, only addresses on this list can sign in — this is expected and fine, you don't need to publish or verify the app.
Create the OAuth client: APIs & Services → Credentials → Create Credentials → OAuth client ID.
Application type: Desktop app
Name: anything
Click Create, then Download JSON
Rename the downloaded file
credentials.jsonand put it directly in this folder (gmail-mcp-server/credentials.json). This file is git-ignored — never commit it or share it.
Tokens expire after 7 days in "Testing" mode — this is normal
While the OAuth app's publishing status is Testing, Google expires the
refresh token for every connected account after 7 days. When it happens all
your accounts usually fail at once, with invalid_grant, because they were
authorised on the same day.
The fix is step 2 again for that account — 30 seconds, no Google Cloud changes.
The server re-reads tokens/ whenever the files change, so a re-auth takes
effect on the next tool call; you do not need to restart Claude.
If the weekly re-auth annoys you, set the OAuth consent screen to In
production and refresh tokens stop expiring. Because gmail.readonly is a
restricted scope Google may ask for verification; for a desktop app used only
by your own accounts, many people publish and accept the "unverified app"
warning at sign-in.
Related MCP server: gmail-mcp-server
2. Connect each Gmail account
From this folder:
npm run auth -- personalThis opens your browser, has you sign in and grant read access, then
saves a token under tokens/personal.json. personal is just a label
you choose — pick whatever's memorable.
Repeat for the second account:
npm run auth -- businessRun npm run auth -- <label> again any time to add another account or
reconnect one whose access was revoked.
Only gmail.readonly scope is requested — this server can search and
read mail, not send, delete, or modify anything.
3. Register the server with Claude Code
Option A — CLI:
claude mcp add multi-gmail -- node "/absolute/path/to/multi-gmail-mcp/server.js"Option B — manual config: add this to your .mcp.json (project-level) or
Claude Code's user-level MCP settings:
{
"mcpServers": {
"multi-gmail": {
"command": "node",
"args": ["/absolute/path/to/multi-gmail-mcp/server.js"]
}
}
}Restart Claude Code (or start a new session) after adding it. Tools then
appear as list_accounts, search_threads, get_thread, get_message —
ask Claude to use them same as any other tool, e.g. "search the business
Gmail for invoices from May" — Claude will call search_threads with
account: "business".
What this does and doesn't do
Reads mail from every account you've run
npm run authfor, in the same conversation, without needing to disconnect/reconnect anything.Read-only — cannot send, label, delete, or modify email.
Cannot read attachment content (same limitation as Claude's built-in Gmail connector) — only filename/type/size.
Runs entirely on this machine. Tokens live in
tokens/*.json, never leave your computer except to talk to Google's API directly.This is unreviewed code written for you, not an audited product — reasonable for your own accounts, not something to hand to anyone else or point at a shared/company mailbox without a closer look first.
Credits
Created by Mohit Garg.
Built because Claude's built-in Google connector holds one account at a time, and some of us have four.
License
MIT — see LICENSE.
This server cannot be deployed
Maintenance
Related MCP Connectors
Multiple Google accounts (Gmail, Calendar, Drive, Contacts, Tasks) in one Claude connector.
Multiple Google accounts (Gmail, Calendar, Drive, Contacts, Tasks) in one Claude connector.
Your mailboxes in ChatGPT and Claude: Gmail, iCloud, Fastmail, any IMAP. Passwords stay yours.
Connect any mailbox to Claude, ChatGPT & AI: read, send, reply, schedule & search emails.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables seamless email management through natural language conversations with Claude. Supports searching, reading, and sending emails securely with Gmail and other email providers.4MIT
- AlicenseNot gradedqualityDmaintenanceEnables reading, sending, searching, and managing Gmail through Claude using the official Google Gmail API.93 npm3MIT
- AlicenseNot gradedqualityCmaintenanceEnables Claude to read, search, send, label, and trash emails in any Gmail account via Google's Gmail API, using OAuth2 authentication with automatic token refresh.67 npmMIT
- AlicenseNot gradedqualityCmaintenanceEnables searching and summarizing emails across multiple Gmail accounts simultaneously through Claude.1MIT