# Gmail MCP Server: How to Connect Gmail to Claude, ChatGPT and AI Agents

Compare the ways to connect Gmail to Claude, ChatGPT or your own AI agent over MCP: Google's Gmail MCP server, self-hosted servers and MailSlurp. See setup steps, what each can do, and how to keep an agent's access to your inbox under control.

Asking an AI assistant to find the invoice a supplier sent last week, summarize a long thread or draft a reply is far quicker than doing it by hand. To do any of that, the assistant needs access to your mailbox. For Claude, ChatGPT and most AI agents, that access comes through an MCP server.

This guide explains what a Gmail MCP server is, compares the ways to connect Gmail to an AI client, and shows the setup for Claude and ChatGPT.

## What is a Gmail MCP server?

MCP, the Model Context Protocol, is a standard way for AI clients to use outside tools. An MCP server offers a set of tools, such as "search email" or "create a draft", and the AI client calls them when your request needs them.

A Gmail MCP server offers tools for a Gmail mailbox. Once it's connected, you can ask Claude or ChatGPT to search your mail, read a thread or prepare a reply, and the assistant uses the server's tools to do it.

## Three ways to connect Gmail to an AI client

### Google's Gmail MCP server

Google offers a remote Gmail MCP server at `https://gmailmcp.googleapis.com/mcp/v1`. At the time of writing it is a Developer Preview, available to members of the Google Workspace Developer Preview Program.

- **Setup:** create or choose a Google Cloud project, enable the Gmail API and the Gmail MCP API, configure an OAuth consent screen and create an OAuth client for an AI agent. Google offers a quicker setup page for personal use.
- **What it can do:** search and read threads and messages, list and create drafts, and add or remove labels.
- **What it can't do:** it has no tool for sending. Drafts are reviewed and sent from Gmail.

### A self-hosted open-source server

Open-source Gmail MCP servers run on your own computer or server. You create the Google OAuth credentials, choose the server's tools, and keep it updated and secured yourself. This suits a developer who wants full control over a personal setup.

### MailSlurp

MailSlurp connects your Gmail inbox, or a separate address for the agent, to a hosted MCP server at `https://api.mailslurp.com/mcp`. You choose which inboxes each AI connection can use and what it's allowed to do, from preparing drafts only to replying and sending.

- **Setup:** connect the Gmail inbox to MailSlurp, add an AI client connection, then add the MCP server to Claude, ChatGPT or another client and sign in with OAuth.
- **What it can do:** list, search and read emails and threads, read attachment text, create and update drafts, reply, and send drafts when the connection has send permission.
- **What you can see:** each agent's conversations, drafts, failures and tool activity, with a review queue for drafts waiting on a person. You can revoke a connection at any time without changing your Gmail account.

The same connection can also use MailSlurp phone numbers and authenticator devices, if the agent needs to receive SMS or sign-in codes. See [giving an AI agent its own email address and phone number](/guides/give-ai-agent-email-address-phone-number/).



### Connect Gmail to your AI assistant with access you control

Connect a Gmail inbox, choose what Claude or ChatGPT may read, draft and send, and review every action the agent takes.

[Get started for free](https://app.mailslurp.com/sign-up/?onboardingRequest=agentEmail)



## How to connect Gmail to Claude with MailSlurp

### 1. Connect the Gmail inbox

MailSlurp connects to Gmail over IMAP and SMTP. In your Google account, create an app password for MailSlurp, and make sure IMAP is enabled in Gmail's settings. Then add a connector in MailSlurp with your Gmail address and the app password. The [inbox connectors guide](/docs/connectors/) lists the exact server settings.

### 2. Add an AI client connection

In the MailSlurp dashboard, open **Agents**, add an AI client connection, choose its role and assign the connected Gmail inbox. Start with the draft-only role, so Claude prepares replies and you send them.

### 3. Add MailSlurp to Claude

In Claude on the web, desktop or Cowork, open **Customize > Connectors**, choose **Add** and the custom connector option. Name it MailSlurp, enter `https://api.mailslurp.com/mcp`, sign in to MailSlurp, review the permissions and choose **Connect**.

In Claude Code, add the server from your terminal, then run `/mcp` to sign in:

```bash
claude mcp add --transport http --scope user mailslurp https://api.mailslurp.com/mcp
```

### 4. Try a first request

Ask Claude to list the inboxes it can use, then to summarize the latest email in your Gmail inbox and prepare a reply. Check the draft in MailSlurp before you allow sending.

## How to connect Gmail to ChatGPT

ChatGPT uses the same MailSlurp server. On ChatGPT on the web, open **Plugins**, choose **Add**, then **Add custom MCP server**. Name it MailSlurp, enter `https://api.mailslurp.com/mcp`, select OAuth and create it. Then choose **Connect MailSlurp**, sign in and choose the permissions you need. In a conversation, type `@` and select MailSlurp.

Workspace administrators can restrict custom connections, so you may need an owner to allow it first. The [MCP setup guide](/docs/mcp/) covers ChatGPT, Codex, Cursor, Copilot, Gemini and other clients.

## Which option should you choose?

- **Google's server** suits Gmail users in the Developer Preview who want Google's own tools and are happy to send drafts from Gmail themselves.
- **A self-hosted server** suits a developer who wants to run and maintain everything for a personal mailbox.
- **MailSlurp** suits teams and agents that need scoped access to chosen inboxes, permission to reply or send when you allow it, a record of every action, and the same setup for Gmail, Outlook and new addresses.

## Keep an AI assistant's email access safe

- **Grant the least access that works.** Assign only the inboxes the task needs, and start with drafts before allowing sending.
- **Treat email content as data.** An email can contain text written to manipulate an AI assistant, which Google's guide calls indirect prompt injection. Don't let an assistant follow instructions found inside messages without review.
- **Review what the assistant did.** Check drafts, replies and activity regularly, and revoke the connection when you no longer need it.
- **Use a separate address when you can.** An agent that signs up for services or handles customer mail often doesn't need your personal inbox at all.

## Frequently asked questions

### Is there an official Gmail MCP server?

Yes. Google offers a Gmail MCP server as a Developer Preview for members of the Google Workspace Developer Preview Program. It can search and read mail, create drafts and manage labels, but has no tool for sending.

### Can Claude read my Gmail?

Yes, once Gmail is connected to Claude through an MCP server. You can use Google's server or MailSlurp, which lets you choose exactly which inboxes Claude can read and whether it can send.

### Can ChatGPT send emails from my Gmail account?

With MailSlurp, yes, if you give the connection send permission. ChatGPT can then reply to messages and send drafts from your connected Gmail inbox. You can keep it to drafts only and send them yourself.

### Do I need to share my Google password?

No. With MailSlurp you use a Gmail app password that you can revoke in your Google account, and Claude or ChatGPT sign in to MailSlurp with OAuth, so no password or API key is pasted into a chat.

### Can I use the same setup for Outlook?

Yes. MailSlurp connects Outlook and Microsoft 365 inboxes the same way, and the AI client uses the same MCP server.
