IMAP/SMTP email access for Claude Code. Read, search, send, reply, forward, and manage emails directly from Claude.
This plugin requires configuration values that are prompted when the plugin is enabled. Sensitive values are stored in your system keychain.
imap_hostIMAP server hostname (e.g., imap.gmail.com)
${user_config.imap_host}imap_portIMAP server port
${user_config.imap_port}mail_fromFrom address for outgoing mail (defaults to email address)
${user_config.mail_from}mail_userAdmin access level
Server config contains admin-level keywords
Requires secrets
Needs API keys or credentials to function
Own this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimOwn this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimBased on adoption, maintenance, documentation, and repository signals. Not a security audit or endorsement.
Email account username / address
${user_config.mail_user}smtp_hostSMTP server hostname (e.g., smtp.gmail.com)
${user_config.smtp_host}smtp_portSMTP server port
${user_config.smtp_port}mail_passwordEmail account password or app-specific password
${user_config.mail_password}An MCP (Model Context Protocol) server that gives Claude access to your email via IMAP and SMTP. Read, search, send, reply, forward, and manage messages directly from Claude Code or any MCP-compatible client.
First, add the marketplace source:
/plugin marketplace add philippgehrig/mail-mcp
Then install the plugin:
/plugin install mail@mail-mcp
You'll be prompted to configure your IMAP/SMTP credentials on first use.
Requires Node.js >= 20 and an email account with IMAP/SMTP access.
git clone https://github.com/philippgehrig/mail-mcp.git
cd mail-mcp
npm install
npm run build
Then register with Claude Code:
claude mcp add-json --scope user mail '{
"command": "node",
"args": ["/path/to/mail-mcp/dist/index.js"],
"env": {
"IMAP_HOST": "imap.example.com",
"SMTP_HOST": "smtp.example.com",
"MAIL_USER": "[email protected]",
"MAIL_PASSWORD": "your-app-password",
"MAIL_FROM": "[email protected]"
}
}'
| Variable | Required | Default | Description |
|---|---|---|---|
IMAP_HOST | Yes | — | IMAP server hostname |
IMAP_PORT | No | 993 | IMAP server port |
SMTP_HOST | Yes | — | SMTP server hostname |
SMTP_PORT | No | 587 | SMTP server port |
MAIL_USER | Yes | — | Email account username |
MAIL_PASSWORD | Yes | — | Email account password |
MAIL_FROM | No | MAIL_USER | From address for outgoing mail |
SENT_FOLDER | No | send-via-mcp | Folder name to append sent messages to |
TRASH_FOLDER | No | auto-detect | Trash folder name (auto-detects via SPECIAL-USE) |
ATTACHMENTS_DIR | No | — | Directory to allow local file attachments from |
ALLOW_UNRESTRICTED_ATTACHMENTS | No | false | Set true to allow local file attachments from any path |
| Tool | Description |
|---|---|
list_folders | List all mailbox folders with message counts |
list_messages | List messages in a folder (paginated, newest first) |
search_messages | Search by from, to, subject, body, date, flags |
get_message | Read full message content (prefers plain text) |
get_attachment | Download an attachment by MIME part ID |
send_message | Compose and send a new email |
reply_message | Reply to an email (supports reply-all) |
forward_message | Forward an email with original attachments |
move_message | Move a message to a different folder |
delete_message | Move to Trash (or permanently delete if already in Trash) |
mark_message | Set/unset read and flagged status |
Once configured, you can ask Claude things like:
Local file attachments: By default, attaching local files via send_message is disabled. To enable:
ATTACHMENTS_DIR to a specific directory — only files within that directory (after symlink resolution) can be attachedALLOW_UNRESTRICTED_ATTACHMENTS=true to attach files from any pathThis restriction applies to local file paths passed to send_message. Forwarding emails (forward_message) re-attaches the original message's attachments from the mail server directly — no local file access is involved.
The server validates local attachment paths against directory traversal attacks by resolving symlinks and checking the real path is within the allowed directory.
Credentials: Use app-specific passwords where possible. Never commit credentials to version control — use environment variables or a secrets manager.
Transport: IMAP uses implicit TLS on port 993 (default) or plain connections on other ports. SMTP uses implicit TLS on port 465, or opportunistic STARTTLS on port 587 (default) — the server does not enforce TLS on 587, so ensure your provider supports STARTTLS.
# Start the server in development mode
npm run dev
# Run unit tests
npm test
# Run integration tests (requires Docker)
docker compose -f tests/integration/docker-compose.yml up -d
npm run test:integration
docker compose -f tests/integration/docker-compose.yml down
# Type check
npx tsc --noEmit
npm test && npx tsc --noEmit)mainMIT
npx claudepluginhub philippgehrig/mail-mcp --plugin mailMural board management for Claude Code. Extract, update, create, and query Mural boards.
Memory compression system for Claude Code - persist context across sessions
Standalone image generation plugin using Nano Banana MCP server. Generates and edits images, icons, diagrams, patterns, and visual assets via Gemini image models. No Gemini CLI dependency required.
Permanent coding companion for Claude Code — survives any update. MCP-based terminal pet with ASCII art, stats, reactions, and personality.
MCP server that saves 98% of your context window with session continuity. Sandboxed code execution in 11 languages, FTS5 knowledge base with BM25 ranking, and automatic state restore across compactions.
Full video production pipeline for Remotion — gives Claude eyes (video analysis), voice (TTS/voiceover), ears (music/SFX), stock footage, AI image/video generation, TikTok captions, 3D content, and more. By Dojo Coding Labs.