mcp-mail
📧 MCP Mail Tool - AI-powered email management tool | 基于 MCP 的智能邮件管理工具
claude mcp add --transport stdio shuakami-mcp-mail pythonw bridging_mail_mcp.py \ --env IMAP_HOST="IMAP server host (e.g., imap.example.com)" \ --env IMAP_PASS="IMAP account password or app-specific password" \ --env IMAP_PORT="IMAP server port (e.g., 993)" \ --env IMAP_USER="IMAP account username" \ --env SMTP_HOST="SMTP server host (e.g., smtp.example.com)" \ --env SMTP_PASS="SMTP authentication password or app-specific password" \ --env SMTP_PORT="SMTP server port (e.g., 465 for SSL)" \ --env SMTP_USER="SMTP authentication username" \ --env IMAP_SECURE="true or false (use SSL/TLS)" \ --env SMTP_SECURE="true or false (use SSL/TLS)" \ --env DEFAULT_FROM_NAME="Default sender name" \ --env DEFAULT_FROM_EMAIL="Default sender email address"
How to use
This MCP server exposes a Mail MCP tool that enables AI models to perform common email operations via a standardized Model Context Protocol interface. It supports sending emails (including HTML content and attachments), reading inboxes and folders, performing advanced searches, managing messages (read/unread, delete, move), handling attachments (listing, downloading, previewing), and managing contacts. With a simple natural-language prompt, the AI can instruct the server to list folders, fetch recent messages, search by keywords or date ranges, or send emails to specified recipients. The underlying implementation uses a Python bridge that communicates with your SMTP/IMAP servers, exposing consistent MCP actions for the AI to consume. When integrated into your Cursor/MCP workflow, you can request tasks like listing mail folders, showing the latest mails, sending test messages, searching for invoices, viewing message details, or downloading attachments, all through natural language commands mapped to the MCP endpoints.
How to install
Prerequisites:
- Python 3.11 or newer installed and available on PATH
- Git installed
- Optional: Node.js and npm if you plan to clone/build additional tooling (not required for the Python bridge)
Installation steps:
- Clone the repository:
git clone https://github.com/shuakami/mcp-mail.git
cd mcp-mail
- Install Python dependencies (if any are defined; otherwise ensure Python is accessible):
# If a requirements.txt exists, install it
pip install -r requirements.txt
- Prepare environment variables for SMTP/IMAP (example shown in the repo's Windows/macOS/Linux guidance). You can create a dotenv file or export variables in your shell, for example:
export SMTP_HOST="smtp.yourprovider.com"
export SMTP_PORT="465"
export SMTP_SECURE="true"
export SMTP_USER="your-email@example.com"
export SMTP_PASS="your-app-password"
export IMAP_HOST="imap.yourprovider.com"
export IMAP_PORT="993"
export IMAP_SECURE="true"
export IMAP_USER="your-email@example.com"
export IMAP_PASS="your-app-password"
export DEFAULT_FROM_NAME="Your Name"
export DEFAULT_FROM_EMAIL="your-email@example.com"
- Run the MCP bridge (the Python script referenced in the config):
# From the repository root, using the same Python interpreter that your environment uses
python bridging_mail_mcp.py
- If you prefer Cursor integration, configure your MCP in Cursor to point to the bridging_mail_mcp.py script as shown in the README (Windows/macOS/Linux examples).
Additional notes
Notes and tips:
- Ensure your SMTP/IMAP credentials are kept secure and not committed to version control.
- The bridge runs locally and handles all mail operations; no data is forwarded to third-party servers beyond your own SMTP/IMAP providers.
- If you encounter connection errors, verify firewall settings and that the SMTP/IMAP servers accept connections from your environment.
- For Windows, macOS, and Linux, follow the exact path conventions in the README when configuring Cursor MCP, adjusting the user paths to match your environment.
- If you need to change default sender information, update DEFAULT_FROM_NAME and DEFAULT_FROM_EMAIL in the environment variables.
- The MCP interface is designed to be human-readable; when testing, try simple prompts like "list folders" or "send a test email to someone@example.com" to verify basic functionality.
Related MCP Servers
bytebot
Bytebot is a self-hosted AI desktop agent that automates computer tasks through natural language commands, operating within a containerized Linux desktop environment.
cursor-history
MCP server for browsing, searching, and exporting Cursor AI chat history.
mcpx
Token-efficient MCP client: TypeScript schemas instead of JSON, LLM-friendly syntax, batch calls, TOON output. Built for Claude/GPT automations.
outlook
MCP server for Microsoft Office 365 Outlook – email, calendar & SharePoint integration for Claude, ChatGPT, and AI assistants via Microsoft Graph API
github-to
Convert GitHub repositories to MCP servers automatically. Extract tools from OpenAPI, GraphQL & REST APIs for Claude Desktop, Cursor, Windsurf, Cline & VS Code. AI-powered code generation creates type-safe TypeScript/Python MCP servers. Zero config setup - just paste a repo URL. Built for AI assistants & LLM tool integration.
discord
Manage your entire Discord server from Claude Code, Claude Desktop, Cursor, or Windsurf via MCP. 134 admin tools across 20 categories. Interactive setup wizard included.