Gmail MCP logo

Gmail MCP

by alexneamtu

Self-hosted Gmail MCP endpoint for searching, reading, drafting, and optionally sending mail across multiple account aliases.

Install Gmail MCP

Pick your client, then add it in one click or paste the config.

Streamable HTTP (Remote)
Server URL
https://claude.ai/api/mcp/auth_callback

Remote servers are added in the app, not the config file: Customize → Connectors → Add custom connector, then paste this URL.

Overview

alexneamtu/gmail-mcp connects Claude or Codex to multiple Gmail mailboxes through one self-hosted Streamable HTTP endpoint. Each mailbox is enrolled separately and addressed by an explicit alias such as `personal` or `work`, while credentials and authorization state are stored in encrypted SQLite. Choose drafts mode for reading and drafting, or full mode to enable sending drafts and changing existing labels. Reach for it when one owner needs controlled access to personal and work Gmail accounts from an MCP-compatible client.

Use cases

  • Search personal and work Gmail accounts with explicit aliases
  • Read messages and complete threads through an MCP client
  • Draft plain-text replies without sending them
  • Send approved drafts in full-access mode
  • Apply or remove existing Gmail labels

Key features

  • Multi-account Gmail access through one endpoint
  • Explicit account aliases on every tool call
  • Streamable HTTP MCP transport
  • Encrypted SQLite credential and authorization storage
  • Drafts and full access modes
  • Attachment retrieval up to 5 MB

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

9/9 checks healthy over the last 32d

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars4Stargazers on the source repository.
Last commitTodayMost recent push to the default branch.

How Gmail MCP works

What alexneamtu/gmail-mcp does

alexneamtu/gmail-mcp exposes Gmail operations over MCP for one configured owner with multiple enrolled mailboxes. It supports Gmail search queries, message and thread retrieval, attachment access, label lookup, plain-text draft creation, and optional draft sending or label changes.

Every operation includes an account alias. Aliases identify separately enrolled Gmail accounts, so an agent can target personal or work without relying on an implicit mailbox. Forwarded addresses are read from their destination mailbox and do not automatically grant permission to send as those addresses.

How it works

The service uses Streamable HTTP at the /mcp endpoint. A typical deployment places it behind an HTTPS hostname and Cloudflare Tunnel, forwarding to a loopback HTTP service managed by systemd under a dedicated non-root user.

Google OAuth enrolls each mailbox independently. A separate owner authentication flow lets Claude or Codex access the enrolled accounts. OAuth uses PKCE and checks the configured owner identity, verified email, state, nonce, and authorization details. Credentials and authorization state are encrypted in SQLite; the master key is kept in the local configuration area.

The repository also includes an inspection entrypoint for catalog tools. It exposes the nine tool definitions without reading private configuration, using Google credentials, or making Gmail requests. Calls in that mode return an inspection-only error.

Setup and configuration

Run the service with Node.js 24 on Linux with systemd, an HTTPS hostname, and a Google Cloud project with the Gmail API enabled. Create separate Google OAuth clients for desktop mailbox enrollment and web-based owner sign-in. The web client requires the deployment's /login/google/callback URL.

Build and test the project with:

  • npm ci --ignore-scripts
  • npm test
  • npm run check
  • npm run build

Initialize the installation with the built CLI, then enroll the owner and each mailbox alias. The CLI also provides a status command. Configuration is stored under ~/.config/gmail-mcp, while encrypted state is stored under ~/.local/share/gmail-mcp/state.db. Keep Google client JSON files, configuration, and the master key outside Git with restrictive permissions.

The public information pages should be available before Google OAuth configuration. Enrollment requires a browser on the server or a computer using SSH port forwarding; phone-only enrollment is unsupported.

Tools and capabilities

The tool set includes:

  • list_accounts for connected aliases and local enrollment state
  • search_messages for Gmail query searches
  • get_message for reading messages and listing or downloading attachments
  • get_thread for reading complete threads
  • get_attachment for retrieving attachments
  • list_labels for finding existing labels
  • create_draft for creating plain-text drafts
  • send_draft for sending an existing draft in full mode
  • modify_message_labels for applying or removing existing labels in full mode

Drafts mode exposes the read, account, label-listing, and draft tools while omitting sending and label modification. Full mode adds the latter two operations.

Limitations and notes

One deployment supports one owner, although that owner can enroll multiple Gmail accounts. Drafts mode does not expose a separate send operation, but the Google compose scope itself includes sending permission. In full mode, the connected client must approve a specific send; the server does not display a separate human approval screen.

Message bodies are limited to 60,000 characters and threads to 200,000 characters, with truncation indicators. Attachments are limited to 5 MB. Images are returned as image content, while other files are provided as embedded resources. Plain text is preferred; HTML-only messages are returned as labelled HTML text.

Forwarding does not enable sending from a forwarded address. The project is intended for technically experienced self-hosters and requires the operator to manage the HTTPS service, Google OAuth project, encrypted local state, and backups.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Gmail MCP

alexneamtu/gmail-mcp is an MCP server that connects Claude or Codex to multiple Gmail accounts through one self-hosted Streamable HTTP endpoint. Its main tools search and read messages, retrieve threads and attachments, list labels, create drafts, and optionally send drafts or modify message labels.

Install it with Node.js 24 by running `npm ci --ignore-scripts`, then `npm run build` and the setup commands from the built CLI. Configure Google OAuth clients, initialize the server, enroll the owner and mailbox aliases, and run it on Linux with systemd behind an HTTPS hostname.

Connect it in Claude as a custom web connector using the server's HTTPS `/mcp` URL. Choose the option to use an own OAuth client, set the connector client ID to `claude-gmail`, leave the client secret blank, and sign in as the configured Google owner.

Enable full mode rather than drafts mode. Full mode exposes `send_draft` and `modify_message_labels`; drafts mode omits both. The connected client must approve a specific draft send, and forwarded addresses do not gain sending permission merely through forwarding.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewGmail MCP AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/alexneamtu-gmail-mcp?style=directory)](https://allmcps.com/mcp/alexneamtu-gmail-mcp)
HTML Embed
<a href="https://allmcps.com/mcp/alexneamtu-gmail-mcp"><img src="https://allmcps.com/api/badge/alexneamtu-gmail-mcp?style=directory" alt="Gmail MCP on AllMCPs" /></a>