gmail-mcp
Allows searching, reading, and managing Gmail threads, labels, and drafts across multiple 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., "@gmail-mcpSearch threads from alice-work about invoice"
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-mcp — multi-account Gmail MCP server
One local MCP server that serves several Gmail accounts, each under a short
alias (alice-work, bob-work, ...). Every tool takes an account
parameter, and the GMAIL_ACCOUNTS env var restricts a server instance to a
subset of accounts — so each Cowork workstream sees only its own two inboxes.
Capabilities: search/read threads, manage labels, create drafts.
Deliberately absent: sending. There is no send tool, so no agent connected
to this server can send mail — a human reviews drafts and sends from Gmail.
(Note: the underlying OAuth scope gmail.modify would technically allow
sending; the restriction is enforced by this server's tool surface, not by
Google. Don't point other software at the stored tokens.)
1. Google Cloud setup (once, ~5 minutes)
Go to https://console.cloud.google.com/ and create a project (any name, e.g.
gmail-mcp).APIs & Services → Library → search "Gmail API" → Enable.
APIs & Services → OAuth consent screen:
User type: External, fill in the app name + your email.
Under Audience / Test users, add all four Gmail addresses. (In Testing mode only listed test users can authorize — that's fine, and you skip Google's app verification entirely.)
APIs & Services → Credentials → Create credentials → OAuth client ID:
Application type: Desktop app.
Download the JSON and save it as
~/.gmail-mcp/credentials.json.
Heads-up: in Testing mode Google expires refresh tokens after 7 days unless the consent screen is published. After everything works, go back to the consent screen and click Publish app (you can ignore the verification warning for personal use) so tokens stop expiring weekly.
Related MCP server: multi-gmail-mcp
2. Authorize each account (once per account)
uv run gmail-mcp auth alice-work # browser opens; sign in as that account
uv run gmail-mcp auth alice-personal
uv run gmail-mcp auth bob-work # the other person signs in here
uv run gmail-mcp auth bob-personal
uv run gmail-mcp accounts # verify: alias -> email [ok]Sign in with the matching Google account each time — the alias is whatever
you type, so double-check the account picker. Tokens land in
~/.gmail-mcp/tokens/, readable only by your macOS user.
3. Wire into Claude — one server entry per workstream
Register the same server twice with different GMAIL_ACCOUNTS, then enable
the matching one in each workstream/session.
Claude Desktop / Cowork (~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"gmail-stream-a": {
"command": "uv",
"args": ["run", "--project", "/path/to/gmail-mcp", "gmail-mcp", "serve"],
"env": { "GMAIL_ACCOUNTS": "alice-work,bob-work" }
},
"gmail-stream-b": {
"command": "uv",
"args": ["run", "--project", "/path/to/gmail-mcp", "gmail-mcp", "serve"],
"env": { "GMAIL_ACCOUNTS": "alice-personal,bob-personal" }
}
}
}Claude Code, per workstream folder (or with claude mcp add), in
.mcp.json:
{
"mcpServers": {
"gmail": {
"command": "uv",
"args": ["run", "--project", "/path/to/gmail-mcp", "gmail-mcp", "serve"],
"env": { "GMAIL_ACCOUNTS": "alice-work,bob-work" }
}
}
}If uv isn't on the app's PATH, use its absolute path (which uv).
Tools
Tool | What it does |
| Aliases + emails this instance serves |
| Gmail query syntax ( |
| Full thread with decoded message bodies |
| Labels, incl. nested |
| Add/remove by name or ID; archive = remove |
| New draft or threaded reply ( |
| Existing drafts |
Layout
~/.gmail-mcp/credentials.json— OAuth client secret (shared by all accounts)~/.gmail-mcp/accounts.json— alias → email registry~/.gmail-mcp/tokens/<alias>.json— per-account tokensGMAIL_MCP_HOMEoverrides the config dir;GMAIL_ACCOUNTSrestricts visible accounts
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/alf239/gmail-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server