Get the FREE Ultimate OpenClaw Setup Guide →

email

A simple mcp server that lets your AI agent send emails and attach files through SMTP.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
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:

  1. Install the uv runtime (required for MCP stdio/transport handling): curl -LsSf https://astral.sh/uv/install.sh | sh

  2. Clone the MCP server repository and navigate into it: git clone https://github.com/egyptianego17/email-mcp-server.git cd email-mcp-server

  3. Sync development environment (uses uv tooling): uv sync --extra dev

  4. Install dependencies (if needed) and verify the server can run: uv run python -m email_mcp_server.server

  5. 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

Sponsor this space

Reach thousands of developers