email-mcp-server

email-mcp-server

1

The MCP Email Server is a Python-based project that uses the Model Context Protocol to interact with email systems through secure POP3 and SMTP connections, facilitated by environment config files. It offers functionalities like polling, fetching, and sending emails securely.

MCP Email Server

This project is an MCP server using a Python script to interface with an email system. It leverages the FastMCP library, allowing interaction with email accounts via POP3 and SMTP protocols, both secured with TLS encryption. Configuration details are managed through the python-dotenv library.

Features

  • Poll Emails: Retrieve email headers from the inbox.
  • Fetch Full Emails: Get specific email's headers and bodies by ID.
  • Delete Emails: Remove emails by ID.
  • Send Emails: Facilitate sending of plain text or HTML formatted emails.
  • Secure Connections: Offers secure connections over POP3 and SMTP with different TLS support.
  • Environment Configuration: Uses .env file for storing server credentials and configuration settings.

Tools Provided

  • pollEmails(): Lists message IDs and key headers of current emails.
  • getEmailsById(ids: list): Returns email details, preferring HTML body parsing.
  • deleteEmailsById(ids: list): Marks emails for deletion by ID.
  • sendTextEmail: Delivers plain text emails via SMTP.
  • sendHtmlEmail: Dispatches HTML formatted emails via SMTP.

Setup and Installation

  • Requires Python 3.12+ and the uv tool for environment management.
  • Dependencies are managed through pyproject.toml and installed using uv.
  • All credentials and settings are managed through a .env file for secure configuration.
  • Integration into Claude Desktop requires setting up a developer_config.json.