ProtonMail MCP Server
This server lets AI agents manage ProtonMail through Proton Bridge: send, read, search, draft, and organize email, including attachments, threading, folders, and connection health.
Send email: send messages with to/cc/bcc, HTML, priority, reply-to, threading headers, and attachments; send test emails.
Read email: fetch folder emails with pagination; get full email by ID with body/headers/attachment metadata; download attachments, using index for duplicate filenames.
Search email: filter by from, to, subject, date range, read status, starred status, attachment presence, and full-text query.
Manage drafts: create, create threaded reply drafts, update, delete, and send drafts via SMTP.
Act on emails: mark read/unread, star/unstar, move between folders, and soft-delete to Trash; permanent delete only from Trash.
Manage folders: list all folders with message counts and force-refresh the folder list.
Check system: get SMTP and IMAP connection status.
Threading support: correctly thread replies using In-Reply-To/References; create_reply_draft derives recipients, Re: subject, and threading headers.
Transports: run locally via stdio or remotely via Streamable HTTP with a health check.
Email management through ProtonMail and Proton Bridge, including sending, reading, searching, and organizing emails.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@ProtonMail MCP Server show me my unread emails"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
ProtonMail MCP Server
Email management for AI agents through ProtonMail and Proton Bridge
Send, read, search, and organize emails from Claude Code, Claude Desktop, Cursor, or any MCP-compatible client.
Quick start
Install from npm (recommended)
npx @ronamosa/protonmail-pro-mcpOr install globally:
npm install -g @ronamosa/protonmail-pro-mcp
protonmail-pro-mcpInstall from source
git clone https://github.com/ronamosa/protonmail-pro-mcp.git
cd protonmail-pro-mcp
npm install
npm linkVerify the install:
which protonmail-pro-mcpPrerequisites -- Node.js >= 18 and Proton Bridge running locally.
Related MCP server: Proton Mail MCP Server
Configuration
cp .env.example .env # then fill in your credentialsVariable | Required | Default | Description |
| Yes | -- | Your ProtonMail email address |
| Yes | -- | Proton Bridge password (not your login password) |
|
| SMTP server host | |
|
| SMTP server port | |
|
| IMAP host (Proton Bridge) | |
|
| IMAP port (Proton Bridge) | |
|
| Enable TLS for IMAP | |
|
| HTTP transport port | |
|
| Enable debug logging |
Security --
PROTONMAIL_PASSWORDis the bridge-generated password, not your ProtonMail login. Never commit.envfiles.
Local development (Cursor)
To test this repo's built output instead of the published npm package:
npm run build
cp .cursor/mcp.json.example .cursor/mcp.json # add your Bridge credentialsRestart Cursor MCP (Settings → MCP → reload). The local server runs node dist/index.js from this workspace.
Manual attachment test (Bridge required)
Sends a self-addressed email with two attachments named dupe.txt, then verifies ambiguous lookup and index-based retrieval:
cp .env.example .env # if you have not already
npm run build
npm run test:attachments:manualThe script leaves the test email in INBOX so you can also exercise get_email_by_id and get_attachment from Cursor.
Usage
Add to ~/.claude.json under mcpServers, or run claude mcp add:
{
"mcpServers": {
"protonmail": {
"type": "stdio",
"command": "npx",
"args": ["@ronamosa/protonmail-pro-mcp"],
"env": {
"PROTONMAIL_USERNAME": "you@protonmail.com",
"PROTONMAIL_PASSWORD": "your-bridge-password"
}
}
}
}Add to ~/.config/claude/claude_desktop_config.json:
{
"mcpServers": {
"protonmail": {
"command": "npx",
"args": ["@ronamosa/protonmail-pro-mcp"],
"env": {
"PROTONMAIL_USERNAME": "you@protonmail.com",
"PROTONMAIL_PASSWORD": "your-bridge-password"
}
}
}
}Add to .cursor/mcp.json in your project:
{
"mcpServers": {
"protonmail": {
"command": "npx",
"args": ["@ronamosa/protonmail-pro-mcp"],
"env": {
"PROTONMAIL_USERNAME": "you@protonmail.com",
"PROTONMAIL_PASSWORD": "your-bridge-password"
}
}
}
}protonmail-pro-mcp --transport http --port 3000Endpoints: POST /mcp, GET /mcp, DELETE /mcp (Streamable HTTP). Health check at GET /health.
Tools
Tool | Description | |
Send |
| Send with to/cc/bcc, HTML, priority, reply-to, threading, attachments |
| Quick test email to verify SMTP | |
Read |
| Fetch from a folder with pagination |
| Full email with body, headers, and attachment metadata (includes | |
| Download an attachment by | |
| Filter by from, to, subject, date, flags, attachments | |
Drafts |
| Create a new draft in the Drafts folder |
| Draft a threaded reply — derives recipients, | |
| Replace an existing draft with new content | |
| Delete a draft | |
| Send a draft via SMTP and remove it from Drafts | |
Act |
| Mark read or unread |
| Star or unstar | |
| Move between folders | |
| Soft-delete to Trash; permanent only if already in Trash | |
Folders |
| List all folders with message counts |
| Force-refresh folder list | |
System |
| SMTP and IMAP connection health |
Threading
Replies thread when the message carries In-Reply-To and References (RFC 5322 §3.6.4).
Subject-line matching alone is not threading — Gmail happens to group on it, most clients do not.
create_reply_draft is the tool to reach for: give it the parent's emailId and a body, and it
derives the recipients, the Re: subject and both headers itself. Assembling the chain by hand is
easy to get wrong, and a wrong chain threads one level deep and then breaks.
create_reply_draft({ emailId: "INBOX:4821", body: "Sounds good." })create_draft, update_draft and send_email also accept inReplyTo and references directly
for cases the helper does not cover.
Every outgoing message now carries a generated Message-ID, so replies to your own sent mail
thread as well. send_draft forwards the draft's threading headers to SMTP — without that a
correctly threaded draft would send un-threaded.
A parent with no Message-ID cannot be threaded to. create_reply_draft returns
threaded: false in that case rather than pretending otherwise.
Architecture
src/
index.ts Entry point, transport selection, graceful shutdown
server.ts McpServer setup, tool registration
config.ts Zod-validated environment configuration
logger.ts Structured stderr logger with credential redaction
types.ts Shared TypeScript interfaces
services/
smtp.ts nodemailer wrapper (lazy connection)
imap.ts imapflow + mailparser wrapper (lazy connection, auto-reconnect)
tools/
sending.ts send_email, send_test_email
reading.ts get_emails, get_email_by_id, search_emails
drafts.ts create_draft, create_reply_draft, update_draft, delete_draft, send_draft
actions.ts mark_email_read, star_email, move_email, delete_email
folders.ts get_folders, sync_folders
system.ts get_connection_statusMcpServer API (SDK v1.29+) with Zod input validation on every tool
Tool annotations (
readOnlyHint,destructiveHint,openWorldHint) per MCP specDual transport -- stdio for local use, Streamable HTTP for remote deployment
Lazy connections -- SMTP and IMAP connect on first use, not at startup
Credential redaction -- passwords scrubbed from all log output
Soft delete --
delete_emailmoves to Trash first; permanent delete only from Trash
Development
npm run dev # Watch mode with tsx
npm run typecheck # Type checking without emit
npm run lint # ESLint
npm run format # Prettier
npm test # Run tests
npm run build # Rebuild (symlink picks up changes automatically)Credits
Originally scaffolded from anyrxo/protonmail-pro-mcp. Completely rewritten with modern MCP SDK, Zod validation, dual transport, and full tool implementations.
License
MIT
Available Tools
18 toolscreate_draftB
Create a new draft email in the Drafts folder
Inputs: body (required), subject (required), cc, to, +5 more.
create_reply_draftA
Create a draft reply to an existing email, threaded correctly. Derives recipients, the Re: subject and the In-Reply-To/References headers from the parent message. Does not send.
Inputs: body (required), emailId (required), cc, to, +3 more.
delete_draftBDestructive
Delete a draft email
Inputs: draftId (required).
delete_emailADestructive
Delete an email. Moves to Trash first; permanently deletes only if already in Trash.
Inputs: emailId (required).
get_attachmentCRead-only
Download a specific attachment from an email
Inputs: emailId (required), filename (required), index.
get_connection_statusARead-only
Check the current SMTP and IMAP connection status
Inputs: no named parameters.
get_email_by_idARead-only
Get a specific email by its ID with full body and headers
Inputs: emailId (required), format, includeBody.
get_emailsARead-only
Fetch emails from a folder with pagination
Inputs: limit, folder, offset.
get_foldersARead-only
List all email folders with message counts
Inputs: no named parameters.
mark_email_readB
Mark an email as read or unread
Inputs: emailId (required), isRead.
move_emailC
Move an email to a different folder
Inputs: emailId (required), targetFolder (required).
search_emailsARead-only
Search emails with advanced filters across from, to, subject, dates, and flags
Inputs: to, from, limit, query, +7 more.
send_draftA
Send an existing draft via SMTP and remove it from Drafts
Inputs: draftId (required).
send_emailB
Send an email via ProtonMail SMTP with support for CC, BCC, HTML, priority, and attachments
Inputs: to (required), body (required), subject (required), cc, +7 more.
send_test_emailA
Send a quick test email to verify SMTP is working
Inputs: to (required), customMessage.
star_emailA
Star or unstar an email
Inputs: emailId (required), isStarred.
sync_foldersARead-only
Force a refresh of the folder list from the IMAP server
Inputs: no named parameters.
update_draftB
Update an existing draft by replacing it with new content
Inputs: body (required), draftId (required), subject (required), cc, +6 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 18 tools
Most tools target clearly distinct resources and actions (folders, emails, drafts, attachments, connection). Minor overlap between get_emails/get_email_by_id/search_emails and between sync_folders/get_folders, though descriptions differentiate list vs. fetch-by-id vs. search and refresh vs. list.
Every tool follows a consistent snake_case verb_noun pattern (get_emails, create_draft, send_email, mark_email_read, move_email). The convention is applied uniformly across all 18 tools with no deviations.
18 tools is slightly heavy but justified for a full email client spanning folders, reading, sending, drafts, attachments, search, and flags. Each tool earns its place with little redundancy.
Covers core lifecycle: list/read/search, send, draft create/update/send/delete, attachments, folders, move, delete, and flags. Gaps include direct reply/forward sending and thread/conversation views, but most workflows are workable.
Maintenance
Related MCP Connectors
Email infrastructure for AI agents — send, receive, search, and reply to email over MCP.
Email inboxes for AI agents: send, receive, reply, search, and manage threaded email over MCP.
Connect any IMAP/SMTP mailbox to Claude & ChatGPT: search, read, sort, draft. Sends only with OK.
Your agent needs a mailbox of its own — to receive, thread, draft and send, with attachments, without borrowing your personal inbox or your company's SMTP. **What you can ask for** • "Create an inbox for this agent and tell me its address." • "Read the new messages in this thread and draft a reply." • "Send this message with the attachment and wait for the response." • "Search this inbox for everything from that domain." • "Show delivery metrics and the events on this inbox." **How to use it** Point any MCP client at https://mcp.aisa.one/mail/mcp and sign in with OAuth — there is no key to create or paste. 49 tools: create and delete inboxes, list and read messages, raw message bodies, attachments, threads, drafts and draft attachments, send and reply, message search, inbox events, metrics, and list entries — reads and writes. **Why this rather than the source** A real inbox an agent owns, rather than an SMTP credential it borrows from a human. **It is also a door to the rest** The same login reaches 26 sources and 580+ operations. Find the contact elsewhere in the catalogue, then write to them from here — without adding a second server. **What it costs** Finding and inspecting an operation is free. Running one is billed per call at API prices, with no seat and no monthly minimum, and every call takes max_price_usd so an agent cannot overspend by accident. **Where else it reaches** https://mcp.aisa.one/sales/mcp finds the person to write to.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to send, read, search, and organize email from Proton Mail accounts via SMTP and IMAP.105 npmMIT
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to send, read, search, and organize Proton Mail email via SMTP and IMAP through the Model Context Protocol.MIT
- AlicenseNot gradedqualityDmaintenanceProvides read-only access to Proton Mail via MCP, enabling AI agents to list accounts/folders, search messages, and read emails using Proton Mail Bridge's local IMAP server.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