Get the FREE Ultimate OpenClaw Setup Guide →

mcp-email

IMAP and SMTP via MCP Server

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio ai-zerolab-mcp-email-server uvx mcp-email-server@latest stdio \
  --env MCP_EMAIL_SERVER_IMAP_SSL="true" \
  --env MCP_EMAIL_SERVER_PASSWORD="" \
  --env MCP_EMAIL_SERVER_SMTP_SSL="true" \
  --env MCP_EMAIL_SERVER_FULL_NAME="Email account" \
  --env MCP_EMAIL_SERVER_IMAP_HOST="" \
  --env MCP_EMAIL_SERVER_IMAP_PORT="993" \
  --env MCP_EMAIL_SERVER_SMTP_HOST="" \
  --env MCP_EMAIL_SERVER_SMTP_PORT="465" \
  --env MCP_EMAIL_SERVER_USER_NAME="" \
  --env MCP_EMAIL_SERVER_ACCOUNT_NAME="default" \
  --env MCP_EMAIL_SERVER_SAVE_TO_SENT="true" \
  --env MCP_EMAIL_SERVER_EMAIL_ADDRESS="" \
  --env MCP_EMAIL_SERVER_SMTP_START_SSL="false" \
  --env MCP_EMAIL_SERVER_IMAP_VERIFY_SSL="true" \
  --env MCP_EMAIL_SERVER_SMTP_VERIFY_SSL="true" \
  --env MCP_EMAIL_SERVER_SENT_FOLDER_NAME="" \
  --env MCP_EMAIL_SERVER_ENABLE_ATTACHMENT_DOWNLOAD="false"

How to use

mcp-email-server exposes IMAP and SMTP capabilities through the MCP framework, allowing clients to manage email accounts via a unified MCP interface. This server uses uvx to pull the mcp-email-server package, providing tooling to configure and run an email bridge that can connect to IMAP/SMTP servers. Typical usage involves starting the server with the uvx command, wiring your MCP client to the zerolib-email endpoint, and then configuring the underlying email settings either through environment variables or a TOML/UI-based configuration. Features include saving sent emails to the IMAP Sent folder, optional attachment download, and support for various SSL configurations for IMAP/SMTP, including self-signed certificates if needed.

How to install

Prerequisites:

  • Python 3.8+ installed on your system
  • Node.js/npm not required for this MCP server variant
  • uv (https://github.com/astral-sh/uv) for environment management via uvx

Installation steps:

  1. Install the mcp-email-server package from PyPI (as a Next-Gen Python MCP server):
pip install mcp-email-server
  1. Install uv and ensure it is available in your PATH. If not already installed, follow uv installation instructions from their repository.
# example (install via npm/yarn if you manage uv through a wrapper in your environment)
# This step may vary depending on your setup; the README recommends uv for environment management.
  1. Run the MCP server using uvx to fetch the latest release and start in stdio mode:
uvx mcp-email-server@latest stdio
  1. Connect an MCP client (e.g., your MCP frontend) to the zerolib-email endpoint and supply required email configuration via environment variables or a TOML/UI config as described below.

Prerequisite notes:

  • Ensure network access to your IMAP/SMTP endpoints (host, port, SSL settings).
  • Provide credentials and security settings via environment variables or a TOML config file as illustrated in the README.

Additional notes

Tips and common considerations:

  • Enable or disable attachment downloads via the MCP_EMAIL_SERVER_ENABLE_ATTACHMENT_DOWNLOAD variable depending on your security requirements.
  • The server can automatically save sent emails to a designated IMAP Sent folder; adjust via MCP_EMAIL_SERVER_SENT_FOLDER_NAME or TOML settings if needed.
  • If you are using self-signed certificates (e.g., ProtonMail Bridge), you may need to disable SSL verification for IMAP/SMTP by setting MCP_EMAIL_SERVER_IMAP_VERIFY_SSL and MCP_EMAIL_SERVER_SMTP_VERIFY_SSL to false. This should be done with caution in trusted environments.
  • For containerized deployments, you can wrap the uvx command in a docker run script and pass environment variables through. The configuration supports both UI-based configuration and environment-variable driven setups.
  • When using multiple providers or accounts, you can reuse the zerolib-email server instance by adjusting account-specific settings within the TOML config or via environment variables per account.

Related MCP Servers

Sponsor this space

Reach thousands of developers