Proton Mail Bridge MCP Server
Provides email operations through Proton Bridge's local IMAP/SMTP interface, enabling listing and searching emails, reading full messages and attachments, sending plain-text emails, and listing mail folders.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Proton Mail Bridge MCP Server
A Model Context Protocol (MCP) server that connects to Proton Mail via Proton Bridge's IMAP/SMTP interface, exposing email operations to AI assistants like Claude and LMStudio.
Status: Phase 1 / Proof of Concept
Features
Available MCP Tools
list_emails - List emails from a specified folder
read_email - Read full email content by ID
send_email - Send new emails (plain text, no attachments)
search_emails - Search emails by criteria
list_folders - List all available mail folders
Related MCP server: proton-bridge-mcp
Prerequisites
System Requirements
Python 3.10+
Proton Bridge installed and running
Proton Mail account with valid credentials
Proton Bridge Setup
Download and install Proton Bridge
Launch Proton Bridge and log in with your Proton account
Generate Bridge credentials:
In Proton Bridge, go to Settings
Copy the Bridge username and password (NOT your Proton account password)
Verify Bridge is running on default ports:
IMAP:
127.0.0.1:1143SMTP:
127.0.0.1:1025
Installation
1. Clone/Download the Project
cd /path/to/proton-mcp-server2. Create Virtual Environment (Recommended)
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate3. Install Dependencies
pip install -r requirements.txt4. Configure the Server
Choose one of three configuration methods:
Option A: Environment Variables (.env file) - Recommended
cp .env.example .env
# Edit .env with your actual credentialsEdit .env:
PROTON_USERNAME=your_bridge_username@proton.me
PROTON_PASSWORD=your_bridge_password
IMAP_HOST=127.0.0.1
IMAP_PORT=1143
SMTP_HOST=127.0.0.1
SMTP_PORT=1025
ATTACHMENT_DOWNLOAD_PATH=/tmp/proton-attachments
MAX_EMAIL_RESULTS=50Option B: Config File (config.json)
Create config.json:
{
"proton_username": "your_bridge_username@proton.me",
"proton_password": "your_bridge_password",
"imap_host": "127.0.0.1",
"imap_port": 1143,
"smtp_host": "127.0.0.1",
"smtp_port": 1025,
"attachment_download_path": "/tmp/proton-attachments",
"max_email_results": 50
}Option C: Command-Line Arguments
Pass configuration via CLI:
python server.py \
--proton-username your_bridge_username@proton.me \
--proton-password your_bridge_password \
--imap-host 127.0.0.1 \
--imap-port 1143Priority Order: CLI args > Environment variables > Config file
Running the Server
Standalone Mode (for testing)
python server.pyThe server will start and listen on stdin/stdout for MCP protocol messages.
With LMStudio
Open LMStudio settings
Navigate to MCP Servers configuration
Add a new server:
{ "name": "proton-mail-bridge", "command": "python", "args": ["/path/to/proton-mcp-server/server.py"], "env": { "PROTON_USERNAME": "your_bridge_username@proton.me", "PROTON_PASSWORD": "your_bridge_password" } }Restart LMStudio
With Claude Desktop
Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS):
{
"mcpServers": {
"proton-mail-bridge": {
"command": "python",
"args": ["/path/to/proton-mcp-server/server.py"],
"env": {
"PROTON_USERNAME": "your_bridge_username@proton.me",
"PROTON_PASSWORD": "your_bridge_password"
}
}
}
}Restart Claude Desktop.
Usage Examples
Once connected to an AI assistant:
List Recent Emails
"List my recent emails from INBOX"Read Specific Email
"Read email ID 42 and include attachments"Send Email
"Send an email to john@example.com with subject 'Meeting Tomorrow' and body 'Let's meet at 3pm'"Search Emails
"Search for emails containing 'invoice' in the subject"List Folders
"Show me all my email folders"API Reference
list_emails
List emails from a folder.
Parameters:
folder(optional, default: "INBOX") - Folder namelimit(optional, default: 50, max: 50) - Max resultsunread_only(optional, default: false) - Only unread emails
Returns:
{
"emails": [
{
"id": "123",
"from": "sender@example.com",
"to": ["you@proton.me"],
"subject": "Hello",
"date": "2026-02-09T10:30:00Z",
"unread": true,
"has_attachments": true,
"preview": "First 200 chars...",
"folder": "INBOX"
}
]
}read_email
Read full email content.
Parameters:
email_id(required) - Email ID from list_emailsinclude_attachments(optional, default: false) - Include base64 content
Returns:
{
"id": "123",
"from": "sender@example.com",
"to": ["you@proton.me"],
"cc": [],
"subject": "Hello",
"date": "2026-02-09T10:30:00Z",
"body_text": "Plain text body",
"body_html": "<html>...</html>",
"attachments": [
{
"filename": "document.pdf",
"size": 102400,
"content_type": "application/pdf",
"content_base64": "JVBERi0xLjQK..."
}
]
}send_email
Send a new email.
Parameters:
to(required) - Array of recipient emailssubject(required) - Email subjectbody(required) - Plain text bodycc(optional) - Array of CC recipientsbcc(optional) - Array of BCC recipients
Returns:
{
"success": true,
"message_id": "<generated_id@proton.me>"
}search_emails
Search emails by criteria.
Parameters:
query(required) - Search stringfolder(optional, default: "INBOX") - Folder to searchsearch_in(optional, default: ["subject", "from", "body"]) - Fields to searchlimit(optional, default: 50, max: 50) - Max results
Returns: Same format as list_emails
list_folders
List all mail folders.
Parameters: None
Returns:
{
"folders": [
{"name": "INBOX", "message_count": 42},
{"name": "Sent", "message_count": 128},
{"name": "Drafts", "message_count": 3}
]
}Error Handling
All operations return errors in a consistent format:
{
"error": "Connection to Proton Bridge failed",
"error_type": "ConnectionError",
"details": "Could not connect to 127.0.0.1:1143"
}Common error types:
ConnectionError- Bridge not running or wrong host/portAuthenticationError- Invalid credentialsFolderNotFoundError- Folder doesn't existEmailNotFoundError- Email ID not foundValidationError- Missing required parameters
Troubleshooting
"Connection refused" error
Problem: Cannot connect to Proton Bridge
Solutions:
Verify Proton Bridge is running
Check Bridge ports in Settings (should be 1143/1025)
Ensure no firewall blocking localhost connections
"Authentication failed" error
Problem: Invalid credentials
Solutions:
Use Bridge password, NOT Proton account password
Regenerate Bridge password in Bridge Settings
Check username includes full email (@proton.me)
"Email not found" error
Problem: Invalid email ID
Solutions:
Use
list_emailsto get valid IDsEmail IDs are folder-specific (IMAP UIDs)
Don't reuse IDs after emails are deleted
Attachments not saving
Problem: Permission denied or path doesn't exist
Solutions:
Ensure
ATTACHMENT_DOWNLOAD_PATHis writableServer automatically creates directory
Check disk space
Architecture Overview
Project Structure
proton-mcp-server/
├── server.py # MCP server entry point
├── imap_client.py # IMAP operations module
├── smtp_client.py # SMTP operations module
├── config.py # Configuration management
├── models.py # Email data structures
├── requirements.txt # Python dependencies
├── .env.example # Example configuration
└── README.md # This fileModular Design
The codebase is designed for extensibility:
config.py: Priority-based configuration loader
models.py: Data classes for emails, attachments, responses
imap_client.py: All IMAP operations (reading, searching, listing)
smtp_client.py: All SMTP operations (sending)
server.py: MCP protocol handler and tool definitions
Adding New Features (Phase 2)
To extend functionality:
Add new IMAP operations: Edit
imap_client.pyAdd new SMTP operations: Edit
smtp_client.pyAdd new MCP tools:
Define tool in
server.py::handle_list_tools()Add handler in
server.py::handle_call_tool()
Add new data models: Define in
models.py
Example: Adding "mark as read" functionality:
# imap_client.py
def mark_as_read(self, email_id: str) -> Dict[str, Any]:
# Implementation here
pass
# server.py - add to handle_call_tool()
elif name == "mark_as_read":
email_id = arguments.get("email_id")
result = imap_client.mark_as_read(email_id=email_id)Phase 2 Roadmap
Features planned for future releases:
Reply/forward emails
Mark read/unread
Move emails to folders
Delete emails
Send emails with attachments
Retry logic with exponential backoff
Pagination for large result sets
Result caching
Async operations (if needed)
Technical Notes
IMAP/SMTP Line Endings
Proton Bridge requires CR/LF (\r\n) line endings for authentication. Python's imaplib and smtplib handle this automatically.
Email ID Format
Email IDs are IMAP UIDs (unique identifiers per folder). They are:
Folder-specific (ID "5" in INBOX ≠ ID "5" in Sent)
Persistent within a folder
Sequential but not necessarily consecutive
Date Format
All dates use ISO 8601 format: 2026-02-09T10:30:00Z (UTC timezone)
Attachment Handling
Metadata always returned (filename, size, type)
Content only included if
include_attachments=trueContent is base64-encoded
Files saved to
ATTACHMENT_DOWNLOAD_PATH
Security Considerations
Credentials
Never commit
.envfile to version controlUse Bridge-generated passwords (unique per device)
Rotate Bridge passwords periodically
Network
Bridge only listens on localhost (127.0.0.1)
No external network exposure by default
STARTTLS used for IMAP/SMTP connections
Attachments
Saved to local filesystem (configure secure path)
Consider disk space limits
Clean up old attachments periodically
Contributing
This is a Phase 1 proof of concept. Contributions welcome for:
Bug fixes
Phase 2 features
Documentation improvements
Test coverage
License
[Specify your license here]
Support
For issues and questions:
Check Troubleshooting section above
Verify Proton Bridge is properly configured
Test with Proton Bridge's built-in IMAP/SMTP test
Acknowledgments
Built using:
Python standard library (imaplib, smtplib, email)
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Connect any IMAP/SMTP mailbox to Claude & ChatGPT: search, read, sort, draft. Sends only with OK.
Email infrastructure for AI agents — send, receive, search, and reply to email over MCP.
Email for AI agents: read, search and send from your Gmail, Outlook, Yahoo, iCloud or IMAP inbox.
Connect Gmail, iCloud Mail, Outlook, Yahoo Mail, Fastmail and other IMAP inboxes to ChatGPT, Claude and compatible AI assistants. Find emails by meaning across languages with semantic search. Ask AI to find customer conversations, summarize deadlines and draft follow-ups. Give a sales rep access to a shared outreach inbox or bring email into a compatible CRM. Share an iCloud custom-domain inbox with teammates without their own Apple ID or iCloud+ plan. Search results may be incomplete or stale; separate permissions control mail actions.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to send, read, search, and organize email from Proton Mail accounts via SMTP and IMAP.MIT
- AlicenseAqualityBmaintenanceEnables AI assistants to read, organize, and send Proton Mail through the local Proton Bridge, with careful gating for sending and attachment access.252Apache 2.0
- FlicenseNot gradedqualityCmaintenanceEnables AI assistants to interact with a Proton Mail mailbox through Proton Bridge, supporting listing, searching, reading, sending, and organizing emails.-
- AlicenseBqualityDmaintenanceEnables AI assistants to read, search, send, reply, and organize ProtonMail emails through a local ProtonMail Bridge, with automatic Bridge discovery and pinned TLS verification.23LGPL 3.0