·
Guides
Gmail
MCP

Gmail MCP server: every way to connect Gmail to Claude, Cursor, Claude Code and ChatGPT

Claude.ai and ChatGPT have a Gmail connector built in. Cursor, Claude Code, Codex and Grok do not. Here are the three ways to get a Gmail MCP server working, what each one costs you in setup, and which to pick for your client.

“Gmail MCP server” is one of the most searched phrases in the whole MCP space, and the answer depends entirely on which assistant you use. Inside claude.ai and ChatGPT you do not need one: both ship a native Gmail connector, you click Connect, sign in with Google, done. The search exists because the rest of the ecosystem does not have that button. Cursor, Claude Code, Codex, Grok, Vibe and every agent framework speak MCP, and none of them comes with Gmail. So here are the three ways to add one, honestly compared.

Option 1: the native connector (claude.ai, ChatGPT only)

If your assistant has it, use it. It is OAuth-based, maintained by the vendor, and covers calendar too. The limits are the ones you would expect: it only exists in that one app (your Claude Code session does not inherit your claude.ai connectors), and it only does Gmail. Your OVH, iCloud or Zoho mailbox still gets nothing.

Option 2: a self-hosted Gmail MCP server

There are several open-source Gmail MCP servers on GitHub, and they work. The setup is where people give up: you create a Google Cloud project, enable the Gmail API, configure an OAuth consent screen, register yourself as a test user (Google caps unverified apps at 100 test users and expires their tokens after seven days unless the app is published), download a credentials JSON, run the server locally, and repeat on every machine. Because Gmail’s mail scopes are restricted, publishing the app for real would require an annual third-party security audit (CASA), which is why none of these projects ship a hosted version. For a developer who wants full control and only ever uses one laptop, this is fine. For everyone else it is a weekend.

Option 3: a hosted MCP server with a Google app password

anymailmcp.com takes the path Thunderbird and Apple Mail take: IMAP and SMTP with a Google app password. Google issues one to any account with 2-Step Verification on, in about twenty seconds at myaccount.google.com/apppasswords. It is 16 characters, scoped to mail, and revocable in one click, so you never hand your real Google password to anything. There is no Cloud project, no consent screen, no test-user list, no local process: one URL, https://anymailmcp.com/mcp, works in every MCP client at once.

What you get is the full toolset: search, read, threads, attachments, drafts, labels, filing, send and forward, with a per-mailbox access level (read only, read and organize, or full) chosen by you. Nothing is copied into a database; every read is a live IMAP call to Google. Google Workspace addresses on a custom domain work the same way, we detect Google from your domain’s mail servers. The one thing this path does not give you is Google Calendar, whose CalDAV endpoint only accepts OAuth; use the native calendar connector for that where your client has one.

Which one should you pick?

  • You live in claude.ai or ChatGPT → the native connector. Nothing to install.
  • You use Cursor, Claude Code, Codex, Grok or Vibe → the hosted server with an app password is the one-minute path, and it follows you across machines and clients.
  • You want to read the code that touches your mail and only use one machine → self-host an open-source server and budget the Google Cloud setup.
  • You have Gmail and other mailboxes (a domain at OVH or IONOS, an iCloud address, a Zoho account) → the hosted server, because it is the only option that puts them all under one connector with the same tools.

Set it up

Turn on 2-Step Verification, create an app password, then pick your assistant below. The Gmail walkthrough has the details, including the Workspace admin setting that can block IMAP.

Set up

Frequently asked

Is an app password safe? Safer than your account password: it is scoped to mail, cannot log into your Google account, and can be revoked without changing anything else. We store it encrypted with AES-256-GCM and wipe it the second you disconnect.

Why not “Sign in with Google”? Because reading mail over IMAP needs Google’s most restricted scope, and Google requires an independent security audit every year before approving an app for it. App passwords are Google’s own supported route for mail programs; we would rather ship that today than a sign-in button in six months.

Does it work with Google Workspace? Yes, on any custom domain, provided your administrator allows 2-Step Verification and has not switched IMAP off for the organization.

Ready to let your assistant into your inbox?

Get started, free