This Python script implements an MCP (Model Context Protocol) server using the mcp library (FastMCP) that allows an LLM (like Claude) to interact with an email account using POP3 (for reading/deleting emails) and SMTP (for sending emails), both secured with TLS encryption.
How to use
The Email MCP server is a powerful Python script that implements the Model Context Protocol (MCP) using the FastMCP library. It enables interactions with an email account over POP3 for reading and deleting emails, as well as SMTP for sending emails, all secured with TLS encryption. Developers can leverage this server to build applications that need to automate email handling while ensuring secure communication.
Once connected to the Email MCP server, you can issue commands to read, delete, or send emails seamlessly. You may interact with this server using commands like READ, DELETE, and SEND, which allow you to manage your inbox and send outgoing messages. For optimal results, structure your queries to specify email criteria clearly, such as sender or subject, to streamline your email interactions.
How to install
Prerequisites
Before installing the Email MCP server, ensure you have Python 3.x installed on your machine. The mcp library (FastMCP) is also required, so you should have it set up prior to running the server.
Option A: Quick start with npx
If you prefer a quick start without local installation, you can run it using npx with the following command:
npx -y @package/name
Option B: Global install alternative
To install the Email MCP server globally, clone the repository and install the dependencies:
git clone https://github.com/ptbsare/email-mcp-server.git
cd email-mcp-server
pip install -r requirements.txt
Additional notes
For optimal configuration, ensure you set your email account credentials and server settings as environment variables to keep them secure. Common variables include EMAIL_USER, EMAIL_PASSWORD, SMTP_SERVER, and POP3_SERVER. Be mindful of the TLS requirements; misconfigured settings can lead to connection issues.
Related MCP Servers
mcp -email
一个基于 MCP (Model Context Protocol) 的邮件服务,支持 LLM 发送带附件的电子邮件及在指定目录中搜索文件。提供安全的 SMTP 传输、多收件人支持和附件模式匹配搜索功能,适用于 Gmail、Outlook、Yahoo、QQ 邮箱和网易 126 邮箱等主流邮箱服务。
nautex
MCP server for guiding Coding Agents via end-to-end requirements to implementation plan pipeline
mcp-yfinance
Real-time stock API with Python, MCP server example, yfinance stock analysis dashboard
cloudwatch-logs
MCP server from serkanh/cloudwatch-logs-mcp
the -company
TheMCPCompany: Creating General-purpose Agents with Task-specific Tools
mcp-yahoo-finance
MCP server for Yahoo Finance