Sponsored by Deepsite.site

Email MCP Server

Created By
egyptianego177 months ago
A simple mcp server that lets your AI agent send emails and attach files through SMTP.
Content

Email MCP Server

This MCP (Model Context Protocol) server lets your AI assistant send emails for you.

What Can It Do?

Your AI assistant can:

  • Send both plain text and HTML emails
  • Attach files and documents
  • Send to multiple people with CC/BCC
  • Check if your email setup works

Available Tools

send_email - Simple Email Sending

Send emails quickly using your environment configuration:

  • Just specify recipient, subject, and body
  • Automatically uses your configured SMTP settings
  • Perfect for quick messages

send_custom_email - Advanced Email Features

Send emails with full control:

  • Send to multiple people with CC/BCC
  • Add file attachments
  • Use HTML formatting
  • Override SMTP settings per email

test_smtp_connection_tool - Check Setup

Test your email settings before sending important emails.

Getting Started

1. Install Required Software

# Install uv (Python package manager)
curl -LsSf https://astral.sh/uv/install.sh | sh

# Restart your terminal or run:
source ~/.bashrc

2. Install Project Dependencies

cd email-mcp-server
uv sync

3. Test the Installation

# Test your email setup
uv run python test_email.py

# Run the server directly (for testing)
uv run main.py

4. Configure Claude Desktop or Cursor

Add this to your Claude Desktop configuration or Cursor file:

{
  "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": ""
          }
      }
  }
}

Important: Change the directory path to match your actual installation location.

Simple Examples

Send a basic email:

"Send an email to john@company.com saying the meeting is tomorrow at 2 PM"

Send with HTML formatting:

"Send an HTML email to team@company.com with subject 'Weekly Update' and create a nice formatted message about this week's progress"

Test your setup:

"Test the email connection to make sure it's working"

Advanced Examples

Send to multiple people with attachments:

"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"

Email Provider Setup

For Gmail

"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"
}

Gmail Setup Steps:

  1. Enable 2-Factor Authentication
  2. Go to Google Account → Security → App passwords
  3. Generate an app password for "Mail"
  4. Use the 16-character app password

For Outlook

"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"
}

For Other Providers

Replace the SMTP settings with your provider's details. Most providers use:

  • Port 587 with SMTP_SECURE=false (STARTTLS)
  • Port 465 with SMTP_SECURE=true (SSL)

Configuration Variables

VariableDescriptionExample
SMTP_HOSTYour email serversmtp.gmail.com
SMTP_PORTServer port587
SMTP_SECUREUse SSL (true/false)false
SMTP_USERYour usernameuser@gmail.com
SMTP_FROMSender addressnoreply@company.com
SMTP_PASSYour passwordyour-password

Troubleshooting

"Missing Configuration"

  • Make sure all environment variables are set in the Claude Desktop config
  • Check that the directory path is correct and absolute
  • Restart Claude Desktop after making changes

"Authentication Failed"

  • For Gmail/Yahoo: Use app passwords, not regular passwords
  • Enable 2-Factor Authentication first
  • Double-check username and password

"Connection Issues"

  • Verify SMTP host and port are correct
  • Check your internet connection
  • Some networks block SMTP ports

"Server Not Found"

  • Make sure uv is installed and in your PATH
  • Check that the directory path exists
  • Verify the project dependencies are installed with uv sync

Testing

# Test configuration and connection
uv run python test_email.py

# Send a real test email to yourself
uv run python test_email.py --send-real

License

MIT License - Feel free to use and modify as needed.

Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
WindsurfThe new purpose-built IDE to harness magic
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Playwright McpPlaywright MCP server
ChatWiseThe second fastest AI chatbot™
CursorThe AI Code Editor
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
Tavily Mcp
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
Serper MCP ServerA Serper MCP Server
Amap Maps高德地图官方 MCP Server
DeepChatYour AI Partner on Desktop
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors