Gmail MCP logo

Gmail MCP

Self-hosted Cloudflare Worker exposing multi-account Gmail tools for reading, sending, replying, forwarding, drafts, labels, threads, and attachments.

Install Gmail MCP

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

Streamable HTTP (Remote)
Server URL
https://gmail-mcp.mkpo.li/mcp

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

Hosted endpointLive · 12h agoLive Remote EndpointOur automated health check connected to this remote MCP endpoint successfully.Last checked 12h ago · Nov 29, 2026, 15:45 UTC

Clients with native remote MCP support can connect directly to this URL.

Remote endpoint
https://gmail-mcp.mkpo.li/mcp

Overview

gmail-mcp connects Gmail to MCP clients through a Cloudflare Worker that you deploy and control. It supports multiple Google accounts by binding each MCP connection to one mailbox, while providing tools for search, reading, sending, replies, forwarding, drafts, attachments, labels, and threads. Google OAuth 2.1 with PKCE handles sign-in, and refresh tokens remain in the deployer's Cloudflare account. Reach for it when an agent needs remote Gmail access from clients such as Claude Code or claude.ai, including the ability to send mail.

Use cases

  • Search and summarize messages across separate personal and work Gmail connections
  • Send replies with quoted thread history and file attachments
  • Forward messages and manage drafts from a remote MCP client
  • Apply labels or move messages and threads to the trash
  • Connect Gmail to Claude Code or claude.ai through a self-hosted Worker

Key features

  • Multi-account Gmail connections
  • Search, message, and thread retrieval
  • Sending, reply-all, forwarding, and draft management
  • File attachments and inline CID images
  • Label and trash operations
  • Cloudflare Worker deployment with Google OAuth

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.

13/13 checks healthy over the last 77d

Adoption & maintenance

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

GitHub stars9Stargazers on the source repository.
Last commit25d agoMost recent push to the default branch.
Availability100%Our rolling endpoint + install checks that succeeded.
Directory activity4 viewsConfig copies, upvotes, and views on AllMCPs.

How Gmail MCP works

What gmail-mcp does

gmail-mcp exposes Gmail operations through the Model Context Protocol and runs as a remote Cloudflare Worker. It is designed for deployments where the operator controls the hosting environment and Google OAuth credentials. Multiple Gmail accounts can be connected to one deployment at the same time, with each MCP connection associated with a single Google account.

The server covers mailbox reading and message composition, including search, message and thread retrieval, sending, reply-all with quoted history, forwarding, drafts, labels, trash operations, and attachments. Outgoing messages can contain plain text, an HTML alternative, file attachments, and inline images referenced with cid: URLs.

How it works

A client connects to the Worker over MCP at /mcp or at a single-segment path such as /mcp/work. The connection then signs in to one Google account through OAuth. This per-connection mailbox binding lets one deployment serve separate personal and work accounts without selecting an account in every tool call.

The Worker stores Google refresh tokens in the deployer's Cloudflare account. It can run on a workers.dev hostname or on a custom domain associated with Cloudflare. Clients that do not allow two MCP servers to share one URL can use distinct path segments for separate mailbox connections.

Setup and configuration

Deployment requires a Cloudflare account, Bun, and a Google account. Create a Google Cloud project, enable the Gmail API, configure an external OAuth consent screen, publish the app, and create a web-application OAuth client. The callback URL follows the Worker host, using the form https://<your-host>/callback.

The repository supports deployment through Cloudflare's deploy button or locally with bun install followed by bun run setup. The setup command asks for the host, creates or reuses the OAUTH_KV namespace, accepts the OAuth client credentials, generates a cookie key, and deploys the Worker. A custom domain is optional; without one, Cloudflare provides a workers.dev address.

After deployment, add the MCP endpoint to a client. For Claude Code, connections can be registered with the HTTP transport, for example:

Terminal
claude mcp add --transport http gmail-personal https://<your-host>/mcp
claude mcp add --transport http gmail-work https://<your-host>/mcp/work

In claude.ai, add the same endpoint under Settings, Connectors, and Add custom connector. The Worker also serves a setup guide at its root URL.

Tools and capabilities

Available operations include:

  • Identify the connected account with whoami.
  • Search, read, and retrieve threads with search_messages, get_message, and get_thread.
  • Retrieve files with get_attachment.
  • Send, reply-all, forward, and manage drafts with send_message, reply_all, forward_message, create_draft, update_draft, send_draft, delete_draft, and list_drafts.
  • Stage larger attachments with stage_attachment_begin, stage_attachment_append, and stage_attachment_finish.
  • Create, update, delete, list, and apply labels using the label tools.
  • Modify messages or threads in batches and move messages or threads to and from the trash.

Message encoding supports RFC 2047 subjects and display names, RFC 2231 filenames, multipart alternatives, file attachments, and inline images.

Limitations and notes

The OAuth app should be published rather than left in Google's testing state: testing refresh tokens expire after seven days, while a published app can serve up to 100 accounts and displays an unverified-app warning during sign-in. Gmail mailbox settings such as filters and vacation responders are outside the server's scope. Each connection targets one account, so account separation is determined by the connection URL and OAuth session rather than by a per-call account parameter.

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

gmail-mcp is an MCP server that connects AI clients to Gmail through a self-hosted Cloudflare Worker. Its main tools search and read messages, retrieve threads and attachments, send and reply to mail, forward messages, manage drafts, and organize labels and threads across connected Google accounts.

Deploy it with Cloudflare's deploy button or clone the repository and run `bun install` followed by `bun run setup`. Setup configures the Worker host, KV namespace, Google OAuth client credentials, cookie key, and deployment.

Add the deployed Worker as an HTTP MCP server with `claude mcp add --transport http`. Use `https://<your-host>/mcp` for one mailbox and a path such as `/mcp/work` for another, then complete Google sign-in through Claude Code.

Yes, gmail-mcp can send new messages, reply-all with quoted history, forward messages, and send saved drafts. It also supports file attachments and inline images referenced with `cid:` URLs.

Yes, one deployment can serve several Google accounts at once by binding each MCP connection to one mailbox. Separate URL path segments can distinguish connections when a client does not permit duplicate server URLs.

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/gmail-mcp-2?style=directory)](https://allmcps.com/mcp/gmail-mcp-2)
HTML Embed
<a href="https://allmcps.com/mcp/gmail-mcp-2"><img src="https://allmcps.com/api/badge/gmail-mcp-2?style=directory" alt="Gmail MCP on AllMCPs" /></a>