MCP Email Server

MCP Email Server

email-mcp-server•byptbsare

A Model Context Protocol server that lets an LLM read, send, and manage emails over POP3 and SMTP with TLS.

License: MIT•Runtime: Awaiting documentation review•Category: communication social

WHAT IT DOES

  • •Lists recent inbox email headers with a configurable limit, newest first.
  • •Fetches full email content by ID and automatically extracts attachments to a local directory.
  • •Sends plain text or HTML emails with optional local file attachments.
  • •Deletes emails by ID permanently.

BEST FOR

  • •Letting an AI assistant review and summarize inbox messages.
  • •Sending email reports or notifications with attachments through an AI workflow.

ABOUT EMAIL-MCP-SERVER

MCP Email Server is cataloged as an MCP server attributed to ptbsare. A Model Context Protocol server that lets an LLM read, send, and manage emails over POP3 and SMTP with TLS. It is categorized under communication social. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.

HOW TO INSTALL

Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.

LICENSE

Catalog license label: MIT. Check the source repository's current license and terms before using, modifying or distributing this software.

能力检查器

能力定义尚未审核。未核验的采集内容不会作为可信接口展示。

Tools (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Resources (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Prompts (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

NEWSLETTER - COMING LATER

Newsletter subscriptions are not open yet

Email delivery is not connected. This page does not collect email addresses or create subscriptions.

Browse the registry for current listings instead.

Community Reviews

Coming later

Reviews for MCP Email Server are not available yet

Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.

FREQUENTLY ASKED QUESTIONS

How are received attachments handled?

Received attachments are auto-saved to a per-email directory under /tmp/email_mcp_attachments.

Are the email IDs stable across sessions?

No; POP3 IDs are session-specific, so pollEmails should be called before fetching or deleting by ID.

上游原版 README

在 GitHub 查看同一版本原文

README.md · beeacd499799 · 采集于 2026-11-13 10:31:27 UTC

保留上游原文,不做 AI 改写。为安全起见过滤脚本、表单和不安全链接。

当前显示最后一次成功采集的文档快照,请以来源页面为准。

MCP Email Server

A Model Context Protocol (MCP) server for email operations (POP3/SMTP with TLS). Allows an LLM like Claude to read, send, and manage emails.

Quick Start

No clone, no install — runs directly from GitHub:

uvx git+https://github.com/ptbsare/email-mcp-server \
  --email-user you@example.com \
  --email-pass yourpassword \
  --pop3-server pop.example.com \
  --smtp-server smtp.example.com

First run caches the package; subsequent launches are instant.

Option 2: Clone + run locally

git clone https://github.com/ptbsare/email-mcp-server
cd email-mcp-server
uv pip install -e .
uv run main.py --email-user you@example.com --email-pass yourpassword \
  --pop3-server pop.example.com --smtp-server smtp.example.com

Option 3: .env file

Create a .env file in the working directory:

EMAIL_USER=you@example.com
EMAIL_PASS=yourpassword
POP3_SERVER=pop.example.com
SMTP_SERVER=smtp.example.com

Then simply:

uvx git+https://github.com/ptbsare/email-mcp-server
# or
uv run main.py

Configuration

Config Priority (highest → lowest)

  1. CLI arguments — override everything
  2. Environment variables — override .env file
  3. .env file — fallback defaults

All Config Options

CLI ArgumentEnv VariableRequiredDefaultDescription
--email-userEMAIL_USER✅—Email address
--email-passEMAIL_PASS✅—Email password / app password
--pop3-serverPOP3_SERVER✅—POP3 server hostname
--pop3-portPOP3_PORT995POP3 SSL port
--smtp-serverSMTP_SERVER✅—SMTP server hostname
--smtp-portSMTP_PORT587SMTP port (auto 465 if --smtp-use-ssl)
--smtp-use-sslSMTP_USE_SSLfalseUse SMTP_SSL (port 465) instead of STARTTLS
--log-levelLOG_LEVELINFOLogging: DEBUG / INFO / WARNING / ERROR

Examples: Mixing Config Sources

# CLI args only (no .env needed):
uv run main.py --email-user me@gmail.com --email-pass xxx \
  --pop3-server pop.gmail.com --smtp-server smtp.gmail.com

# .env file for credentials, CLI for servers:
# .env: EMAIL_USER=me@gmail.com / EMAIL_PASS=xxx
uv run main.py --pop3-server pop.gmail.com --smtp-server smtp.gmail.com

# Env vars override .env:
EMAIL_USER=other@gmail.com uv run main.py --pop3-server pop.gmail.com ...

Using with Claude Desktop

Add to your Claude Desktop config file:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%/Claude/claude_desktop_config.json

With env vars (in config):

{
  "mcpServers": {
    "email-mcp-server": {
      "command": "uvx",
      "args": ["git+https://github.com/ptbsare/email-mcp-server"],
      "env": {
        "EMAIL_USER": "your-email@example.com",
        "EMAIL_PASS": "your-app-password",
        "POP3_SERVER": "pop.example.com",
        "SMTP_SERVER": "smtp.example.com"
      }
    }
  }
}

With CLI args (in config):

{
  "mcpServers": {
    "email-mcp-server": {
      "command": "uvx",
      "args": [
        "git+https://github.com/ptbsare/email-mcp-server",
        "--email-user", "your-email@example.com",
        "--email-pass", "your-app-password",
        "--pop3-server", "pop.example.com",
        "--smtp-server", "smtp.example.com"
      ]
    }
  }
}

Tip: The env section and CLI args can be used together. CLI args always take priority.

Features

  • Poll Emails: List inbox email headers with configurable limit (pollEmails)
  • Fetch Full Emails: Get complete email content by ID, with automatic attachment extraction (getEmailsById)
  • Delete Emails: Remove emails by ID (deleteEmailsById)
  • Send Emails: Send plain text (sendTextEmail) or HTML (sendHtmlEmail) emails with optional file attachments
  • Secure Connections: POP3 over SSL (port 995), SMTP with STARTTLS (port 587) or direct SSL (port 465)
  • Attachment Support: Send local files as attachments; received attachments are auto-saved to /tmp/email_mcp_attachments/<email_id>/

Tools

pollEmails(limit=50)

List recent email headers (no body). Returns newest first. Use this first to get IDs for getEmailsById/deleteEmailsById.

ParameterTypeDefaultDescription
limitint50Max emails to return, newest first

Returns: [{"id": int, "Subject": str, "From": str, "Date": str, "Message-ID": str}]

pollEmails(limit=10)   # 10 most recent
pollEmails()           # default 50

getEmailsById(ids)

Fetch full email content (headers + body) by IDs from pollEmails. Attachments auto-saved to /tmp/email_mcp_attachments/<id>/.

ParameterTypeRequiredDescription
idslist[int]✅Email IDs from pollEmails(). Example: [1, 3, 5]

Returns: [{"id": int, "headers": dict, "body": str, "attachments": [{"filename": str, "local_path": str, "size": int, "content_type": str}]}]

getEmailsById(ids=[1, 3, 5])

deleteEmailsById(ids)

Permanently delete emails by IDs. Irreversible. Call pollEmails first.

ParameterTypeRequiredDescription
idslist[int]✅Email IDs from pollEmails(). Example: [1, 2, 3]

Returns: {"deleted": [int], "failed": {"id": "error msg"}}

deleteEmailsById(ids=[1, 2, 3])

sendTextEmail(toAddresses, subject, body, attachments=None)

Send a plain text email. Attachments: list of local file paths like ["/tmp/file.pdf"].

ParameterTypeRequiredDefaultDescription
toAddresseslist[str]✅—Recipients. Example: ["alice@example.com"]
subjectstr✅—Subject line
bodystr✅—Plain text body
attachmentslist[str]NoneLocal file paths. Example: ["/tmp/report.pdf"]

Returns: {"status": "success"}

sendTextEmail(
    toAddresses=["alice@example.com"],
    subject="Hello",
    body="Hi Alice!",
    attachments=["/tmp/report.pdf"]
)

sendHtmlEmail(toAddresses, subject, body, attachments=None)

Send an HTML email. Attachments: list of local file paths like ["/tmp/file.png"].

ParameterTypeRequiredDefaultDescription
toAddresseslist[str]✅—Recipients. Example: ["alice@example.com"]
subjectstr✅—Subject line
bodystr✅—HTML content. Example: "<h1>Hi</h1><p>Hello!</p>"
attachmentslist[str]NoneLocal file paths. Example: ["/tmp/chart.png"]

Returns: {"status": "success"}

sendHtmlEmail(
    toAddresses=["alice@example.com"],
    subject="Report",
    body="<h1>Report</h1><p>Sales up <b>20%</b>.</p>",
    attachments=["/tmp/chart.png"]
)

Development Setup

Prerequisites

  • Python 3.12+
  • uv

Steps

git clone https://github.com/ptbsare/email-mcp-server
cd email-mcp-server
uv pip install -e .
uv run main.py --help

Important Notes

  • App Passwords: If your email provider uses 2FA, generate an App Password for EMAIL_PASS
  • Email IDs: POP3 IDs are session-specific. Call pollEmails() before getEmailsById() or deleteEmailsById()
  • Attachment Storage: Received attachments are saved to /tmp/email_mcp_attachments/<email_id>/
  • Security: Never commit your .env file — it's already in .gitignore
  • Config Priority: CLI args > environment variables > .env file

Project Structure

email-mcp-server/
├── main.py              # MCP server entry point (all logic)
├── pyproject.toml       # Package config & dependencies
├── uv.lock              # Dependency lock file
├── .env                 # Credentials (create your own)
├── .gitignore
└── README.md

License

MIT

Install configuration

Are you the maintainer?

Claim this server with your GitHub account to request manual ownership verification.

README Embed Badge
Markdown

Link to the catalog listing for MCP Email Server from your README. This badge does not certify ownership, compatibility or security.

[![MCP catalog listing](https://img.shields.io/badge/MCP-awesome--mcp-orange?style=flat-square)](https://awesome-mcp.com/servers/email-mcp-server)

REPOSITORY STATS

GitHub StarsUnavailable
ForksUnavailable

Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.

下载与拉取统计

来源、范围和时段分别列出;不相加,不代表安装人数、活跃用户或安全审核。

尚无已审核的包 / 镜像标识,暂不展示下载统计。

Related communication social MCP Servers

Alternative and complementary servers in the same category

View all in communication social →

An AI receptionist platform with an MCP server for accessing business calls, contacts and appointments from AI assistants.

52
Communication

Pidgeon provides an MCP server and an email inbox API that gives AI agents their own addresses for sending, awaiting, and replying to email.

Repository stats unavailable
Communication