Gmail Mcp Multiauth
БесплатноПоддерживаетсяGmail MCP server with multi-account support and token refresh persistence
Описание
Gmail MCP server with multi-account support and token refresh persistence
README
A Gmail MCP server that actually supports multiple accounts. Fork of the archived GongRzhe/Gmail-MCP-Server with two fixes the original never shipped:
- Token refresh persistence — refreshed OAuth tokens are saved back to disk. Without this, each account silently loses auth after the first token expiry.
- Account isolation — each server instance knows which account it is via
GMAIL_ACCOUNT_NAME. The MCP server name becomesgmail-personal,gmail-business, etc. instead of all four showing asgmail.
Works with Claude Desktop, Cursor, or any MCP-compatible client.
Setup
1. Google Cloud credentials
You need a gcp-oauth.keys.json for each account — or one shared OAuth app with separate tokens. The simplest approach: one Google Cloud project, one OAuth client, one gcp-oauth.keys.json file used by all accounts.
- Go to Google Cloud Console
- Create a project → Enable the Gmail API
- Create OAuth 2.0 credentials (Desktop app type)
- Download as
gcp-oauth.keys.json
2. Create per-account directories
mkdir -p ~/.gmail-personal ~/.gmail-business ~/.gmail-newsletter ~/.gmail-payments
Copy your gcp-oauth.keys.json into each:
cp gcp-oauth.keys.json ~/.gmail-personal/
cp gcp-oauth.keys.json ~/.gmail-business/
# repeat for each account
3. Run setup for each account
One command per account. It opens a browser, you sign in with the right Google account, and it creates everything automatically.
# The second argument is where your downloaded keys file is right now.
# It gets copied into ~/.gmail-personal/ — Downloads is not used after this.
npx gmail-mcp-multiauth setup personal ~/Downloads/gcp-oauth.keys.json
npx gmail-mcp-multiauth setup work ~/Downloads/gcp-oauth.keys.json
npx gmail-mcp-multiauth setup client ~/Downloads/gcp-oauth.keys.json
After each command, these files exist in their own folder:
~/.gmail-personal/
gcp-oauth.keys.json ← copied from your download
credentials.json ← written after you authenticate
start-mcp.sh ← generated, ready to use
The setup command also prints the exact JSON block to paste into your MCP config.
4. Add to your MCP config
Cursor (~/.cursor/mcp.json) or Claude Desktop (~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"gmail-personal": {
"command": "/Users/YOUR_NAME/.gmail-personal/start-mcp.sh",
"args": []
},
"gmail-business": {
"command": "/Users/YOUR_NAME/.gmail-business/start-mcp.sh",
"args": []
}
}
}
Restart your client. Each account shows up as a separate MCP server with its own name.
Environment variables
| Variable | Required | Default | Description |
|---|---|---|---|
GMAIL_OAUTH_PATH |
Yes | ~/.gmail-mcp/gcp-oauth.keys.json |
Path to your OAuth client keys |
GMAIL_CREDENTIALS_PATH |
Yes | ~/.gmail-mcp/credentials.json |
Where tokens are stored/refreshed |
GMAIL_ACCOUNT_NAME |
No | default |
Label for this account (e.g. personal, work) |
What it can do
- Send, draft, read, search emails
- Attachments (send and download)
- Label management (create, update, delete, list)
- Gmail filters
- Batch operations (mark read, move, delete)
- HTML emails
Single-account setup
If you only need one account, skip the wrapper scripts and configure directly:
{
"mcpServers": {
"gmail": {
"command": "npx",
"args": ["-y", "@jessicaoy89/gmail-mcp"],
"env": {
"GMAIL_OAUTH_PATH": "/Users/YOU/.gmail/gcp-oauth.keys.json",
"GMAIL_CREDENTIALS_PATH": "/Users/YOU/.gmail/credentials.json",
"GMAIL_ACCOUNT_NAME": "main"
}
}
}
}
Credit
Originally built by GongRzhe. Forked and maintained here after the original was archived in March 2026.
Установить Gmail Mcp Multiauth в Claude Desktop, Claude Code, Cursor
unyly install gmail-mcp-multiauthСтавит в Claude Desktop, Claude Code, Cursor и VS Code — сам разбирается с npx, uvx и сборкой из исходников.
Впервые? Поставь CLI: curl -fsSL https://unyly.org/install | sh
Или настроить вручную
Выполни в терминале:
claude mcp add gmail-mcp-multiauth --env GMAIL_ACCOUNT_NAME="" --env GMAIL_CREDENTIALS_PATH="" --env GMAIL_OAUTH_PATH="" -- npx -y gmail-mcp-multiauthПошаговые гайды: как установить Gmail Mcp Multiauth
FAQ
Gmail Mcp Multiauth MCP бесплатный?
Да, Gmail Mcp Multiauth MCP бесплатный — установка в пару кликов через Unyly без оплаты.
Нужен ли API-ключ для Gmail Mcp Multiauth?
Да, требуются переменные окружения: GMAIL_ACCOUNT_NAME, GMAIL_CREDENTIALS_PATH, GMAIL_OAUTH_PATH. Unyly подставит их в конфиг при установке.
Gmail Mcp Multiauth — hosted или self-hosted?
Self-hosted: сервер запускается локально на твоей машине командой из раздела установки.
Как установить Gmail Mcp Multiauth в Claude Desktop, Claude Code или Cursor?
Открой Gmail Mcp Multiauth на unyly.org, выбери вкладку своего клиента (Claude Desktop, Claude Code, Cursor) и нажми Install — конфиг сгенерируется автоматически, без правки JSON.
Изменения
Версии и запрашиваемые доступы со временем.
- Новая версия опубликована
Похожие MCP
Gmail
Read, send and search emails from Claude
автор: GoogleSlack
Send, search and summarize Slack messages
автор: SlackRunbear
No-code MCP client for team chat platforms, such as Slack, Microsoft Teams, and Discord.
Discord Server
A community discord server dedicated to MCP by [Frank Fiegel](https://github.com/punkpeye)
Klavis AI
Open Source MCP Infra. Hosted MCP servers and MCP clients on Slack and Discord.
Work90210/APIFold
Turn any REST API into a hosted MCP server. 18 free public servers (GitHub, Stripe, Slack, OpenAI, Notion, and more) — no setup required, bring your own API key
автор: Work90210arikusi/deepseek-mcp-server
MCP server for DeepSeek AI with chat, reasoning, multi-turn sessions, function calling, thinking mode, and cost tracking.
автор: arikusihashgraph-online/hashnet-mcp-js
MCP server for the Registry Broker. Discover, register, and chat with AI agents on the Hashgraph network.
автор: hashgraph-onlineprofullstack/mcp-server
A comprehensive MCP server aggregating 20+ tools including SEO optimization, document conversion, domain lookup, email validation, QR generation, weather data,
автор: profullstackWayStation-ai/mcp
Seamlessly and securely connect Claude Desktop and other MCP hosts to your favorite apps (Notion, Slack, Monday, Airtable, etc.). Takes less than 90 secs.
автор: waystation-aiCompare Gmail Mcp Multiauth with
Не уверен что выбрать?
Найди свой стек за 60 секунд
Автор?
Embed-бейдж для README
Похожее
Все в категории communication
