Sponsored byOutsenseAI that finds your next clients
SponsorGROUOutbound, LinkedIn content and leads for B2B teamsSponsorOutsenseAI that finds your next clientsAd+Your tool hereSeen by people installing AI tools@Weekly picksThe best new tools, one email a week

Gmail MCP

MCP server by A1-x-Tech Community

Lets an AI assistant search, read, draft and send Gmail messages, manage labels and move mail to the trash. Aimed at people who want to handle their Gmail in plain language.

  • Score 79
  • 0 stars
  • 449 a week
  • MIT
  • Updated

Install Gmail MCP

Built from the published package, never by AI.

claude mcp add gmail-mcp -- npx -y mcp-google-gmail

Run in your terminal. Add --scope user to use it in every project.

Step-by-step: install Gmail MCP in Claude Code

MCP servers run with your permissions and can read what you give them access to. Some need an API key: check the README and add it under env in the gmail-mcp block.

About

A1 Gmail MCP lets an AI app work with a Gmail mailbox through the Gmail API. It can search and read messages and threads, prepare replies as drafts, send email, manage labels and move mail to the trash. The server connects from the conversation using Google OAuth with a loopback redirect and PKCE, and it stores the tokens itself.

The server separates drafts, which can still be edited, from sent email, which cannot be recalled. Removing mail goes to the reversible trash, and there is no permanent message delete tool. It requests only the gmail.modify scope. It is intended for users who want an AI app to handle their Gmail in plain language.

Written from the project's README and checked against it.

Tools it gives your assistant

  • create_draftCreates a draft email, which stays unsent until it is sent.
  • get_draftShows a draft so it can be reviewed before sending.
  • update_draftReplaces the whole content of an existing draft.
  • send_draftSends an existing draft to its recipients.
  • send_messageSends an email immediately, without creating a draft first.
  • delete_draftPermanently deletes a draft, skipping the trash.
  • manage_trashMoves messages or threads to or from the trash, reversible for about 30 days.
  • start_loginReturns a Google consent link to connect the Gmail account from the chat.
  • auth_statusShows whether a Gmail account is connected.
  • raw_requestCalls Gmail API methods that have no dedicated tool.

What you need

  • Node.js 20 or later
  • A Google account with access to Gmail
  • A Google Cloud project with the Gmail API enabled
  • An OAuth Desktop app client, created in Google Cloud
SettingNeededWhat it is
GOOGLE_GMAIL_CLIENT_IDEnvironment variableOptionalGoogle OAuth2 client id (refresh-token flow).
GOOGLE_GMAIL_CLIENT_SECRETEnvironment variable, secretOptionalGoogle OAuth2 client secret (refresh-token flow). Treat it as a secret.
GOOGLE_GMAIL_REFRESH_TOKENEnvironment variable, secretOptionalGoogle OAuth2 refresh token, exchanged for access tokens automatically. Treat it as a secret.
GOOGLE_GMAIL_ACCESS_TOKENEnvironment variable, secretOptionalStatic OAuth2 access token (~1h lifetime) — alternative to the refresh-token trio, mostly for testing.
GOOGLE_GMAIL_OAUTH_PORTEnvironment variableOptionalFixed 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_BASEEnvironment variableOptionalAPI root override. Default: https://gmail.googleapis.com
GOOGLE_GMAIL_TIMEOUT_MSEnvironment variableOptionalPer-request timeout in milliseconds. Default: 60000
GOOGLE_GMAIL_MAX_RETRIESEnvironment variableOptionalRetries on transient errors (429 always; 5xx/network for reads). Default: 3

From the publisher's entry in the official MCP Registry. Required settings are already in the install config below as placeholders.

Try asking

  • Show my unread emails from the last week and tell me which need a reply.
  • Draft a reply to the latest Acme email saying the signed copy goes out Friday.
  • Move that thread to the trash, and restore it if I change my mind.

Good to know

  • Sent emails cannot be unsent, so the server does not re-send after an ambiguous failure.
  • Removing mail uses the trash, reversible for about 30 days. There is no permanent message delete tool.
  • Testing-mode OAuth refresh tokens can expire after seven days.
  • Decoded bodies are truncated at a configurable limit, and attachments return as metadata only.

Security check

A

No download-and-run commands, hidden instructions or signs of sending keys out were found.

Checked automatically: README.md, package.json. This looks for known risky patterns and is not a full audit. How grades work

Alternatives to Gmail MCP

All alternatives →

Compare with Jitsu, Vexa or Linkedin MCP server

Gmail MCP: common questions

Can it delete Gmail messages permanently?

There is no permanent message delete tool. Removing mail moves it to the trash, which is reversible for about 30 days. Permanent deletion through raw_request requires the full mail.google.com scope.

Which Google scope does it use?

It uses only https://www.googleapis.com/auth/gmail.modify. The source says this excludes permanent deletion and access to Gmail settings.

Do I need to edit config files to connect Gmail?

No. The source says the assistant can walk you through creating the OAuth client and connecting from the chat, and tokens are saved to a local credentials file with mode 0600.

How do I install Gmail MCP?

In Claude Code run claude mcp add gmail-mcp -- npx -y mcp-google-gmail. For Claude Desktop, Cursor and VS Code, paste the config shown above and restart. See the install guides.

Is Gmail MCP the official server?

Gmail MCP is a community project by A1-x-Tech, not verified by a company domain.

Is Gmail MCP free?

The code is published under the MIT licence. The service it connects to may have its own pricing.

Is Gmail MCP safe to use?

It scores 79 of 100. Grades: maintenance A, licence A, quality C. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.

What are alternatives to Gmail MCP?

Similar MCP servers: Jitsu, Vexa, Linkedin MCP server, Netsapiens MCP.

Does Gmail MCP work with ChatGPT?

Not directly. It runs locally, and ChatGPT only connects to remote servers with a URL. Use it in Claude Code, Claude Desktop, Cursor, VS Code or Codex.

Gmail MCP Install

Add to stack

Loading.