A lightweight Model Context Protocol (MCP) server that provides IMAP and SMTP email functionality for AI assistants like Claude in Cursor IDE. Built with TypeScript and optimized for easy deployment via npm/npx.
Config is the same across clients — only the file and path differ.
{
"mcpServers": {
"mcp-mail-server": {
"env": {
"IMAP_HOST": "your-imap-server.com",
"IMAP_PORT": "993",
"SMTP_HOST": "your-smtp-server.com",
"SMTP_PORT": "465",
"EMAIL_PASS": "your-password",
"EMAIL_USER": "your-email@domain.com",
"IMAP_SECURE": "true",
"SMTP_SECURE": "true"
},
"args": [
"-y",
"mcp-mail-server"
],
"command": "npx"
}
}
}Are you the author?
Add this badge to your README to show your security score and help users find safe servers.
A Model Context Protocol server for IMAP/SMTP email operations with Claude, Cursor, and other AI assistants.
Run this in your terminal to verify the server starts. Then let us know if it worked — your result helps other developers.
npx -y 'mcp-mail-server' 2>&1 | head -1 && echo "✓ Server started successfully"
After testing, let us know if it worked:
Five weighted categories — click any category to see the underlying evidence.
No known CVEs.
Checked mcp-mail-server against OSV.dev.
Click any tool to inspect its schema.
Be the first to review
Have you used this server?
Share your experience — it helps other developers decide.
Sign in to write a review.
Others in communication
Asynchronous coordination layer for AI coding agents: identities, inboxes, searchable threads, and advisory file leases over FastMCP + Git + SQLite
An MCP server that securely interfaces with your iMessage database via the Model Context Protocol (MCP), allowing LLMs to query and analyze iMessage conversations. It includes robust phone number validation, attachment processing, contact management, group chat handling, and full support for sending and receiving messages.
Email & SMS infrastructure for AI agents — send and receive real email and text messages programmatically
A Model Context Protocol (MCP) server for interacting with Microsoft 365 and Office services through the Graph API
MCP Security Weekly
Get CVE alerts and security updates for Mcp Mail Server and similar servers.
Start a conversation
Ask a question, share a tip, or report an issue.
Sign in to join the discussion.
Language: English | 中文
A Model Context Protocol server for IMAP/SMTP email operations with Claude, Cursor, and other AI assistants.
Fixed
search() wrapping criteria in an extra array, breaking compound search conditionsdeleteMessage() failing silently when the mailbox was opened in read-only modegetRecentMessages() misusing the IMAP RECENT flag; now fetches latest N messages by UIDgetRecentMessages() / getUnseenMessages() relying on leftover mailbox state from previous operationscleanReplySubject() only stripping one Re: prefix layer, causing false negatives in unreplied detectionnew Date() parsing across platforms; changed to ISO 8601ensureIMAPConnection() having no timeout while waiting for concurrent initializationsaveSentMessage() always returning sentFolderSaved: true even when save failedhandleGetMessages() / handleDeleteMessage() relying on currentBox state to locate messagesreply_to_email writing literal "undefined" into the body when text is emptyAdded
inboxOnly parameter to restrict search to INBOX onlyImproved
ensureSMTPConnection() now has concurrency guard with 30-second timeout, consistent with IMAP\Sent special-use attribute with result caching, compatible with all mail providerssaveMessageToFolder() simplified; skips saving if no sent folder is foundslice(-limit) to fetch the newest messages first, preventing empty results after date filteringFor the full version history, see CHANGELOG.md.
npm install -g mcp-mail-serverAdd to your claude_desktop_config.json:
{
"mcpServers": {
"mcp-mail-server": {
"command": "npx",
"args": ["-y", "mcp-mail-server"],
"env": {
"IMAP_HOST": "your-imap-server.com",
"IMAP_PORT": "993",
"IMAP_SECURE": "true",
"SMTP_HOST": "your-smtp-server.com",
"SMTP_PORT": "465",
"SMTP_SECURE": "true",
"EMAIL_USER": "your-email@domain.com",
"EMAIL_PASS": "your-password"
}
}
}
}
Add to your Cursor MCP settings:
{
"mcpServers": {
"mcp-mail-server": {
"command": "npx",
"args": ["-y", "mcp-mail-server"],
"env": {
"IMAP_HOST": "your-imap-server.com",
"IMAP_PORT": "993",
"IMAP_SECURE": "true",
"SMTP_HOST": "your-smtp-server.com",
"SMTP_PORT": "465",
"SMTP_SECURE": "true",
"EMA
... [View full README on GitHub](https://github.com/yunfeizhu/mcp-mail-server#readme)