# multi-gmail-mcp

This MCP server connects multiple Gmail accounts to an AI client for search, replies, drafts, and mailbox labels. It fits chat-based email work.

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

## What it does

multi-gmail-mcp gives an agent access to several Gmail accounts at once. Its tools search mail with Gmail query syntax, fetch complete messages, send email, reply inside a thread, and save drafts. Mailbox actions include adding or removing labels, archiving messages, and changing read status.

The package exposes the `gmail-mcp` server and the `gmail-mcp-cli` account manager. OAuth tokens are kept in `~/.gmail-mcp-tokens.db` and refreshed automatically. The server uses stdio only, so it does not open a network port. Check Node.js >= 22.5.0 first; the server will not run without it.

Setup also needs a Google Cloud project with the Gmail API enabled, a desktop OAuth credential, and the scopes `gmail.readonly`, `gmail.send`, `gmail.modify`, and `gmail.labels`. Credentials can live in `~/.gmail-mcp-oauth.json` or be supplied through `GOOGLE_CLIENT_ID` and `GOOGLE_CLIENT_SECRET`.

## Requirements
- Needs: Node.js (commands run via npx)
- Environment variables: `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_CLIENT_ID=<GOOGLE_CLIENT_ID> --env GOOGLE_CLIENT_SECRET=<GOOGLE_CLIENT_SECRET> --transport stdio multi-gmail-mcp -- npx -y multi-gmail-mcp
```
Replace <…> with your own values

### Codex

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

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "multi-gmail-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "multi-gmail-mcp"
            ],
            "env": {
                "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": {
        "multi-gmail-mcp": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "multi-gmail-mcp"
            ],
            "env": {
                "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_CLIENT_ID=<GOOGLE_CLIENT_ID> -e GOOGLE_CLIENT_SECRET=<GOOGLE_CLIENT_SECRET> multi-gmail-mcp npx -y multi-gmail-mcp
```
Replace <…> with your own values

## When to use it
- search Gmail with native query syntax
- read complete email messages
- send mail from selected accounts
- reply within an existing thread
- archive messages and manage labels

## Example prompts
- List all authenticated Gmail accounts.
- Search `work@company.com` for unread messages received this week.
- Reply from my personal account and say that I will be there on Saturday.

## Similar
- [MCP Toolbox for Databases](https://affpapa.org/en/nevibecode/mcp/googleapis-mcp-toolbox-for-databases.md) — MCP server · ★ 16717
- [PostHog MCP Server](https://affpapa.org/en/nevibecode/mcp/posthog-mcp-server.md) — MCP server · ★ 40409
- [OpenWork MCP Gateway](https://affpapa.org/en/nevibecode/mcp/openwork-mcp-gateway.md) — MCP server · ★ 24242
- [Keploy](https://affpapa.org/en/nevibecode/mcp/keploy.md) — MCP server · ★ 18727
- [Nhost](https://affpapa.org/en/nevibecode/mcp/nhost.md) — MCP server · ★ 9366
- [basebalance.cloud — x402 RPC & MCP gateway](https://affpapa.org/en/nevibecode/mcp/basebalancecloud-x402-rpc-mcp-gateway.md) — MCP server · ★ 7506

---
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
