# Gmail MCP Server
An MCP server for Gmail supporting IMAP and POP3 protocols. Exposes tools to list, read, delete, and mark emails, move messages between folders (IMAP), and manage your inbox — all accessible from any MCP-compatible AI client.
## How It Works
The MCP server authenticates to Gmail using an App Password over IMAP or POP3. It maintains a persistent connection and exposes standard MCP tools for email operations. Because it connects over IMAP, your folders, labels, and threading are all accessible — the same view you see in Gmail.
MCP Client (Claude) ──stdio──▶ Gmail MCP Server (Node.js)
└── IMAP / POP3 ──▶ Gmail servers
└── Inbox / Folders
└── Labels
└── Threads## Screenshots
❯ gmail_list_emails folder=INBOX limit=5 ID FROM SUBJECT ────────────────────────────────────────────────── msg_001 sarah@design.co Q3 mockups msg_002 ci@github.com PR #2841 passed msg_003 newsletter@devweekly.io Dev Weekly #312 msg_004 noreply@stripe.com Invoice #INV-882 msg_005 team@linear.app Sprint review Fri
❯ gmail_get_email id=msg_001 From: sarah@design.co Subject: Q3 mockups Body: Hi! I've attached the Figma link... ❯ gmail_move_email id=msg_001 destination=Design/Review ✓ Moved to Design/Review ❯ gmail_mark_email id=msg_001 read=true ✓ Marked as read
## Features
- +IMAP and POP3 support
- +List, read, delete emails
- +Mark read/unread
- +Move emails between folders (IMAP)
- +No send capability — read-focused
## vs. The Field
| Feature | Gmail MCP Server | Direct Gmail API | Zapier Gmail |
|---|---|---|---|
| MCP protocol native | ✓ | ✗ | ✗ |
| IMAP + POP3 | ✓ | ✗ | ✓ |
| Claude Code integration | ✓ | ✗ | ✗ |
| Free / open source | ✓ | free | paid |
| Zero OAuth setup | ✓ (App Password) | ✗ | ✓ |
## Installation
Enable IMAP in Gmail
Go to Gmail Settings → See all settings → Forwarding and POP/IMAP → Enable IMAP.
Create an App Password
Google Account → Security → 2-Step Verification → App passwords. Generate one for 'Mail'.
⚠ You must have 2FA enabled on your Google account.
Install
No build step required.
npx -y @web4w3/install gmail
Add to Claude config
Pass your Gmail address and App Password as environment variables.
{
"mcpServers": {
"gmail": {
"command": "npx",
"args": ["-y", "@web4w3/install", "gmail"],
"env": {
"GMAIL_USER": "you@gmail.com",
"GMAIL_APP_PASSWORD": "xxxx xxxx xxxx xxxx"
}
}
}
}