AutomataGet Started

Gmail MCP server, read-only and scoped by label

Let Claude, ChatGPT, and Cursor search and read Gmail over IMAP, only in the labels you choose. It signs in with an app password and cannot send mail.

100% Free· Open source

Token scope

Enforced server-side

Gmail folders

imap.gmail.com · app password · folder allowlist

  • Clients

    Gmail label

    Read
  • Invoices

    Gmail label

    Read
  • INBOX

    Gmail inbox

    Blocked
  • Banking

    Gmail label

    Blocked

Enabled tools

  • list-emails
  • search-emails
  • read-email
  • get-email-attachment
  • create-email-draft

Out-of-scope folder refused

Banking · not in this token's folders

The basics

What is a Gmail MCP server?

A Gmail MCP server connects your mailbox to AI assistants through the Model Context Protocol. It gives tools like Claude, ChatGPT, and Cursor a small set of actions, such as listing folders, searching and reading email, and fetching attachments, so they can work with your mail instead of you copying it into the chat.

Automata is a free, open-source MCP server that reads Gmail over IMAP with an app password. Every tool call is checked against the token first, so the AI only sees the labels you approve, and it has no way to send mail.

Official connectors

Automata vs the official Gmail connectors

Claude and ChatGPT both have official Gmail connectors that sign in with your Google account. Automata does not replace them. It is a different route to the same mailbox: IMAP with an app password, behind a token you scope yourself.

Choose the official connector when

  • You work in Claude.ai, Claude Desktop, or ChatGPT and want Gmail with no extra setup.
  • You would rather sign in with Google than store an app password anywhere.
  • You use Google Workspace and your admin has turned off IMAP, or you can't create an app password, so an IMAP connection cannot sign in.

Choose Automata when

  • You use another MCP client, such as Cursor, Grok Bot, Meta Muse, or your own agent, and want one Gmail endpoint for all of them.
  • You want the AI limited to a few labels, such as Clients or Invoices, not the whole mailbox.
  • You want it read-only: no sending, and drafts only if you switch them on.
  • You also use iCloud, Fastmail, Zoho, Yahoo, or another IMAP mailbox and want the same setup for each. See the Claude IMAP connector guide for iCloud and Yahoo.

Why scope matters

Most Gmail MCPs hand over the whole mailbox.

Open-source Gmail MCP servers usually run on the Gmail API through an OAuth client you create, and give the AI every label plus the ability to send. Automata enforces access folder by folder and leaves sending out entirely.

A typical open-source Gmail MCP server compared with Automata
CapabilityTypical Gmail MCPAutomata
What the AI can readEvery label in the mailboxOnly the folders (Gmail labels) on the token
Sending mailOften included: send, reply, or forward as youNever. An optional draft tool saves unsent drafts, off by default
SetupCreate a Google Cloud project and an OAuth clientAn app password; no Google Cloud project
Revoking accessRemove the app from your Google account for every clientRevoke one token; other clients keep working
Remote clients (Claude.ai, ChatGPT)Usually local stdio, with the OAuth credentials on your laptopStreamable HTTP endpoint with bearer tokens; credentials stay on the server

Hosted integration platforms such as Zapier, Composio, and Pipedream also offer Gmail MCP servers. Zapier's and Composio's include actions that send mail, which suits automations that need to send. Automata is the choice when the AI should only read.

Before you start

What the Gmail connection needs, and what it won't do

  • App password with 2-Step Verification

    Gmail issues app passwords only when 2-Step Verification is on. Automata stores the app password with the connection, so use one you can revoke on its own.

  • No sending

    The connection has no SMTP credentials. It cannot send, delete, move, or mark mail; the optional draft tool only saves an unsent draft.

  • No Gmail API or Google OAuth

    Automata reads Gmail over IMAP. There is no Google Cloud project, no OAuth consent screen, and no Gmail API access.

  • No Microsoft 365 or Outlook.com

    Microsoft requires OAuth for IMAP, which this connection does not support. Use the official Microsoft connector in your AI client instead.

