mcpField
M
MCP Email Server

MCP Email Server

Local
github.com/sachatrauwaenCommunication0Updated 77w ago

About MCP Email Server

MCP Email Server is a C# server that sends email through an SMTP server. It offers separate tools for plain-text and HTML messages, with SMTP settings supplied through environment variables or appsettings.json.

Key features

  1. 01Send plain-text email
  2. 02Send HTML email
  3. 03Configure SMTP credentials and settings
  4. 04Use stdio transport

Use cases

  1. 01Send a text notification by email
  2. 02Send an HTML-formatted message
  3. 03Connect an MCP client to an SMTP account

MCP support

Exposes `SendEmail` and `SendHtmlEmail` tools to MCP clients over stdio, using configured SMTP credentials.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

No install method listed yet

We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.

Repository

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

MCP Email Server

A C# Model Context Protocol (MCP) server that provides email sending capabilities using SMTP.

Prerequisites

  • .NET 6.0 or later
  • SMTP server credentials (e.g., Gmail, Office 365, or your own SMTP server)

Setup

  1. Clone the repository

  2. Set the following environment variables for SMTP configuration:

    • SMTP_SERVER (e.g., smtp.gmail.com)
    • SMTP_PORT (e.g., 587)
    • SMTP_USERNAME (your email address)
    • SMTP_PASSWORD (your app password)

Mcp Email Server can be run using the following command:


 "mcp-email-server": {
      "type": "stdio",
      "command": "dotnet",
      "args": ["run", 
              "--project",
              "YOUR_PATH/smtp-dotnet-mcp-server/McpEmailServer.csproj"
            ],
      "env": {       
        "SMTP_SERVER": "localhost",
        "SMTP_PORT": "25",
        "SMTP_USERNAME": "",
        "SMTP_PASSWORD": ""
      }
    }

or


 "mcp-email-server": {
      "type": "stdio",
      "command": "cmd",
      "args": ["/c",               
              "YOUR_PATH/smtp-dotnet-mcp-server/McpEmailServer.exe"
            ],
      "env": {       
        "SMTP_SERVER": "localhost",
        "SMTP_PORT": "25",
        "SMTP_USERNAME": "",
        "SMTP_PASSWORD": ""
      }
    }

Gmail Setup (if using Gmail)

If you're using Gmail, you'll need to:

  1. Enable 2-Step Verification in your Google Account
  2. Generate an App Password:
    • Go to Google Account settings
    • Security
    • 2-Step Verification
    • App passwords
    • Generate a new app password for "Mail"

Running the Server

dotnet run

Available Tools

The server provides the following MCP tools:

  1. SendEmail: Sends a plain text email

    • Parameters:
      • to: Recipient email address
      • subject: Email subject
      • body: Email body text
  2. SendHtmlEmail: Sends an HTML email

    • Parameters:
      • to: Recipient email address
      • subject: Email subject
      • htmlBody: HTML content for the email body

Features

  • MCP server implementation with stdio transport
  • SMTP email sending capabilities
  • Support for both plain text and HTML emails
  • Dependency injection for SMTP client and settings
  • Configurable through appsettings.json
  • Proper error handling and logging

Security Notes

  • Never commit your email credentials to source control
  • The appsettings.json file should be added to .gitignore
  • Use app passwords instead of your main password when possible
  • Consider using environment variables or a secure configuration management system in production

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.