Email-Sender-MCP-Server

AbuZar-Ansarii/Email-Sender-MCP-Server

3.2

If you are the rightful owner of Email-Sender-MCP-Server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

The Email Sender MCP Server is a Model Context Protocol server designed to facilitate email sending through AI assistants using SMTP.

Tools
1
Resources
0
Prompts
0

📧 Email Sender MCP Server

A Model Context Protocol (MCP) server that enables AI assistants like Claude to send emails via SMTP. Built with FastMCP for seamless integration with AI workflows.

✨ Features

  • 📨 Send Emails - Send emails programmatically through AI assistants
  • Email Validation - Automatic validation of recipient email addresses
  • 🔒 Secure SMTP - Uses TLS encryption for secure email transmission
  • 📊 Server Info Resource - Query server metadata and capabilities
  • 🎯 Gmail Integration - Pre-configured for Gmail SMTP (easily adaptable to other providers)

Demo Video

link - https://drive.google.com/file/d/129tccBAfMRiJLKSd7pNl7pwMm7-VH9M_/view?usp=drivesdk

🚀 Quick Start

Prerequisites

  • Python 3.8 or higher
  • Gmail account with App Password enabled (or other SMTP provider)

Installation

  1. Clone the repository
git clone https://github.com/AbuZar-Ansarii/Email-Sender-MCP-Server.git
cd email-mcp-server
  1. Install dependencies
uv pip install -r requirements.txt
  1. Configure your email credentials

Edit the configuration section in the code:

SMTP_SERVER = "smtp.gmail.com"
SMTP_PORT = 587
SENDER_EMAIL = "your-email@gmail.com"
SENDER_PASSWORD = "your-app-password"  # Use App Password, not regular password!

Setting Up Gmail App Password

  1. Enable 2-Factor Authentication on your Google account
  2. Go to Google App Passwords
  3. Generate a new app password for "Mail"
  4. Use this 16-character password in the SENDER_PASSWORD field

Running the Server

python email_sender.py

Or with FastMCP:

fastmcp run email_sender.py

🔧 Usage

With Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "email-sender": {
      "command": "uv",
      "args": ["/path/to/email_sender.py"]
    }
  }
}

Available Tools

send_email

Sends an email to a specified recipient.

Parameters:

  • receiver (str): Recipient's email address
  • subject (str): Email subject line
  • content (str): Email body content

Returns:

  • Success message with recipient email
  • Error message if sending fails

Example:

send_email(
    receiver="recipient@example.com",
    subject="Hello from MCP!",
    content="This is a test email sent via MCP server."
)

Available Resources

info://server

Returns server metadata including name, version, description, available tools, and author.

📋 Requirements

fastmcp
email-validator

🔒 Security Notes

  • Never commit credentials - Always use environment variables or config files (add to .gitignore)
  • Use App Passwords - Don't use your main Gmail password
  • Validate inputs - The server includes email validation to prevent invalid addresses
  • Rate limiting - Be aware of SMTP provider rate limits (Gmail: ~500 emails/day for free accounts)

🛠️ Customization

Using Different SMTP Providers

Outlook/Hotmail:

SMTP_SERVER = "smtp-mail.outlook.com"
SMTP_PORT = 587

Yahoo:

SMTP_SERVER = "smtp.mail.yahoo.com"
SMTP_PORT = 587

Custom SMTP:

SMTP_SERVER = "your-smtp-server.com"
SMTP_PORT = 587  # or 465 for SSL

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

📝 License

This project is licensed under the MIT License - see the file for details.

👤 Author

Mohd Abuzar

ail validation powered by email-validator

📞 Support

If you have any questions or run into issues, please open an issue on GitHub.


⭐ Star this repo if you find it helpful!