Sync behavior, storage, and every limit are in the email (IMAP) docs.

Run it your way

Free, open source, and yours to inspect.

The control layer protecting your messages and data should not be a black box. Read the code, verify the checks, and deploy Automata wherever your security model requires.

Recommended

Railway

One-click deploy

Skip local setup entirely. Provision the full stack, including Postgres, Redis, and volumes, on Railway in a few minutes.

  • No local Docker required
  • Managed Postgres, Redis, and volumes
  • Add or remove connectors anytime
Deploy on Railway

Self-hosted

Free, forever

Run the Nuxt control plane and Postgres on your machine, VPS, or homelab. Add the WhatsApp or Telegram services only when you need those connectors.

  • MIT licensed source
  • Unlimited scoped connections
  • Credentials stay on your infrastructure
Open the repository

Hosted

Free tier available

Use the same connector and permission model without operating the services yourself. Free for one connection; Pro is $19/month after a 7-day trial.

  • Managed setup and updates
  • The same granular scopes
  • Direct access to the Automata team
Sign up for hosted

Comparing Automata with other tools? Read Automata vs Neon, Automata vs Supabase, Muse vs Grok Bot, Best WhatsApp MCPs, Best Postgres MCPs, or see all comparisons.

Reference

Gmail MCP tools

Every tool is limited to the folders on the token. Disabled tools are never registered, so the AI cannot even try them.

  • get-mailbox-statusread

    Reports which mailbox is connected, whether the sync works, and which folders are still backfilling.

  • list-mail-foldersread

    Lists only the folders in scope, INBOX first, with synced and unread counts.

  • list-emailsread

    Pages through headers, newest first, from one folder or every synced folder in scope.

  • search-emailsread

    Matches sender, recipient, and subject against synced headers, and body text through Gmail's own search.

  • read-emailread

    Returns the headers, the body as plain text, and the attachment list. It does not mark the email read.

  • get-email-attachmentread

    Fetches one attachment whole: images as images, text files as text, PDFs and other files as embedded files.

  • create-email-draftwrite

    Saves an unsent plain-text draft in your Drafts folder, if the token includes this tool. It cannot send.

Full parameters are in the MCP tools reference.

Setup

Connect Gmail to your AI client in three steps

  1. 1

    Create a Gmail app password

    Turn on 2-Step Verification for your Google account, then create an app password for Automata. You can revoke it later without changing your Google password.

  2. 2

    Add the mailbox and choose labels

    Sign up for hosted Automata or self-host it, choose Email (IMAP) with the Gmail preset, and paste the app password. Then create a connector token and pick its folders. New email tokens start read-only.

  3. 3

    Add the MCP URL to your client

    Paste the endpoint into Claude, ChatGPT, Cursor, or any MCP client. Start with get-mailbox-status to confirm it works.

Claude Code
claude mcp add --transport http gmail \
  https://mcp.getautomata.app/mcp/<connection-id> \
  --header "Authorization: Bearer <connector-token>"

In Claude.ai or Claude Desktop, open Settings → Customize → Connectors → Add → Add custom connector, paste the connection's own /mcp/<connection-id> URL from the token dialog, and add the token as an Authorization: Bearer request header. If your client can't set headers, use /mcp/<connector-token> instead. See all clients.

Clients

Set up a Gmail MCP server in Claude, ChatGPT, or Cursor

