gmail-multi-mcp
Provides multi-account Gmail integration with tools to search and read emails and threads, download attachments, create drafts, send emails when permitted, modify labels, trash emails, and manage labels across connected Gmail accounts.
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., "@gmail-multi-mcpsearch all my accounts for unread emails from Stripe"
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
Seamless multi-account Gmail integration for AI assistants via the Model Context Protocol (MCP). Manage 2 to 20+ Gmail accounts concurrently in a single process without context explosion.
Why gmail-multi-mcp?
Traditional Gmail MCP servers spawn one background process per account, duplicating 15β20 tool definitions in your LLM's system prompt for every inbox. With 5 accounts, that's nearly 100 tools cluttering the context window.
gmail-multi-mcp provides a unified multi-account architecture:
π Single Process for N Accounts: Runs 1 lightweight process whether you have 2 or 10 accounts. Only 10 tools are registered in your prompt.
π Parallel Cross-Account Search: Search across all your inboxes at once using
account="all"(queries all inboxes concurrently withPromise.allSettled).π‘οΈ Per-Account Permission Tiers: Set sensitive work inboxes to
draft(compose only) orreadonlywhile keeping personal inboxes onfull(send allowed).π Hot-Reloading: Add new accounts via CLI while your AI assistant is runningβnew accounts are detected immediately without restarting your client.
π Full Attachment Support: Download attachments to local folders and attach local files to outgoing emails or drafts.
π Zero Third-Party Relays: Direct communication between your local machine and Google APIs using official SDKs. Tokens are stored locally with strict
0600permissions.
Related MCP server: Gmail MCP Server
Quick Start
1. Prerequisites & Google Cloud OAuth Setup
To access the Gmail API, you need a Google Cloud OAuth Desktop Client:
Go to the Google Cloud Console and create a project (e.g.
gmail-mcp).Navigate to APIs & Services > Library and enable the Gmail API.
Go to APIs & Services > OAuth consent screen:
Choose External (or Internal if using a Google Workspace organization).
Fill in the required app information and add your email addresses as Test users.
Go to APIs & Services > Credentials > Create Credentials > OAuth client ID:
Application type: Desktop app.
Download the generated JSON credentials file.
Save the file to the default configuration directory:
mkdir -p ~/.gmail-multi-mcp chmod 700 ~/.gmail-multi-mcp mv ~/Downloads/client_secret_*.json ~/.gmail-multi-mcp/gcp_client_secret.json chmod 600 ~/.gmail-multi-mcp/gcp_client_secret.json
2. Connect Your Accounts
Use the CLI to connect your accounts. Each command opens a browser tab for one-time Google Sign-in:
# Connect primary personal account (default: full permissions)
npx gmail-multi-mcp auth add personal
# Connect work account with draft-only safety (cannot send or trash emails)
npx gmail-multi-mcp auth add work --permission draft
# Connect an account using a custom corporate OAuth client JSON
npx gmail-multi-mcp auth add corp --oauth-keys ~/Downloads/corp-oauth.json
# View all connected accounts
npx gmail-multi-mcp auth list3. Add to Your MCP Client Configuration
Antigravity (~/.gemini/config/mcp_config.json)
{
"mcpServers": {
"gmail-multi": {
"command": "npx",
"args": ["-y", "gmail-multi-mcp"]
}
}
}Claude Desktop (claude_desktop_config.json)
{
"mcpServers": {
"gmail-multi": {
"command": "npx",
"args": ["-y", "gmail-multi-mcp"]
}
}
}Cursor (Settings > Features > MCP)
Name:
gmail-multiType:
commandCommand:
npx -y gmail-multi-mcp
Permission Tiers
Configure permissions per account when adding it or change it anytime:
npx gmail-multi-mcp auth set-permission work draftPermission | Search & Read | Download Attachments | Create Drafts | Modify Labels | Send Emails | Trash Emails |
| β | β | β | β | β | β |
| β | β | β | β | β | β |
| β | β | β | β | β | β |
Available Tools
Tool | Parameters | Description |
| (none) | Lists all connected accounts, aliases, real emails, and permission tiers. |
|
| Searches emails with Gmail syntax ( |
|
| Reads email details (headers, text, HTML, attachment list). |
|
| Reads an entire email thread in chronological order. |
|
| Downloads an email attachment to a local folder. |
|
| Creates a draft email with optional local file attachments. |
|
| Directly sends an email or replies to a thread (blocked if account is not |
|
| Adds or removes labels (e.g. mark read, archive). Accepts label names or IDs. |
|
| Moves an email to Gmail Trash (recoverable for 30 days). |
|
| Lists all labels in an account. |
|
| Creates a new user label in an account. |
CLI Reference
# Add a new account
gmail-multi-mcp auth add <alias> [--permission <readonly|draft|full>] [--oauth-keys <path>]
# List all connected accounts
gmail-multi-mcp auth list
# Update account permissions dynamically without re-login
gmail-multi-mcp auth set-permission <alias> <readonly|draft|full>
# Remove an account and delete its local token
gmail-multi-mcp auth remove <alias>Directory Structure & Security
All local tokens and configuration files are stored outside project directories:
~/.gmail-multi-mcp/
βββ gcp_client_secret.json # Default OAuth client secret (chmod 0600)
βββ accounts.json # Account registry and metadata (chmod 0600)
βββ tokens/ # Encrypted OAuth refresh tokens per account (chmod 0600)
βββ personal.json
βββ work.jsonFile Permissions: Created with
0700(directory) and0600(files), ensuring only your local OS user can read them.Custom Location: Set
GMAIL_MULTI_MCP_DIR=/path/to/custom/dirto override the default storage directory.
Development
# Clone the repository
git clone https://github.com/your-username/gmail-multi-mcp.git
cd gmail-multi-mcp
# Install dependencies
npm install
# Build TypeScript
npm run build
# Test CLI
node dist/index.js auth listLicense
MIT Β© 2026
This server cannot be deployed
Maintenance
Related MCP Connectors
Multiple Gmail accounts, editable Google Sheets & Docs for AI agents. Deny-by-default access rules.
- MailowsOAuthcom.mailows
Give AI agents their own email inboxes: list, read and send mail via scoped, revocable OAuth grants.
Gmail, Outlook, Drive, OneDrive and calendars for AI agents. Many accounts, one endpoint, audit log.
- PrubexOAuthcom.prubex
Every email and calendar account you connect, for AI agents, with permissions and approvals.
Related MCP Servers
- AlicenseBqualityBmaintenanceEnables AI assistants to manage multiple Gmail accounts simultaneously with built-in OAuth authentication, supporting email reading, sending, drafts, labels, and account management.6026 npm4MIT
- AlicenseNot gradedqualityDmaintenanceMulti-account Gmail integration for AI agents, enabling read, write, archive, label, and auto-unsubscribe operations through the Model Context Protocol.226 npm16MIT
- AlicenseAqualityBmaintenanceConnects AI assistants to multiple Gmail accounts simultaneously, enabling search, read, draft, send, and reply operations with per-account permission controls.54ISC
- AlicenseNot gradedqualityBmaintenanceEnables AI assistants to send, read, search, and manage Gmail emails, drafts, and labels via the Model Context Protocol.5MIT