Add it to Claude Code
claude mcp add -e "EMAIL_CREDENTIALS=${EMAIL_CREDENTIALS}" better-email -- npx -y @n24q02m/better-email-mcp@latestEMAIL_CREDENTIALS+ 1 optionalMake your agent remember this setup
better-email's config, env vars, and the gotchas you hit — recalled in every future Claude Code, Cursor, and Codex session.
npx conare@latestFree · one command · indexes the sessions already on disk. Set up in the browser instead →
What it does
- Multi-account support for Gmail, Outlook, Yahoo, iCloud, and custom IMAP
- App Password support for simplified authentication
- 5 composite tools covering search, read, send, reply, and organization
- Auto-discovery of provider settings based on email address
- Thread-aware replies that maintain In-Reply-To and References headers
Tools 5
messagesSearch, read, and organize emails using actions like search, read, mark_read, mark_unread, flag, unflag, move, archive, and trash.foldersList mailbox folders.attachmentsList and download email attachments.sendCompose, reply, and forward emails.helpGet full documentation for any tool.Environment Variables
EMAIL_CREDENTIALSrequiredEmail credentials ([email protected]:app-password), comma-separated for multi-account.OUTLOOK_CLIENT_IDCustom Azure AD client ID for Outlook.Try it
Original README from n24q02m/better-email-mcp
Better Email MCP
IMAP/SMTP email server for AI agents -- 5 composite tools with multi-account and auto-discovery
<a href="https://glama.ai/mcp/servers/n24q02m/better-email-mcp"> </a>Features
- Multi-account support -- manage 6+ email accounts (Gmail, Outlook, Yahoo, iCloud, Zoho, ProtonMail, custom IMAP)
- App Passwords -- no OAuth2 setup required for most providers; clone and run in 1 minute
- 5 composite tools with 15 actions -- search, read, send, reply, forward, organize in single calls
- Auto-discovery -- provider settings detected from email address, custom IMAP host supported
- Thread-aware -- reply/forward maintains In-Reply-To and References headers
- Tiered token optimization -- compressed descriptions + on-demand
helptool + MCP Resources
Quick Start
Claude Code Plugin (Recommended)
claude plugin add n24q02m/better-email-mcp
After install, set your credentials: claude config set mcpServers.better-email-mcp.env.EMAIL_CREDENTIALS "[email protected]:app-password". See Prerequisites below for how to create App Passwords.
MCP Server
Prerequisites: Create App Passwords (NOT your regular password):
- Gmail: Enable 2FA, then https://myaccount.google.com/apppasswords
- Yahoo: Enable 2FA, then https://login.yahoo.com/account/security/app-passwords
- iCloud: https://appleid.apple.com > Sign-In and Security > App-Specific Passwords
- Outlook/Hotmail/Live: OAuth2 built-in (server guides you on first use)
Option 1: npx
{
"mcpServers": {
"better-email": {
"command": "npx",
"args": ["-y", "@n24q02m/better-email-mcp@latest"],
"env": {
"EMAIL_CREDENTIALS": "[email protected]:abcd-efgh-ijkl-mnop"
}
}
}
}
Other runners: bun x, pnpm dlx, yarn dlx also work.
Option 2: Docker
{
"mcpServers": {
"better-email": {
"command": "docker",
"args": [
"run", "-i", "--rm",
"-e", "EMAIL_CREDENTIALS",
"n24q02m/better-email-mcp:latest"
],
"env": {
"EMAIL_CREDENTIALS": "[email protected]:abcd-efgh-ijkl-mnop"
}
}
}
}
Multiple Accounts
[email protected]:pass1,[email protected]:pass2,[email protected]:pass3
Custom IMAP Host
[email protected]:password:imap.custom.com
Tools
| Tool | Actions | Description |
|---|---|---|
messages |
search, read, mark_read, mark_unread, flag, unflag, move, archive, trash |
Search, read, and organize emails |
folders |
list |
List mailbox folders |
attachments |
list, download |
List and download email attachments |
send |
new, reply, forward |
Compose, reply, and forward emails |
help |
- | Get full documentation for any tool |
Search Query Language
| Query | Description |
|---|---|
UNREAD |
Unread emails |
FLAGGED |
Starred emails |
SINCE 2024-01-01 |
Emails after date |
FROM [email protected] |
Emails from sender |
SUBJECT meeting |
Emails matching subject |
UNREAD SINCE 2024-06-01 |
Compound filter |
Configuration
| Variable | Required | Default | Description |
|---|---|---|---|
EMAIL_CREDENTIALS |
Yes | - | Email credentials ([email protected]:app-password, comma-separated for multi-account) |
OUTLOOK_CLIENT_ID |
No | - | Custom Azure AD client ID |