Gmail-MCP-Server
io.github.ArtyMcLabin · Updated
Lean Gmail MCP server with auto authentication support
At a glance
Gmail-MCP-Server is an MCP server in the Dev Tools & Git category. It runs locally over stdio via `npx -y @artymclabin/gmail-mcp`, and declares no required credentials. It exposes 8 tools, including read_email, list_email_labels and send_email. It scores A (87/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-Server 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-Server in Claude CodeAnthropic's agentic CLI
Add the server
bashclaude mcp add Gmail-MCP-Server -- npx -y @artymclabin/gmail-mcpVerify 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 (e.g. read_email, list_email_labels, send_email). It discovers them automatically.
How to install Gmail-MCP-Server 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": { "Gmail-MCP-Server": { "command": "npx", "args": [ "-y", "@artymclabin/gmail-mcp" ] } } }Restart Claude Desktop
The tools appear under the 🔌 menu once the app reloads.
How to install Gmail-MCP-Server in CursorAI-first code editor
Create / edit .cursor/mcp.json in your project
json{ "mcpServers": { "Gmail-MCP-Server": { "command": "npx", "args": [ "-y", "@artymclabin/gmail-mcp" ] } } }Enable it
Cursor Settings → MCP → toggle the server on. Tools become available to the Composer/Agent.
How to install Gmail-MCP-Server in Codex CLIOpenAI coding agent
Add to ~/.codex/config.toml
toml[mcp_servers.Gmail-MCP-Server] command = "npx" args = ["-y", "@artymclabin/gmail-mcp"]Run Codex
Codex loads MCP servers from config.toml on startup and exposes their tools to the agent.
How to install Gmail-MCP-Server in WindsurfCodeium's agentic IDE
Edit ~/.codeium/windsurf/mcp_config.json
json{ "mcpServers": { "Gmail-MCP-Server": { "command": "npx", "args": [ "-y", "@artymclabin/gmail-mcp" ] } } }Reload
Windsurf → Cascade → refresh MCP servers. Cascade can now call the tools.
How to install Gmail-MCP-Server in ClineVS Code autonomous agent
Open Cline → MCP Servers → Configure
Adds to cline_mcp_settings.json.
Add the server
json{ "mcpServers": { "Gmail-MCP-Server": { "command": "npx", "args": [ "-y", "@artymclabin/gmail-mcp" ] } } }
How to install Gmail-MCP-Server in VS CodeCopilot / MCP support
Create .vscode/mcp.json
json{ "servers": { "Gmail-MCP-Server": { "type": "stdio", "command": "npx", "args": [ "-y", "@artymclabin/gmail-mcp" ] } } }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-Server need from you?
Configuration only — Declares config values but no credentials.
GMAIL_OAUTH_PATHoptionalEnvironment variableOptional override for the OAuth client keys file path (defaults to ~/.gmail-mcp/gcp-oauth.keys.json)
GMAIL_CREDENTIALS_PATHoptionalEnvironment variableOptional override for the stored credentials file path (defaults to ~/.gmail-mcp/credentials.json)
Pass secrets through your shell environment rather than committing them into a config file.
What tools does Gmail-MCP-Server expose? (8)
Taken from the project's README — the server itself was not queried, so check its docs for the exact schemas.
- read_email`gmail.readonly` or `gmail.modify`
- list_email_labels`gmail.readonly`, `gmail.modify`, or `gmail.labels`
- send_email`gmail.modify`, `gmail.compose`, or `gmail.send`
- delete_draft`gmail.modify` or `gmail.compose`
- modify_email`gmail.modify`
- delete_email`gmail.full` (`https://mail.google.com/`)
- create_label`gmail.modify` or `gmail.labels`
- list_filters`gmail.settings.basic`
What the code can do
Read from the published package source — never executed. Parsed 10 of 10 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 artymclabin.
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 21 days ago — Actively maintained.
- Fork of another repository — Check whether the upstream project is the one you actually want.
- 251 GitHub stars — Community adoption signal.
Client compatibility
Health score
A · 87Maintenance, adoption, transparency and packaging — not a safety audit. How this is calculated
- Maintenance30%100%
Last commit 21 days ago.
- Adoption20%73%
251 stars.
- Transparency20%100%
4/4: ✓ public source repo, ✓ declared license, ✓ documentation, ✓ discoverable tool list.
- Provenance15%50%
Repository is a fork.
- Packaging15%100%
Publishes a pinned version (1.2.3).
Documentation
Full READMEGmail MCP Server (Actively Maintained Fork)
Installation: npx @artymclabin/gmail-mcp auth - or just tell your Claude to install the MCP from this repo (https://github.com/ArtyMcLabin/Gmail-MCP-Server) and let it set up. Prefer manual steps? See Installation & Authentication.
Also on the official MCP Registry (io.github.ArtyMcLabin/Gmail-MCP-Server) and Smithery.
This is an actively maintained fork of [GongRzhe/Gmail-MCP-Server](https://github.com/GongRzhe/Gmail-MCP-Server). The original repository has been unmaintained since August 2025 - 7+ months with zero maintainer activity and 72+ unmerged pull requests. I use this MCP server daily as part of my Claude Code workflow and depend on it working correctly, so I picked it up. Pull requests are welcome. If you've been sitting on fixes or features with nowhere to submit them, this is the place.
Philosophy
This fork is lean and pragmatic. It's a local stdio MCP server - you run it on your own machine, and your LLM client already has shell + filesystem access. So the threat model is "don't leak credentials to third parties, don't break the Gmail surface" - not "defend a hosted multi-tenant service". I keep dependencies minimal. I use this daily in my own Claude Code workflow - if I wouldn't run it or maintain it myself, it doesn't go in.
There's a downstream fork that took this in the maximalist direction. I'm not affiliated with its maintainer and I don't track its security or features - use it at your own risk: [klodr/gmail-mcp](https://github.com/klodr/gmail-mcp). If that's the philosophy you want, go check it out. PRs welcome here as always.
What this fork adds
- Fixed reply threading - auto-resolves
In-Reply-ToandReferencesheaders so email replies land in the correct thread instead of creating orphaned messages (upstream PR #91, still pending) - Send-as alias support - optional
fromparameter for multi-identity email management (send from any configured Gmail alias) - Reply-all tool -
reply_allautomatically fetches the original email, builds To/CC recipient lists (excluding yourself), and sets proper threading headers (PR #3 by @MaxGhenis) - Fixed `list_filters` - was returning empty array due to wrong response property name (PR #4 by @nicholas-anthony-ai)
- Custom OAuth2 scoping -
--scopesflag to request only the permissions you need, with automatic tool filtering (PR #6 by @tansanDOTeth) - CI/CD hardening - fixed shell injection vector in GitHub Actions workflow, added least-privilege permissions scope (PR #9 by @JF10R)
- Security hardening - fixed path traversal in attachment download, restricted OAuth credential file permissions (PR #10 by @JF10R)
- Dependency security - upgraded MCP SDK to v1.27.1 (3 CVE fixes), upgraded nodemailer (DoS + routing fix), moved dev-only packages out of production deps (PR #11 by @JF10R)
- Thread-level tools -
get_thread,list_inbox_threads,get_inbox_with_threads,modify_threadfor efficient thread-based email operations in a single call - CC/BCC visibility -
read_emailnow shows CC and BCC headers when present (PR #21 by @panghy) - Phishing report tools -
report_phishingandbatch_report_phishingfor marking messages as spam via the Gmail API (PR #24 by @ShivamB25) - Draft lifecycle tools -
send_draft,delete_draft,update_draftclose the orphan-draft gap:send_draftatomically sends an existing draft and removes it from Drafts (no ghost copy);update_draftmutates a draft in place preserving its ID (no draft pile-up across iteration loops);delete_draftdiscards an abandoned draft (PR #30 by @thisisambros) - Tool annotations - MCP spec annotations (
readOnlyHint,destructiveHint,idempotentHint) on all tools for safer LLM tool execution (PR #14 by @bryankthompson) - Download email tool -
download_emailsaves emails to disk in json/eml/txt/html formats without consuming LLM context (PR #13 by @icanhasjonas) - Durable OAuth sessions -
refresh_tokenis persisted across restarts, ending the hourly re-auth loop (PR #35 by @BrentBaccala) - Custom OAuth callback port - the auth listener derives port and path from your callback URL instead of hardcoding 3000 (PR #41 by @soapergem)
- Safe permanent-delete gating -
delete_email/batch_delete_emailsrequire the opt-ingmail.fullscope (which also satisfies all other mail scopes), so default auth stays least-privilege (PR #39 by [@caioribeiroclw-pixel](https://github.com/caioribeiro
…
Excerpt — the full document is on GitHub.
Alternatives to Gmail-MCP-Server
- Mailoo - Email MCP ServerA · 80Email MCP server for AI agents: IMAP/SMTP, Gmail, Outlook, calendar, ManageSieve, AI triage, OAuth2.
- OneUptimeA · 96Manage incidents, alerts, monitors, status pages, on-call and telemetry in OneUptime.
- gmailA · 82MCP server for Gmail with OAuth2 (personal) and service account (Workspace) support.
- Sendraven MCPA · 82Email infrastructure for AI agents: send, read replies as threads, campaigns, per-key limits.
Maintain Gmail-MCP-Server? 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-artymclabin-gmail-mcp-server)Catalog data refreshed . Something wrong? Report it.