Overview
What is MCP Email Server?
MCP Email Server is a C# Model Context Protocol (MCP) server that provides email sending capabilities via SMTP. It integrates with any SMTP server (e.g., Gmail, Office 365) and is aimed at AI assistants that need to programmatically send notifications or other emails.
How to use MCP Email Server?
Configure SMTP credentials through environment variables (SMTP_SERVER, SMTP_PORT, SMTP_USERNAME, SMTP_PASSWORD) or appsettings.json. Run the server using dotnet run or the compiled executable. Use the available MCP tools: SendEmail (plain text) with to, subject, body parameters, and SendHtmlEmail (HTML) with to, subject, htmlBody parameters.
Key features of MCP Email Server
- MCP server implementation using stdio transport
- Sends plain text and HTML emails via SMTP
- Dependency injection for SMTP client and settings
- Configurable through environment variables or
appsettings.json - Proper error handling and logging
Use cases of MCP Email Server
- AI assistants sending notification emails to users
- Automated reporting from MCP-integrated tools
- Triggering email alerts based on server events
FAQ from MCP Email Server
What are the prerequisites for MCP Email Server?
.NET 6.0 or later and valid SMTP server credentials (server, port, username, password).
How do I use MCP Email Server with Gmail?
Enable 2‑Step Verification on your Google Account, generate an App Password under Security → 2‑Step Verification → App passwords, and use that as the SMTP password.
How is MCP Email Server configured?
Configuration is done via environment variables or the appsettings.json file. The required variables are SMTP_SERVER, SMTP_PORT, SMTP_USERNAME, and SMTP_PASSWORD.
What transport does MCP Email Server use?
It uses stdio transport, as shown in the provided JSON configuration examples.
Are there any security considerations?
Never commit email credentials to source control. Add appsettings.json to .gitignore. Use app passwords instead of your main password, and consider environment variables or a secure configuration management system.