Every client follows the same pattern: a Gmail app password on the connection, a connector token limited to the folders you choose, and the MCP URL over Streamable HTTP. Whichever client is asking, it can read only those folders, and it cannot send.

  • Claude

    Claude has an official Gmail connector, and if you use Claude.ai or Claude Desktop it is the simpler start. To use Automata instead, add a custom connector with the connection's /mcp/<connection-id> URL and the token as an Authorization: Bearer header. In Claude Code, it is the one command shown above.

    Connect Claude to email over IMAP
  • ChatGPT

    ChatGPT also has an official Gmail connector. Automata can be added under Plugins as a custom MCP server on plans that support them. ChatGPT cannot send an Authorization header, so use the /mcp/<connector-token> URL.

    Add a custom MCP server to ChatGPT
  • Cursor and other MCP clients

    Cursor supports remote MCP servers with custom headers, so add the connection's URL to mcp.json with the token in the Authorization header. Grok Bot, Meta Muse, and your own agents connect the same way.

    MCP clients docs
  • iCloud, Fastmail, Zoho, Yahoo, and Proton

    The same connection has presets for iCloud, Fastmail, Zoho, and Yahoo, and works with any mailbox that offers IMAP and a password login. Proton Mail works through a hydroxide bridge beside a self-hosted install.

    Email (IMAP) connection docs

Use cases

What you can ask once Gmail is connected

  • “Find the invoice from Acme in the Invoices label and tell me the total.”
  • “Summarize every unread email in Clients since Monday and what each person needs.”
  • “Read the contract PDF attached to the latest email from legal and list the key dates.”
  • “Draft a reply to the supplier confirming the new delivery date. Save it; don’t send it.”

FAQ

Gmail MCP questions

What is a Gmail MCP server?

A Gmail MCP server exposes your Gmail mailbox to AI assistants through the Model Context Protocol, so tools like Claude, ChatGPT, or Cursor can list, search, and read your email instead of you copying it into the chat. Automata is one that connects over IMAP and limits each token to the folders you choose.

Do Claude and ChatGPT already have a Gmail connector?

Yes. Both have official Gmail connectors that sign in with your Google account. If you only use Claude.ai, Claude Desktop, or ChatGPT and want Gmail with no extra setup, start there. Automata fits when you use another MCP client, want to limit the AI to certain labels, need it read-only, or want the same setup for a non-Gmail mailbox.

Does Automata use the Gmail API or Google OAuth?

No. Automata signs in to Gmail over IMAP with an app password. You do not create a Google Cloud project or approve an OAuth app. An app password needs 2-Step Verification on your Google account, and you can revoke it on its own at any time.

Can the AI send email from my Gmail?

No. The connection has no SMTP credentials, so it cannot send, and it cannot delete, move, or mark mail either. An optional tool saves an unsent plain-text draft in your Drafts folder for you to review and send yourself. A new email token starts with it switched off.

How do Gmail labels work with folder scope?

Over IMAP, each Gmail label appears as a folder, and a connector token is limited to the folders you pick. An email with several labels is listed once, and a token reaches it only through a label it allows. All Mail, Spam, and Trash are not synced.

Does it work with Google Workspace accounts?

On Google Workspace, it works only if your admin allows IMAP and you can create an app password. Otherwise, use Claude's or ChatGPT's official Gmail connector.

Does it work with Outlook or Microsoft 365?

No. Microsoft 365 and Outlook.com no longer accept passwords over IMAP and require OAuth, which this connection does not support. Use the official Microsoft connector in your AI client for those.

Will the AI mark my emails as read?

No. Automata opens folders read-only and fetches bodies without setting the read flag, so reading through the AI does not change your inbox in Gmail.

Does Automata store my email?

It keeps a small header index (sender, recipients, subject, date, read and flagged state, and attachment names), about 1 KB per email, and deletes it with the connection. Bodies and attachments stay in Gmail and are fetched only when a tool asks for them.

Is the Automata Gmail MCP free?

Yes. Automata is MIT licensed and free to self-host. The hosted version at mcp.getautomata.app is free for one connection; Pro is $19/month after a 7-day trial.

Give your AI the labels it needs, not your whole inbox.

Connect Gmail over IMAP in minutes. The same token model also covers WhatsApp, Telegram, and PostgreSQL.