# Gmail

Connects an AI agent to Gmail for searching, reading, sending, and managing mail. Useful for email-driven workflows and automation.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 12
- Author: domdomegg
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/domdomegg/gmail-mcp
- Updated: 2026-10-21
- HTML: https://affpapa.org/en/nevibecode/mcp/domdomegg-gmail

## What it does

This MCP server exposes Gmail actions to an AI client. It can search messages and threads, read and send mail, forward messages, create and send drafts, download attachments, update labels, archive mail, and move messages between trash states. It also includes filters, vacation replies, and bulk message operations.

The server sits between the MCP client and Google as an OAuth proxy. It forwards authorization and uses the bearer token for Gmail API calls, without keeping tokens or session state. You need Gmail API access, Google OAuth credentials, Node.js, and `npx`; setup cannot complete without `GOOGLE_CLIENT_ID` and `GOOGLE_CLIENT_SECRET`.

## Requirements
- Needs: Node.js (commands run via npx)
- Environment variables: `GOOGLE_ACCESS_TOKEN`, `MCP_TRANSPORT`, `GOOGLE_CLIENT_ID`, `GOOGLE_CLIENT_SECRET` — keys and tokens: ask the human for the values, never commit them or put them in shared files.
- Works with: Gmail

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add --env GOOGLE_ACCESS_TOKEN=<GOOGLE_ACCESS_TOKEN> --env MCP_TRANSPORT=<MCP_TRANSPORT> --env GOOGLE_CLIENT_ID=<GOOGLE_CLIENT_ID> --env GOOGLE_CLIENT_SECRET=<GOOGLE_CLIENT_SECRET> --transport stdio domdomegg-gmail -- npx -y gmail-mcp
```
Replace <…> with your own values

### Codex

**Platform CLI**
```bash
codex mcp add domdomegg-gmail --env GOOGLE_ACCESS_TOKEN=<GOOGLE_ACCESS_TOKEN> --env MCP_TRANSPORT=<MCP_TRANSPORT> --env GOOGLE_CLIENT_ID=<GOOGLE_CLIENT_ID> --env GOOGLE_CLIENT_SECRET=<GOOGLE_CLIENT_SECRET> -- npx -y gmail-mcp
```
Replace <…> with your own values

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "domdomegg-gmail": {
            "command": "npx",
            "args": [
                "-y",
                "gmail-mcp"
            ],
            "env": {
                "GOOGLE_ACCESS_TOKEN": "<GOOGLE_ACCESS_TOKEN>",
                "MCP_TRANSPORT": "<MCP_TRANSPORT>",
                "GOOGLE_CLIENT_ID": "<GOOGLE_CLIENT_ID>",
                "GOOGLE_CLIENT_SECRET": "<GOOGLE_CLIENT_SECRET>"
            }
        }
    }
}
```
Replace <…> with your own values

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "domdomegg-gmail": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "gmail-mcp"
            ],
            "env": {
                "GOOGLE_ACCESS_TOKEN": "<GOOGLE_ACCESS_TOKEN>",
                "MCP_TRANSPORT": "<MCP_TRANSPORT>",
                "GOOGLE_CLIENT_ID": "<GOOGLE_CLIENT_ID>",
                "GOOGLE_CLIENT_SECRET": "<GOOGLE_CLIENT_SECRET>"
            }
        }
    }
}
```
Replace <…> with your own values

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e GOOGLE_ACCESS_TOKEN=<GOOGLE_ACCESS_TOKEN> -e MCP_TRANSPORT=<MCP_TRANSPORT> -e GOOGLE_CLIENT_ID=<GOOGLE_CLIENT_ID> -e GOOGLE_CLIENT_SECRET=<GOOGLE_CLIENT_SECRET> domdomegg-gmail npx -y gmail-mcp
```
Replace <…> with your own values

## When to use it
- search a mailbox or thread
- read and forward an email
- create or send a draft
- archive messages and update labels
- download an email attachment

## Example prompts
- Find the Acme delivery email and tell me the tracking number.
- Draft a reply to the latest message in this thread.
- Locate last week's receipts and download their attachments.

## Similar
- [gws-gmail-reply](https://affpapa.org/en/nevibecode/skills/gws-gmail-reply.md) — skill · 35200 installs
- [gws-gmail-watch](https://affpapa.org/en/nevibecode/skills/gws-gmail-watch.md) — skill · 37200 installs
- [gmail-skill](https://affpapa.org/en/nevibecode/skills/gmail-skill.md) — skill · 3600 installs
- [gmail-mcp](https://affpapa.org/en/nevibecode/mcp/gmail-mcp.md) — MCP server · ★ 9
- [Multi-Account Gmail](https://affpapa.org/en/nevibecode/mcp/multi-account-gmail.md) — MCP server · ★ 5
- [FGAC.ai: Multiple Gmail Accounts, Google Sheets & Docs](https://affpapa.org/en/nevibecode/mcp/fgacai-multiple-gmail-accounts-google-sheets-docs.md) — MCP server

## Other versions with the same name
- [gmail · pulsemcp](https://affpapa.org/en/nevibecode/mcp/gmail.md) — ★ 81

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
