Proton Mail MCP Server
An MCP server for Claude Code that provides email access through Proton Mail Bridge. Emails are synced to a local SQLite database with FTS5 full-text search for fast offline access.
Features
- 13 MCP tools: list, read, search, send, reply, move, mark, delete emails + attachment downloads
- Local SQLite database: Sync email headers once, work offline. Bodies fetched lazily on demand
- FTS5 full-text search: Search across subject, sender, recipient, and body — instant results across 13k+ emails
- Incremental sync: First sync ~2-3 min, subsequent syncs in seconds
- DB-first architecture:
list_emails,read_email,search_emailsserve from local DB when synced, IMAP fallback otherwise
Setup
Prerequisites
- Python 3.10+
- Proton Mail Bridge running locally
python-dotenv,mcppackages
1. Clone and configure
git clone https://github.com/DreamC0der-AI/proton-mail-mcp.git
cd proton-mail-mcp
Create a .env file with your Proton Bridge credentials:
[email protected]
EMAIL_PASS=your-bridge-password
IMAP_HOST=127.0.0.1
IMAP_PORT=1143
SMTP_HOST=127.0.0.1
SMTP_PORT=1025
2. Add to Claude Code
Copy example.mcp.json to your project's .mcp.json and update the path:
{
"mcpServers": {
"email": {
"type": "stdio",
"command": "python3",
"args": ["/absolute/path/to/proton-mail-mcp/server.py"]
}
}
}
3. Sync emails
After restarting Claude Code, run sync_emails to pull headers into the local database. Then use local_search for instant full-text search.
Tools
Architecture
server.py MCP server (FastMCP, IMAP pool, SMTP, tool definitions)
db.py EmailDB (SQLite + FTS5) + EmailSyncer (IMAP-to-DB sync)
.env Credentials (gitignored)
data/ Local database + attachments (gitignored)
emails.db SQLite WAL database
attachments/ Downloaded attachment files
tests/ Test suite
License
MIT