multi-gmail-mcp-server
Allows connecting multiple Gmail accounts and provides tools to list accounts, search across all or specific accounts, read messages, and read threads, enabling email summarization across accounts.
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., "@multi-gmail-mcp-serversummarize my emails from today across all accounts"
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
MCP server that connects multiple Gmail accounts and lets Claude search and summarize all of them in one shot. Built for the gmail-summary skill with multi-account support.
What It Does
Connects personal, work, kids, school Gmail accounts — as many as you need
Stores OAuth tokens securely in an AES-256-GCM encrypted file at
~/.multi-gmail-mcp/tokens.encExposes 5 MCP tools to Claude:
gmail_list_accounts— see all connected accountsgmail_search_all— search ALL accounts simultaneouslygmail_search— search a specific accountgmail_read_message— read a full messagegmail_read_thread— read a full thread
Related MCP server: Gmail MCP Server
Prerequisites
Node.js >= 18
A Google Cloud project with Gmail API enabled
Step 1 — Google Cloud Setup
Create a new project (e.g. "my-gmail-mcp")
Enable Gmail API (APIs & Services → Enable APIs → search "Gmail API")
Create OAuth 2.0 credentials:
APIs & Services → Credentials → Create Credentials → OAuth client ID
Application type: Desktop app
Name: "multi-gmail-mcp"
Download the credentials and note your
Client IDandClient Secret
Step 2 — Install & Build
git clone https://github.com/umesh9883/multi-gmail-mcp-server.git
cd multi-gmail-mcp-server
npm install
npm run buildStep 3 — Set Environment Variables
# Linux / macOS
export GMAIL_CLIENT_ID=your_client_id_here
export GMAIL_CLIENT_SECRET=your_client_secret_here
# Windows (PowerShell)
$env:GMAIL_CLIENT_ID = "your_client_id_here"
$env:GMAIL_CLIENT_SECRET = "your_client_secret_here"Tip: Put these in your shell profile (~/.bashrc, ~/.zshrc) so they persist.
Step 4 — Add Gmail Accounts
Run the setup CLI to connect each account:
npm run setup add personal # Opens browser → sign in with personal@gmail.com
npm run setup add work # Opens browser → sign in with work@company.com
npm run setup add kids # Opens browser → sign in with kids@gmail.com
npm run setup add school # Opens browser → sign in with school@gmail.comEach command opens a browser, asks you to sign in, and stores the refresh token encrypted on disk.
npm run setup list # See all connected accounts
npm run setup remove john@gmail.com # Disconnect an accountStep 5 — Connect to Claude
Claude Desktop (claude_desktop_config.json)
{
"mcpServers": {
"multi-gmail": {
"command": "node",
"args": ["/absolute/path/to/multi-gmail-mcp-server/dist/index.js"],
"env": {
"GMAIL_CLIENT_ID": "your_client_id",
"GMAIL_CLIENT_SECRET": "your_client_secret"
}
}
}
}Restart Claude Desktop after saving.
Claude Code (.claude/settings.json)
{
"mcpServers": {
"multi-gmail": {
"command": "node",
"args": ["/absolute/path/to/multi-gmail-mcp-server/dist/index.js"],
"env": {
"GMAIL_CLIENT_ID": "your_client_id",
"GMAIL_CLIENT_SECRET": "your_client_secret"
}
}
}
}Usage with gmail-summary Skill
Once connected, use the same gmail-summary command in Claude. It will automatically find all your connected accounts and search them all:
gmail-summary today
gmail-summary this week
gmail-summary last 3 daysEach email in the summary will show which account it came from.
Troubleshooting
"No refresh_token received"
The account was previously authorized without offline access. Go to https://myaccount.google.com/permissions, revoke the app, then run npm run setup add again.
"Missing GMAIL_CLIENT_ID or GMAIL_CLIENT_SECRET" Set the environment variables before running setup or starting the server.
Token expired errors Tokens auto-refresh. If you see persistent auth errors, remove and re-add the account:
npm run setup remove problematic@gmail.com
npm run setup add personalSecurity Notes
Tokens are stored in an AES-256-GCM encrypted file at
~/.multi-gmail-mcp/tokens.enc(mode 600), encrypted with a key derived from your hostname and usernameThis server only requests read-only Gmail access (
gmail.readonlyscope)It never modifies, sends, or deletes emails
The
GMAIL_CLIENT_SECRETnever leaves your machine
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- 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/umesh9883/multi-gmail-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server