📧 MCP Mail Tool - AI-powered email management tool | 基于 MCP 的智能邮件管理工具
Configuration
View docs{
"mcpServers": {
"shuakami-mcp-mail": {
"command": "pythonw",
"args": [
"bridging_mail_mcp.py"
],
"env": {
"IMAP_HOST": "<YOUR_IMAP_HOST>",
"IMAP_PASS": "<YOUR_APP_SPECIFIC_PASSWORD>",
"IMAP_PORT": "<PORT>",
"IMAP_USER": "<YOUR_EMAIL>",
"SMTP_HOST": "<YOUR_SMTP_HOST>",
"SMTP_PASS": "<YOUR_APP_SPECIFIC_PASSWORD>",
"SMTP_PORT": "<PORT>",
"SMTP_USER": "<YOUR_EMAIL>",
"IMAP_SECURE": "true",
"SMTP_SECURE": "true",
"DEFAULT_FROM_NAME": "<YOUR_NAME>",
"DEFAULT_FROM_EMAIL": "<YOUR_EMAIL>"
}
}
}
}This Mail MCP Server lets an AI agent interact with an email service through a standardized MCP interface. It enables actions like sending emails, reading mail, and managing attachments or contacts without manual API calls or switching to an email client, making AI-assisted email workflows seamless and automated.
You connect your MCP-enabled client to the Mail MCP Server and start issuing natural language instructions. You can perform common email tasks such as listing folders, viewing the latest messages, sending messages, performing searches, and handling attachments. The server translates your requests into email client actions and returns human-friendly results that you can present to the user.
Prerequisites you need before installation are Node.js and npm, and Python 3.11 or newer if you plan to use the bridging script locally.
Install Smithery to enable automatic installation of Mail MCP Tool for your desired client.
Clone the project, install dependencies, and build the project locally.
Configure the MCP client to connect to the Mail MCP Server using a local stdio bridge and the required environment settings.
Start the client, restart the editor or runner if needed, and begin issuing email-related commands.
npx -y @smithery/cli install @shuakami/mcp-mail --client claude
```
```bash
git clone https://github.com/shuakami/mcp-mail.git
cd mcp-mail
npm install
npm run build
"""
```
```bash
# Windows Cursor configuration example (mcp.json)
```
```json
{
"mcpServers": {
"mail_mcp": {
"command": "pythonw",
"args": [
"C:/Users/你的用户名/mcp-mail/bridging_mail_mcp.py"
],
"env": {
"SMTP_HOST": "smtp.qq.com",
"SMTP_PORT": "465",
"SMTP_SECURE": "true",
"SMTP_USER": "[email protected]",
"SMTP_PASS": "your-app-specific-password",
"IMAP_HOST": "imap.qq.com",
"IMAP_PORT": "993",
"IMAP_SECURE": "true",
"IMAP_USER": "[email protected]",
"IMAP_PASS": "your-app-specific-password",
"DEFAULT_FROM_NAME": "Your Name",
"DEFAULT_FROM_EMAIL": "[email protected]"
}
}
}
}
```
```json
{
"mcpServers": {
"mail_mcp": {
"command": "pythonw",
"args": [
"/Users/你的用户名/mcp-mail/bridging_mail_mcp.py"
]
}
}
}
```
```json
{
"mcpServers": {
"mail_mcp": {
"command": "pythonw",
"args": [
"/home/你的用户名/mcp-mail/bridging_mail_mcp.py"
]
}
}
}Notes on configuration and usage follow in the next sections. You will configure a local bridge so the MCP client talks to your email service via the bridging script. The following environment variables are used to connect to your SMTP/IMAP servers and to set the default sender information. Ensure you provide valid credentials and adjust hostnames and ports to match your email provider.
All email operations are performed locally by the bridge script. No sensitive data is sent to external servers beyond your own email provider. Keep your credentials secure and avoid sharing your bridge configuration. Use strong application-specific passwords when required by your email service.
List your email folders, fetch the latest messages, search for emails containing a keyword, read a specific email by UID, download attachments, or manage sender/recipient contacts. You can also set read/unread status, move messages between folders, and extract contact information from history.
Send an email with plain text or HTML content and optional attachments.
Retrieve the list of mail folders in your account.
List emails within a folder with optional filtering and pagination.
Perform advanced searches across folders using keywords, dates, and sender/recipient filters.
Get detailed information for a specific email by UID.
Download an attachment from a specific email.
Mark one or more emails as read or unread.
Delete emails from a folder.
Move emails between folders.
Retrieve contact lists or search for contacts from email history.