Gmail MCP
io.github.A1-x-Tech · Updated
MCP server for the Gmail API: search, read and send email, manage drafts, labels and the trash.
At a glance
Gmail MCP is an MCP server in the Web & Search category. It runs locally over stdio via `npx -y mcp-google-gmail`, and needs GOOGLE_GMAIL_CLIENT_SECRET, GOOGLE_GMAIL_REFRESH_TOKEN and GOOGLE_GMAIL_ACCESS_TOKEN. It scores B (79/100) on the MCP Skills Hub health score as of Oct 28, 2026.
One-click install
Opens your editor and pre-fills the config. Your editor will ask before adding it.
How to install Gmail MCP in your AI client
Setup for Claude Code, Claude Desktop, Cursor, Codex, Windsurf, Cline and VS Code — copy-paste ready.
How to install Gmail MCP in Claude CodeAnthropic's agentic CLI
Add the server
bashclaude mcp add mcp-google-gmail -e 'GOOGLE_GMAIL_CLIENT_SECRET=<GOOGLE_GMAIL_CLIENT_SECRET>' -e 'GOOGLE_GMAIL_REFRESH_TOKEN=<GOOGLE_GMAIL_REFRESH_TOKEN>' -e 'GOOGLE_GMAIL_ACCESS_TOKEN=<GOOGLE_GMAIL_ACCESS_TOKEN>' -- npx -y mcp-google-gmailFill in your credentials
Replace <GOOGLE_GMAIL_CLIENT_SECRET>, <GOOGLE_GMAIL_REFRESH_TOKEN>, <GOOGLE_GMAIL_ACCESS_TOKEN> with your real values. Keep secrets out of any config file you commit.
Verify it's connected
bashclaude mcp listSharing it with your team?
Add `--scope project` to write it to .mcp.json in the repository root, which you can commit (with the secrets left as environment variables).
Use it in a session
Ask Claude to use the tools this server exposes. It discovers them automatically.
How to install Gmail MCP in Claude DesktopDesktop app (MCP config)
Open your MCP config
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json · Windows: %APPDATA%\Claude\claude_desktop_config.json
Add this server
json{ "mcpServers": { "mcp-google-gmail": { "command": "npx", "args": [ "-y", "mcp-google-gmail" ], "env": { "GOOGLE_GMAIL_CLIENT_SECRET": "<GOOGLE_GMAIL_CLIENT_SECRET>", "GOOGLE_GMAIL_REFRESH_TOKEN": "<GOOGLE_GMAIL_REFRESH_TOKEN>", "GOOGLE_GMAIL_ACCESS_TOKEN": "<GOOGLE_GMAIL_ACCESS_TOKEN>" } } } }Fill in your credentials
Replace <GOOGLE_GMAIL_CLIENT_SECRET>, <GOOGLE_GMAIL_REFRESH_TOKEN>, <GOOGLE_GMAIL_ACCESS_TOKEN> with your real values. Keep secrets out of any config file you commit.
Restart Claude Desktop
The tools appear under the 🔌 menu once the app reloads.
How to install Gmail MCP in CursorAI-first code editor
Create / edit .cursor/mcp.json in your project
json{ "mcpServers": { "mcp-google-gmail": { "command": "npx", "args": [ "-y", "mcp-google-gmail" ], "env": { "GOOGLE_GMAIL_CLIENT_SECRET": "<GOOGLE_GMAIL_CLIENT_SECRET>", "GOOGLE_GMAIL_REFRESH_TOKEN": "<GOOGLE_GMAIL_REFRESH_TOKEN>", "GOOGLE_GMAIL_ACCESS_TOKEN": "<GOOGLE_GMAIL_ACCESS_TOKEN>" } } } }Fill in your credentials
Replace <GOOGLE_GMAIL_CLIENT_SECRET>, <GOOGLE_GMAIL_REFRESH_TOKEN>, <GOOGLE_GMAIL_ACCESS_TOKEN> with your real values. Keep secrets out of any config file you commit.
Enable it
Cursor Settings → MCP → toggle the server on. Tools become available to the Composer/Agent.
How to install Gmail MCP in Codex CLIOpenAI coding agent
Add to ~/.codex/config.toml
toml[mcp_servers.mcp-google-gmail] command = "npx" args = ["-y", "mcp-google-gmail"] env = { GOOGLE_GMAIL_CLIENT_SECRET = "<GOOGLE_GMAIL_CLIENT_SECRET>", GOOGLE_GMAIL_REFRESH_TOKEN = "<GOOGLE_GMAIL_REFRESH_TOKEN>", GOOGLE_GMAIL_ACCESS_TOKEN = "<GOOGLE_GMAIL_ACCESS_TOKEN>" }Fill in your credentials
Replace <GOOGLE_GMAIL_CLIENT_SECRET>, <GOOGLE_GMAIL_REFRESH_TOKEN>, <GOOGLE_GMAIL_ACCESS_TOKEN> with your real values. Keep secrets out of any config file you commit.
Run Codex
Codex loads MCP servers from config.toml on startup and exposes their tools to the agent.
How to install Gmail MCP in WindsurfCodeium's agentic IDE
Edit ~/.codeium/windsurf/mcp_config.json
json{ "mcpServers": { "mcp-google-gmail": { "command": "npx", "args": [ "-y", "mcp-google-gmail" ], "env": { "GOOGLE_GMAIL_CLIENT_SECRET": "<GOOGLE_GMAIL_CLIENT_SECRET>", "GOOGLE_GMAIL_REFRESH_TOKEN": "<GOOGLE_GMAIL_REFRESH_TOKEN>", "GOOGLE_GMAIL_ACCESS_TOKEN": "<GOOGLE_GMAIL_ACCESS_TOKEN>" } } } }Fill in your credentials
Replace <GOOGLE_GMAIL_CLIENT_SECRET>, <GOOGLE_GMAIL_REFRESH_TOKEN>, <GOOGLE_GMAIL_ACCESS_TOKEN> with your real values. Keep secrets out of any config file you commit.
Reload
Windsurf → Cascade → refresh MCP servers. Cascade can now call the tools.
How to install Gmail MCP in ClineVS Code autonomous agent
Open Cline → MCP Servers → Configure
Adds to cline_mcp_settings.json.
Add the server
json{ "mcpServers": { "mcp-google-gmail": { "command": "npx", "args": [ "-y", "mcp-google-gmail" ], "env": { "GOOGLE_GMAIL_CLIENT_SECRET": "<GOOGLE_GMAIL_CLIENT_SECRET>", "GOOGLE_GMAIL_REFRESH_TOKEN": "<GOOGLE_GMAIL_REFRESH_TOKEN>", "GOOGLE_GMAIL_ACCESS_TOKEN": "<GOOGLE_GMAIL_ACCESS_TOKEN>" } } } }Fill in your credentials
Replace <GOOGLE_GMAIL_CLIENT_SECRET>, <GOOGLE_GMAIL_REFRESH_TOKEN>, <GOOGLE_GMAIL_ACCESS_TOKEN> with your real values. Keep secrets out of any config file you commit.
How to install Gmail MCP in VS CodeCopilot / MCP support
Create .vscode/mcp.json
json{ "servers": { "mcp-google-gmail": { "type": "stdio", "command": "npx", "args": [ "-y", "mcp-google-gmail" ], "env": { "GOOGLE_GMAIL_CLIENT_SECRET": "<GOOGLE_GMAIL_CLIENT_SECRET>", "GOOGLE_GMAIL_REFRESH_TOKEN": "<GOOGLE_GMAIL_REFRESH_TOKEN>", "GOOGLE_GMAIL_ACCESS_TOKEN": "<GOOGLE_GMAIL_ACCESS_TOKEN>" } } } }Fill in your credentials
Replace <GOOGLE_GMAIL_CLIENT_SECRET>, <GOOGLE_GMAIL_REFRESH_TOKEN>, <GOOGLE_GMAIL_ACCESS_TOKEN> with your real values. Keep secrets out of any config file you commit.
Start it
VS Code shows a ▶ Start action above the server entry. Agent mode (Copilot Chat) can then use the tools.
What does Gmail MCP need from you?
API key — Google OAuth2 client secret (refresh-token flow). Treat it as a secret.
GOOGLE_GMAIL_CLIENT_IDoptionalEnvironment variableGoogle OAuth2 client id (refresh-token flow).
GOOGLE_GMAIL_CLIENT_SECREToptionalsecretEnvironment variableGoogle OAuth2 client secret (refresh-token flow). Treat it as a secret.
GOOGLE_GMAIL_REFRESH_TOKENoptionalsecretEnvironment variableGoogle OAuth2 refresh token, exchanged for access tokens automatically. Treat it as a secret.
GOOGLE_GMAIL_ACCESS_TOKENoptionalsecretEnvironment variableStatic OAuth2 access token (~1h lifetime) — alternative to the refresh-token trio, mostly for testing.
GOOGLE_GMAIL_OAUTH_PORToptionalEnvironment variableFixed port for the loopback listener of the in-chat login (127.0.0.1 + PKCE). Set it when the client runs over SSH port forwarding; otherwise a free port is picked per login.
GOOGLE_GMAIL_API_BASEoptionalEnvironment variableAPI root override.
GOOGLE_GMAIL_TIMEOUT_MSoptionalEnvironment variablePer-request timeout in milliseconds.
GOOGLE_GMAIL_MAX_RETRIESoptionalEnvironment variableRetries on transient errors (429 always; 5xx/network for reads).
Pass secrets through your shell environment rather than committing them into a config file.
What tools does Gmail MCP expose?
This server runs as a local package. We only query remote servers for their tool list — asking this one would mean executing it, so its tools are listed in the documentation below.
What the code can do
Read from the published package source — never executed. Parsed 13 of 13 source files.
This server can read and write files, make network requests and read your environment variables.
How it was published
- No provenance attestation — there is nothing linking this published artifact to a specific source commit.
- 1 npm maintainer — a single point of compromise · last published by gistrec.
Maintainer of this package and think something here is wrong? Tell us and we'll correct it.
Before you install
Signals gathered from the source repo and package registry — not a safety verdict.
What it can reach
- Runs code on your machine — Executes as a local process with your user's permissions, including filesystem access.
- Downloads at launch — The package is fetched from its registry each run unless you pin a version.
- Last commit 25 days ago — Actively maintained.
- Repository created 2 months ago — Very new project with little track record yet.
- 0 GitHub stars — Very little community usage so far.
- 58 weekly downloads — Very few installs — you would be an early user.
Client compatibility
Health score
B · 79Maintenance, adoption, transparency and packaging — not a safety audit. How this is calculated
- Maintenance30%100%
Last commit 25 days ago.
- Adoption20%21%
0 stars, 58 weekly downloads.
- Transparency20%75%
3/4: ✓ public source repo, ✓ declared license, ✓ documentation, ✗ discoverable tool list.
- Provenance15%100%
Package and registry entry point at the same repository.
- Packaging15%100%
Publishes a pinned version (1.0.0).
Documentation
Full READMEGmail MCP
English | Русский
A1 Gmail MCP lets an AI app work with your Gmail mailbox in plain language. Search and read mail, prepare replies as drafts, send them when you are ready, keep labels tidy and use the trash instead of permanent deletion.
It uses the Gmail API with your Google account. It distinguishes a draft you can still edit from a sent email that cannot be recalled, and makes the limits of the Gmail API explicit instead of implying that every mail task is reversible.
- 24 tools. Search and read messages and threads, send email directly or through drafts, manage the draft lifecycle, labels and the trash.
- Connects from the conversation. Say "connect Gmail": the server walks you through the OAuth client, catches Google's redirect on
127.0.0.1with PKCE and keeps the tokens itself — no config files, no restart. - Send deliberately. The draft → review → send path is first-class; sending is marked destructive, and the server never re-sends after an ambiguous failure — an email cannot be unsent.
- The trash is the safety net. Removing mail goes through the reversible trash (about 30 days); there is deliberately no permanent message delete tool.
- Bounded reading. Decoded bodies are truncated at an explicit limit and attachments come back as metadata, so a long newsletter cannot silently flood the conversation.
- Minimal Google scope. It uses
gmail.modifyonly — no permanent deletion and no access to Gmail settings.
Start with a read-only question:
Show my unread emails from the last week and tell me which ones need a reply.
Connect the server · Explore use cases · Open technical documentation
See it work in a minute
You: What is unread in my inbox from this week about the Acme contract? Assistant: Searches with Gmail query syntax and shows senders, subjects, dates and snippets. Nothing changes. You: Draft a reply to the latest one: we send the signed copy on Friday. Assistant: Creates a draft in the same thread and shows it for review. Nothing is sent. You: Send it. Assistant: Sends the draft. Sending is a separate, explicitly destructive step, so your AI app can ask for confirmation first.
Contents
- Quick start
- What you can ask it to do
- How mail changes
- What can change
- Getting access
- Configuration
- Data, limits and background work
- Technical documentation
- Support
Quick start
Excerpt — the full document is on GitHub.
Alternatives to Gmail MCP
- braveA · 91Visit https://brave.com/search/api/ for a free API key. Search the web, local businesses, images,…
- Gmail-MCP-ServerA · 87Lean Gmail MCP server with auto authentication support
- gmailC · 57Read emails, send messages, and manage labels in your Gmail account.
- gmailB · 69A MCP server for Gmail that lets you search, read, and draft emails and replies.
Maintain Gmail MCP? Add a badge to your README
Shows its health grade, and links readers to install steps for every client.
[](https://mcp-skills-hub.vercel.app/mcps/io-github-a1-x-tech-mcp-google-gmail)Catalog data refreshed . Something wrong? Report it.