A simple mcp server that lets your AI agent send emails and attach files through SMTP.
claude mcp add --transport stdio egyptianego17-email-mcp-server python -m email_mcp_server.server \ --env SMTP_FROM="your_email@example.com" \ --env SMTP_HOST="smtp_host_here" \ --env SMTP_PASS="your_app_password" \ --env SMTP_PORT="587" \ --env SMTP_USER="your_email@example.com" \ --env SMTP_SECURE="false"
How to use
This MCP server exposes tools to send emails via SMTP from your AI assistant. It supports three actions: send_simple_email for quick emails with optional text or HTML content, send_custom_email for full control including CC/BCC, attachments, and more, and test_smtp_connection to verify SMTP settings before sending. You configure SMTP credentials either globally via environment variables or per-call with a smtp_config payload. To run, start the server using the uv runtime (stdio transport) or with the HTTP transport for streaming requests, then call the provided tools through your MCP client. For example, you can call send_simple_email with a plain text body, or send_custom_email to attach files and specify recipients. If you’re testing connectivity, you can invoke test_smtp_connection to ensure your credentials and host are reachable before attempting to send messages.
How to install
Prerequisites:
- Python installed on your system
- Internet access to install dependencies
Installation steps:
-
Install the uv runtime (required for MCP stdio/transport handling): curl -LsSf https://astral.sh/uv/install.sh | sh
-
Clone the MCP server repository and navigate into it: git clone https://github.com/egyptianego17/email-mcp-server.git cd email-mcp-server
-
Sync development environment (uses uv tooling): uv sync --extra dev
-
Install dependencies (if needed) and verify the server can run: uv run python -m email_mcp_server.server
-
Run with HTTP transport (optional): uv run python -m email_mcp_server.server --http
Note: The SMTP configuration can be provided via environment variables or per-call payloads as documented in the README. Once running, you can connect via MCP clients to send emails through the configured SMTP service.
Additional notes
Tips and common issues:
- If you use Gmail or some providers, you may need to enable app passwords and allow less secure apps, especially when using SMTP with STARTTLS on port 587.
- You can configure SMTP credentials globally via env (SMTP_HOST, SMTP_PORT, SMTP_SECURE, SMTP_USER, SMTP_FROM, SMTP_PASS) or pass smtp_config in each tool call for per-request credentials.
- For per-call smtp_config payloads, include fields: host, port, secure, username, password, from_email.
- When using the HTTP transport, ensure port 8000 is accessible and that your client config points to http://localhost:8000/mcp.
- If you encounter connection errors, verify network access to the SMTP host and confirm that the chosen port matches the secure flag (STARTTLS typically uses port 587 with secure=false).
- The server supports three actions: send_simple_email, send_custom_email, and test_smtp_connection; consult your MCP client’s documentation to form the correct JSON payloads for these actions.
Related MCP Servers
mcp-vegalite
MCP server from isaacwasserman/mcp-vegalite-server
github-chat
A Model Context Protocol (MCP) for analyzing and querying GitHub repositories using the GitHub Chat API.
nautex
MCP server for guiding Coding Agents via end-to-end requirements to implementation plan pipeline
pagerduty
PagerDuty's official local MCP (Model Context Protocol) server which provides tools to interact with your PagerDuty account directly from your MCP-enabled client.
futu-stock
mcp server for futuniuniu stock
mcp -boilerplate
Boilerplate using one of the 'better' ways to build MCP Servers. Written using FastMCP