| Crates.io | protonmail-mcp-server |
| lib.rs | protonmail-mcp-server |
| version | 2026.1.25 |
| created_at | 2026-01-22 17:15:58.840599+00 |
| updated_at | 2026-01-25 14:03:16.528373+00 |
| description | MCP server for IMAP email access via ProtonMail Bridge |
| homepage | |
| repository | https://github.com/tensor-templar/protonmail-mcp-server |
| max_upload_size | |
| id | 2062233 |
| size | 173,095 |
Unofficial IMAP-backed MCP (Model Context Protocol) server for ProtonMail Bridge. Exposes mailbox operations as MCP tools so AI assistants can list, search, and retrieve mail through a local Bridge connection.
# From crates.io (recommended)
cargo install protonmail-mcp-server --features http
# Or from source
git clone https://github.com/tensor-templar/protonmail-mcp-server
cd protonmail-mcp-server
cargo install --path . --features http
cp .env.example .env
# Edit .env with your IMAP and MCP settings
protonmail-mcp-server
┌─────────────┐ HTTPS/SSE ┌──────────────────┐ IMAP
│ Agent 1 │◄──────────────────►│ │◄──────────►┌────────────────┐
├─────────────┤ │ MCP Server │ │ ProtonMail │
│ Agent 2 │◄──────────────────►│ (HTTP+SSE) │◄──────────►│ Bridge │
├─────────────┤ │ │ │ │
│ Agent N │◄──────────────────►│ Per-session IMAP │◄──────────►│ localhost:1143 │
└─────────────┘ └──────────────────┘ └────────────────┘
| Variable | Default | Description |
|---|---|---|
MCP_TRANSPORT |
stdio |
Transport mode: stdio or http |
MCP_HTTP_BIND |
127.0.0.1:8080 |
HTTP server bind address |
MCP_AUTH_TOKEN |
(required for http) | Bearer token for authentication |
MCP_SSE_KEEPALIVE |
true |
Enable SSE keep-alive pings (see note below) |
Note: If using Python MCP SDK < 1.25.0, set
MCP_SSE_KEEPALIVE=falseto avoid JSON parsing errors. The older SDK can't handle empty SSE data fields sent as keep-alive pings. See: python-sdk#1672
# Via environment
MCP_TRANSPORT=http MCP_AUTH_TOKEN=secret123 ./target/release/protonmail-mcp-server
# Via CLI override
./target/release/protonmail-mcp-server --transport http --bind 0.0.0.0:8080
# Initialize session
curl -X POST http://localhost:8080/mcp \
-H "Authorization: Bearer secret123" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"my-agent","version":"1.0"}}}'
127.0.0.1 (localhost only). Use 0.0.0.0 for remote access.MCP_AUTH_TOKEN is mandatory for HTTP mode.| Tool | Description | Annotations |
|---|---|---|
list_mailboxes |
List available mailboxes | read-only |
search_emails |
Search emails with date filtering | read-only |
get_email |
Fetch full email content by ID | read-only |
get_current_date |
Get current UTC timestamp | read-only |
list_tags |
List available flags for a mailbox | read-only |
get_email_tags |
Get flags on a specific email | read-only |
apply_tag |
Apply a flag to an email | idempotent |
remove_tag |
Remove a flag from an email | destructive |
move_email |
Move email to another folder | destructive |
get_attachment |
Download attachment (file or base64) | destructive, open-world |
Support this project:
Please include your name and project in the payment notes to be listed in SPONSORS.md.