proton-mail-mcp

proton-mail-mcp

Enables AI assistants to interact with a Proton Mail mailbox through Proton Bridge, supporting listing, searching, reading, sending, and organizing emails.

Category
访问服务器

README

Proton Mail MCP Server

An MCP server exposing a Proton Mail mailbox to Claude — list, search, read, send, and file messages.

Proton Mail has no third-party REST API. Everything in a Proton mailbox is end-to-end encrypted, and the only supported way for an external program to reach it is Proton Bridge, which signs in to the account, performs all OpenPGP encryption and decryption locally, and re-exposes the decrypted mailbox as an ordinary IMAP/SMTP server on loopback.

This server therefore talks IMAP and SMTP to Bridge. There is no Proton protocol code here at all — no SRP, no key handling, no PGP — which is deliberate: those are the parts that break when Proton changes something.

Claude.ai
   │
   ▼  (authentik forward-auth at the reverse proxy)
proton-mail-mcp        FastMCP, HTTP on 127.0.0.1:8000/mcp
   │  IMAP 127.0.0.1:1143   (STARTTLS)
   │  SMTP 127.0.0.1:1025   (STARTTLS)
   ▼
Proton Bridge          SRP login + OpenPGP, Proton's own code
   │
   ▼
Proton

Bridge requires a paid Proton plan (Mail Plus or higher).

Tools

Tool What it does
list_emails Recent messages in a folder, newest first, with optional date window and unread filter
search_emails Search by sender, recipient, subject, body, free text, date range or attachments
read_email One message in full, with the body flattened to text
send_email Send a message, optionally as a threaded reply
list_folders The mailbox's system folders, user folders and labels, with counts
mark_email Mark a message read or unread
move_email Move a message to another folder (moving to trash is how you delete)
about What this server is
check_auth_status Whether the mailbox is reachable through Bridge right now

Listing, searching and reading never mark mail as read — the IMAP fetches use BODY.PEEK. read_email can opt in with mark_as_read=true.

Message IDs

Tools return IDs of the form <folder>:<uid>, e.g. INBOX:4821 or Folders/Work:77. IMAP UIDs are per-folder, so an ID is only valid while the message stays where it was found; after move_email the old ID is dead and the tool says so.

Folder names

Bridge puts Proton's system folders at the top level (INBOX, Sent, Drafts, Archive, Spam, Trash, All Mail) and namespaces user-created ones under Folders/ (exclusive) and Labels/ (non-exclusive). Tools accept any reasonable spelling: inbox, junk → Spam, bin → Trash, all mail, a plain leaf name like Work → Folders/Work, or the full path. Search a whole mailbox with folder="all mail".

Setup

1. Proton Bridge

Install Bridge and sign in once, out of band. Headless:

protonmail-bridge --cli
>>> login
>>> info      # prints the address, ports, and the generated password

The password Bridge prints is not the Proton account password — it is generated per install for mail clients, and it is what goes in the config below.

2. Configure

cp .env.example .env
# fill in PROTON_BRIDGE_USER and PROTON_BRIDGE_PASSWORD
Variable Default Notes
PROTON_BRIDGE_USER required Your Proton address
PROTON_BRIDGE_PASSWORD required Bridge's generated mail-client password
PROTON_BRIDGE_HOST 127.0.0.1
PROTON_IMAP_PORT 1143
PROTON_SMTP_PORT 1025
PROTON_IMAP_SECURITY starttls or ssl, none
PROTON_SMTP_SECURITY starttls or ssl, none
PROTON_TLS_VERIFY false Bridge's cert is self-signed by its own CA
PROTON_SEND_FROM = PROTON_BRIDGE_USER From header, if sending as another address
PROTON_TIMEOUT 60 Seconds
MCP_TRANSPORT stdio http for the hosted deployment
MCP_HOST / MCP_PORT / MCP_PATH 127.0.0.1 / 8000 / /mcp HTTP transport only

3. Install and run

python -m venv venv
venv/bin/pip install -r requirements.txt
venv/bin/python main.py

Check it can see the mailbox by calling the check_auth_status tool, which reports the account and INBOX counts, or names the specific problem if not.

Local use with Claude Code / Desktop

{
  "mcpServers": {
    "proton-assistant": {
      "command": "/path/to/proton-mail-mcp/venv/bin/python",
      "args": ["/path/to/proton-mail-mcp/main.py"]
    }
  }
}

Credentials come from .env; keep them out of the client config.

Hosted deployment

Runs on a Proxmox LXC behind a reverse proxy with authentik forward-auth, deployed by a GitHub Actions self-hosted runner on push to main. Two independent auth layers, neither of which is this server's code:

  1. Connector auth — authentik decides who may use the connector, enforced at the proxy. The server binds to loopback and has no auth code by design.
  2. Mailbox auth — Bridge holds the Proton credentials, signed in once.

Signing in to the connector does not grant mailbox access; they are unrelated.

See HANDOFF.md for the deployment runbook.

Tests

venv/bin/python -m pytest

The suite is fully offline — no Bridge, no credentials, no network. Message handling is tested against real imap_tools objects parsed from raw RFC822 bytes, so parsing, filtering, sorting and rendering are exercised for real.

Limitations

  • Search is literal. IMAP SEARCH does case-insensitive substring matching, not ranked relevance. There is no stemming and no scoring.
  • Date filters are day-granular on the server. IMAP SINCE/BEFORE compare whole dates, so a time-of-day bound is applied client-side after fetching.
  • Attachment filtering happens after the fetch, because IMAP cannot search on it. Summaries infer attachments from Content-Type: multipart/mixed.
  • No attachment download. Attachments are listed by name and size only.
  • Bridge must be running. If it isn't, every tool says so plainly rather than failing obscurely.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选