better-email-mcp — Claude Code MCP server: install & features
Connects email accounts via IMAP and SMTP to AI agents. Useful when you need to read incoming mail, reply within threads, and manage attachments directly in your agent workspace.
claude mcp add better-email-mcp -e EMAIL_CREDENTIALS=<EMAIL_CREDENTIALS> -- npx -y @n24q02m/better-email-mcpWhat better-email-mcp does
The server links your coding agent to email providers over IMAP and SMTP. It provides 4 composite tools with 23 distinct actions for reading messages, sending replies, organizing mailboxes, and searching. Provider parameters for services like Gmail, iCloud, and Yahoo resolve automatically from the address domain.
Setup relies on app-specific passwords rather than regular account passwords. Because standard web passwords fail security checks for direct IMAP access, you must generate an app password and feed it via the EMAIL_CREDENTIALS variable. Separate multiple inboxes with commas.
Execution runs in standard input-output mode by default, alongside an opt-in HTTP setup with OAuth 2.1. Outgoing replies and forwards retain message threading by preserving In-Reply-To and References headers.
What it helps with
- inspect mailboxes and read unread messages across accounts
- send thread-aware email replies with proper message headers
- connect several email providers using a single credentials string
- search message history and handle file attachments from the prompt
Example prompts for the agent
- Check unread emails in [email protected] received today.
- Reply to the latest message in this thread and keep the conversation headers intact.
- Search the inbox for invoices sent last month and list the attachments.
How to install better-email-mcp
Platform CLI
claude mcp add better-email-mcp -e EMAIL_CREDENTIALS=<EMAIL_CREDENTIALS> -- npx -y @n24q02m/better-email-mcpReplace <…> with your own values
Platform CLI
codex mcp add better-email-mcp --env EMAIL_CREDENTIALS=<EMAIL_CREDENTIALS> -- npx -y @n24q02m/better-email-mcpReplace <…> with your own values
Config file
{
"mcpServers": {
"better-email-mcp": {
"command": "npx",
"args": [
"-y",
"@n24q02m/better-email-mcp"
],
"env": {
"EMAIL_CREDENTIALS": "<EMAIL_CREDENTIALS>"
}
}
}
}Replace <…> with your own values
Config file
{
"servers": {
"better-email-mcp": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@n24q02m/better-email-mcp"
],
"env": {
"EMAIL_CREDENTIALS": "<EMAIL_CREDENTIALS>"
}
}
}
}Replace <…> with your own values
Platform CLI
gemini mcp add -e EMAIL_CREDENTIALS=<EMAIL_CREDENTIALS> better-email-mcp npx -y @n24q02m/better-email-mcpReplace <…> with your own values
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about better-email-mcp
How do I install better-email-mcp in Claude Code?
Run claude mcp add better-email-mcp -e EMAIL_CREDENTIALS=<EMAIL_CREDENTIALS> -- npx -y @n24q02m/better-email-mcp. Replace <EMAIL_CREDENTIALS> with your email address and app password.
What does better-email-mcp do?
It exposes email operations to your agent, handling IMAP searches, message sending via SMTP, and folder management across multiple mailboxes.
Does this server require OAuth configuration?
Most providers work directly with an app password passed into EMAIL_CREDENTIALS, avoiding complex OAuth app setup.