MCP Email Server

一个基于 MCP (Model Context Protocol) 的邮件服务,支持 LLM 发送带附件的电子邮件及在指定目录中搜索文件。提供安全的 SMTP 传输、多收件人支持和附件模式匹配搜索功能,适用于 Gmail、Outlook、Yahoo、QQ 邮箱和网易 126 邮箱等主流邮箱服务。
  • python

70

GitHub Stars

python

Language

6 months ago

First Indexed

2 months ago

Catalog Refreshed

Documentation & install

Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.

Installation

Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "shy2593666979-mcp-server-email": {
      "command": "python",
      "args": [
        "-m",
        "mcp_email_server",
        "--dir",
        "/path/to/attachment/directory"
      ],
      "env": {
        "SENDER": "YOUR_SENDER_EMAIL@example.com",
        "PASSWORD": "YOUR_APP_PASSWORD"
      }
    }
  }
}

The MCP Email Server lets you compose and send emails through LLM workflows and locate relevant attachments across your directories. It supports multiple recipients, attachments, and secure SMTP transmission, making it a practical tool for automated email tasks driven by language models.

How to use

You use the MCP Email Server by running a local process and then invoking its tools from your MCP client. The server provides two core capabilities: composing/sending emails and searching for attachments by name patterns. Use these to automate email workflows, attach files, and retrieve documents relevant to your prompts.

How to install

Prerequisites: Python 3.8+ and pip must be available on your system.

Install the required Python dependencies.

pip install pydantic python-dotenv

Additional sections

Configuration and usage details are provided to help you run the server and connect it to your MCP client. The server exposes functions to send emails and to search for attachments within a directory you specify at startup.

Security notes: for Gmail and similar services you may need an app-specific password. The server also restricts attachment types for safety.

Supported attachment types include common documents, archives, text files, images, and Markdown notes. This ensures you can attach a wide range of references without compromising security.

Examples of how to use the two tools are shown below. You can adapt these patterns in your MCP client to automate email workflows and attachment searches.

# Example: sending an email with attachments
{
  "receiver": ["recipient@example.com"],
  "subject": "Test Email from MCP Server",
  "body": "This is a test email sent via the MCP Email Server.",
  "attachments": ["document.pdf", "image.jpg"]
}
# Example: searching for attachments matching a pattern
{
  "pattern": "report"
}

Available tools

send_email

Sends emails with a subject, body, and one or more recipients, optionally including attachments. You provide the receiver list, the body content, the subject, and optional attachments.

search_attachments

Searches for files in a specified directory whose filenames match a given pattern.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational