Email SMTP MCP Server
MCP server that enables AI assistants to send emails via SMTP, supporting both plain text and HTML emails with attachments, CC/BCC functionality, and sending to multiple recipients.
Get this MCP server
MCP server that enables AI assistants to send emails via SMTP, supporting both plain text and HTML emails with attachments, CC/BCC functionality, and sending to multiple recipients.
Installation
From Source Code
# Install uv (Python package manager)
curl -LsSf https://astral.sh/uv/install.sh | sh
# Restart your terminal or run:
source ~/.bashrc
# Install project dependencies
cd email-mcp-server
uv sync
Configuration
Claude Desktop/Cursor
{
"mcpServers": {
"mcp-server": {
"command": "uv",
"args": [
"--directory",
"path/to/the/app/email-mcp-server",
"run",
"main.py"
],
"env": {
"SMTP_HOST": "",
"SMTP_PORT": "",
"SMTP_SECURE": "",
"SMTP_USER": "",
"SMTP_FROM": "",
"SMTP_PASS": ""
}
}
}
}
Gmail Configuration
"env": {
"SMTP_HOST": "smtp.gmail.com",
"SMTP_PORT": "587",
"SMTP_SECURE": "false",
"SMTP_USER": "your-email@gmail.com",
"SMTP_FROM": "your-email@gmail.com",
"SMTP_PASS": "your-app-password"
}
Outlook Configuration
"env": {
"SMTP_HOST": "smtp-mail.outlook.com",
"SMTP_PORT": "587",
"SMTP_SECURE": "false",
"SMTP_USER": "your-email@outlook.com",
"SMTP_FROM": "your-email@outlook.com",
"SMTP_PASS": "your-password"
}
Available Tools
| Tool | Description |
|---|---|
send_email |
Quick email sending using environment variable configuration - specify recipient, subject, and message text with... |
send_custom_email |
Send emails with full control, including multiple recipients with CC/BCC, file attachments, HTML formatting... |
test_smtp_connection_tool |
Verify email settings and SMTP connection before sending important messages |
Features
- Send both plain text and HTML emails
- Attach files and documents
- Send to multiple recipients with CC/BCC
- Verify email configuration functionality
- Support for Gmail, Outlook, and other email providers
- Override SMTP settings for individual emails
- SMTP connection testing functionality
Environment Variables
Required
SMTP_HOST- Your mail serverSMTP_PORT- Server portSMTP_SECURE- Use SSL (true/false)SMTP_USER- Your usernameSMTP_FROM- Sender addressSMTP_PASS- Your password
Usage Examples
Send an email to john@company.com saying the meeting is tomorrow at 2 PM
Send an HTML email to team@company.com with subject 'Weekly Update' and create a nice formatted message about this week's progress
Test the email connection to make sure it's working
Send a custom email to the team about the project update. Send to team@company.com, CC manager@company.com, and attach the project report
Notes
For Gmail, you must enable two-factor authentication and use app passwords instead of regular passwords. The server supports many email providers - most use port 587 with STARTTLS or port 465 with SSL. Test commands are available: 'uv run python test_email.py' to verify configuration and 'uv run python test_email.py --send-real' to send actual test emails.