MCP Email Server logo

MCP Email Server

by sachatrauwaen

A C# Model Context Protocol (MCP) server that provides email sending capabilities using SMTP. It supports sending both plain text and HTML emails.

View on GitHub

Last updated: N/A

What is MCP Email Server?

The MCP Email Server is a .NET application that acts as an MCP server, enabling you to send emails via SMTP using MCP tools. It allows sending both plain text and HTML emails by interacting with an SMTP server.

How to use MCP Email Server?

  1. Clone the repository. 2. Configure SMTP environment variables (SMTP_SERVER, SMTP_PORT, SMTP_USERNAME, SMTP_PASSWORD). 3. If using Gmail, enable 2-Step Verification and generate an App Password. 4. Run the server using dotnet run. 5. Use the SendEmail or SendHtmlEmail MCP tools to send emails by providing the recipient, subject, and body (or HTML body).

Key features of MCP Email Server

  • MCP server implementation with stdio transport

  • SMTP email sending capabilities

  • Support for both plain text and HTML emails

  • Configurable through environment variables

Use cases of MCP Email Server

  • Sending transactional emails from applications

  • Automated email notifications

  • Integration with MCP-based systems for email communication

  • Sending marketing emails (with appropriate safeguards)

FAQ from MCP Email Server

What SMTP server can I use?

You can use any SMTP server, such as Gmail, Office 365, or your own SMTP server.

How do I configure Gmail?

Enable 2-Step Verification in your Google Account and generate an App Password for the application.

What are the required environment variables?

The required environment variables are SMTP_SERVER, SMTP_PORT, SMTP_USERNAME, and SMTP_PASSWORD.

How do I send an HTML email?

Use the SendHtmlEmail MCP tool and provide the recipient, subject, and HTML content in the htmlBody parameter.

Is it secure to store my email credentials in the code?

No, never commit your email credentials to source control. Use environment variables or a secure configuration management system instead.