Proton MCP Server
Enables full Proton Mail management through the Model Context Protocol by connecting to a local Proton Mail Bridge instance. It allows users to list, search, read, send, and organize emails using natural language commands.
README
Proton MCP Server
A complete TypeScript Model Context Protocol (MCP) server for Proton Mail integration via Proton Mail Bridge.
What This Does
This MCP server provides full email management capabilities through Claude Code by connecting to Proton Mail Bridge running locally. It allows you to:
- List and browse mailbox folders
- List, search, and read emails
- Send new emails and replies
- Move and delete emails
- Access full message content with attachments
Prerequisites
- Proton Mail Bridge running and accessible on localhost:
- IMAP server on port 1143 (STARTTLS)
- SMTP server on port 1025 (STARTTLS)
- Node.js 18 or higher
- A valid Proton Mail account with Bridge credentials
Setup
1. Install Dependencies
npm install
2. Configure Environment
Copy the environment template and add your Proton credentials:
cp .env.example .env
Edit .env with your settings:
PROTON_IMAP_HOST=127.0.0.1
PROTON_IMAP_PORT=1143
PROTON_SMTP_HOST=127.0.0.1
PROTON_SMTP_PORT=1025
PROTON_USER=your-proton-email@protonmail.com
PROTON_PASS=your-bridge-password
3. Build
npm run build
4. Run Locally (Development)
npm run dev
Or run the compiled version:
npm start
Usage with Claude Code
Add this MCP server to your Claude settings (~/.claude/settings.json):
{
"mcpServers": {
"proton": {
"command": "node",
"args": ["/path/to/proton-mcp-server/dist/index.js"],
"env": {
"PROTON_USER": "your-email@protonmail.com",
"PROTON_PASS": "your-bridge-password",
"PROTON_IMAP_HOST": "127.0.0.1",
"PROTON_IMAP_PORT": "1143",
"PROTON_SMTP_HOST": "127.0.0.1",
"PROTON_SMTP_PORT": "1025"
}
}
}
}
Or with TypeScript/tsx:
{
"mcpServers": {
"proton": {
"command": "npx",
"args": ["tsx", "/path/to/proton-mcp-server/src/index.ts"]
}
}
}
Available Tools
Reading Tools (Read-Only)
- proton_list_folders — List all mailbox folders with message and unread counts
- proton_list_emails — List emails in a folder with pagination (newest first)
- proton_search_emails — Advanced search with filters (from, to, subject, date range, body content, unread status)
- proton_read_email — Read the complete email content including headers, body, and attachment list
Writing Tools
- proton_send_email — Send a new email (plain text or HTML)
- proton_reply_email — Reply to an email with proper threading headers
- proton_move_email — Move email to another folder
- proton_delete_email — Delete email (move to Trash)
Project Structure
proton-mcp-server/
├── src/
│ ├── index.ts # Main entry point
│ ├── constants.ts # Configuration constants
│ ├── types.ts # TypeScript interfaces
│ ├── schemas/
│ │ └── index.ts # Zod input schemas
│ ├── services/
│ │ ├── imap.ts # IMAP client wrapper
│ │ └── smtp.ts # SMTP client wrapper
│ └── tools/
│ ├── folders.ts # proton_list_folders
│ ├── list.ts # proton_list_emails
│ ├── search.ts # proton_search_emails
│ ├── read.ts # proton_read_email
│ ├── send.ts # proton_send_email
│ ├── reply.ts # proton_reply_email
│ ├── move.ts # proton_move_email
│ └── delete.ts # proton_delete_email
├── package.json
├── tsconfig.json
├── .env.example
├── .gitignore
└── README.md (this file)
Implementation Notes
IMAP Connection
- Uses
imapflowlibrary with STARTTLS on port 1143 - Proton Bridge uses self-signed certificates, so
tls.rejectUnauthorized: false - All connections are properly closed with
logout()in finally blocks
SMTP Connection
- Uses
nodemailerwith STARTTLS on port 1025 - Supports plain text and HTML email bodies
- Properly sets
In-Reply-ToandReferencesheaders for email threading
Message Parsing
- Uses
mailparserto extract full message content - Supports text, HTML, and attachment handling
- Returns attachment metadata (filename, content type, size)
Pagination
- Email list pagination uses offset and limit parameters
- Results are always newest first
- Search results also support pagination
Troubleshooting
Connection Issues
- Ensure Proton Mail Bridge is running:
protonmail-bridge --cli - Check localhost connectivity:
telnet 127.0.0.1 1143(IMAP) and1025(SMTP) - Verify credentials in
.envfile
Email Issues
- Some email clients may not recognize replies without proper Message-ID headers
- HTML emails are parsed to text; use the raw HTML body for better formatting
- Large attachments may take time to process
Build Issues
- Ensure Node.js 18+ is installed:
node --version - Clear node_modules and reinstall:
npm clean-install - Check TypeScript compilation:
npm run build
Dependencies
@modelcontextprotocol/sdk— MCP protocol implementationimapflow— IMAP client for email readingnodemailer— SMTP client for sending emailsmailparser— Email parsing and content extractionzod— Input validation schemasdotenv— Environment variable loading
License
MIT
Support
For issues with Proton Mail Bridge, see: https://proton.me/support/bridge
For MCP protocol documentation, see: https://modelcontextprotocol.io
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。