multi-gmail-mcp-server
Enables searching and summarizing emails across multiple Gmail accounts simultaneously through Claude.
README
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.enc - Exposes 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
Prerequisites
- Node.js >= 18
- A Google Cloud project with Gmail API enabled
Step 1 — Google Cloud Setup
- Go to https://console.cloud.google.com
- 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 build
Step 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.com
Each 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 account
Step 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 days
Each 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 personal
Security 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 username - This server only requests read-only Gmail access (
gmail.readonlyscope) - It never modifies, sends, or deletes emails
- The
GMAIL_CLIENT_SECRETnever leaves your machine
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.