proton-mail-bridge-mcp: Instructions file for Claude Code

CLAUDE.md

proton-mail-bridge-mcp CLAUDE.md is an instructions file for Claude Code from apexxapps/proton-mail-bridge-mcp. It costs 2,555 tokens per session, scanned C, original, MIT.

A set of Claude Code instructions for using an MCP server that connects to ProtonMail through Proton Bridge. Proton Bridge is Proton's local connector that provides mail access through IMAP and SMTP.

In plain words
What is it for?
Guiding development and use of the ProtonMail connector, including its architecture, dependency, and relationship to other local tools.
Why use it?
It explains the required setup and design, including that decrypted mail stays on the computer and that a paid Proton plan is required for Bridge.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md. Also seen: mentions Claude Code; built for cline.

This is apexxapps/proton-mail-bridge-mcp's own configuration. It tells Claude Code how to work on proton-mail-bridge-mcp itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything proton-mail-bridge-mcp configures →

Reuse

Borrowing it

Nothing to install: this file belongs to apexxapps/proton-mail-bridge-mcp. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/apexxapps/proton-mail-bridge-mcp/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/apexxapps/proton-mail-bridge-mcp

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for proton-mail-bridge-mcp CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/apexxapps/proton-mail-bridge-mcp/claude-md/github.svg)](https://agentmods.dev/instructions/apexxapps/proton-mail-bridge-mcp/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/apexxapps/proton-mail-bridge-mcp/claude-md"><img src="https://agentmods.dev/badge/instructions/apexxapps/proton-mail-bridge-mcp/claude-md/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for proton-mail-bridge-mcp CLAUDE.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/apexxapps/proton-mail-bridge-mcp/claude-md"><img src="https://agentmods.dev/badge/instructions/apexxapps/proton-mail-bridge-mcp/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 2,555 This file is loaded in full into every session.
When invoked 2,555 The same file — it is already loaded in full.
Security scan C 2 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.02555 $0.02555
Opus 5 $0.01277 $0.01277
Sonnet 5 $0.00511 $0.00511
Haiku 4.5 $0.00255 $0.00255

Measured 9d ago against content hash df9661e17923, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade C, and why

proton-mail-bridge-mcp CLAUDE.md scanned grade C with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Downloads and executes remote codehighSupply chain

curl | sh runs whatever the server returns today, which is not necessarily what it returned when this was reviewed.

a `curl | bash` installer on-ramp (optional — `npx` already makes install one line, so lower value

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

a `curl | bash` installer on-ramp (optional — `npx` already makes install one line, so lower value
CLAUDE.md · 135 lines

How it starts

The opening of the file, as written. The whole thing — 135 lines — stays where its author put it; the contents beside it link to each section on GitHub.

proton-mail-bridge-mcp

What this is

A small, free, open-source MCP server that gives any MCP client (Claude Code, Claude Desktop, Cursor, Cline, …) access to a user's ProtonMail — search, read, draft, send, organise. It's a standalone project, not part of BrainBoxx, but it's a deliberate gateway to it (see Positioning).

Scaffolded 2026-08-17 as a sibling folder to brainboxx/. Born out of a BrainBoxx conversation: "CLI having Gmail is great, can we do Proton?" → the clean answer is a local MCP server, and it doesn't belong inside BrainBoxx (BrainBoxx is a transport/control layer; an MCP server is an agent capability — orthogonal). It composes for free: pair the machine with BrainBoxx and you drive your Proton from your phone with zero code shared between the two.

The hard dependency — read this first

There is no public ProtonMail API (Proton is end-to-end encrypted by design). The only sanctioned way in is Proton Bridge, which Proton ships to expose a local IMAP + SMTP server on 127.0.0.1. So:

  • This server talks IMAP/SMTP to Bridge on localhost. Decrypted mail never leaves the machine.
  • Bridge needs a PAID Proton plan (Mail Plus / Unlimited). Free accounts can't run Bridge → can't use this. This scopes the audience; state it honestly everywhere (README does).
  • Bridge hands out per-account generated IMAP/SMTP credentials — NOT the Proton login password.
  • Bridge defaults: IMAP 1143, SMTP 1025, both STARTTLS with a self-signed cert. We trust the self-signed cert for localhost by default (allowSelfSigned, on) — expected for Bridge, not a smell.
  • Bridge runs GUI on Mac/Win, headless via protonmail-bridge --cli on servers.

Architecture

Node, ESM, MCP over stdio (the client spawns us; stdout is JSON-RPC ONLY — all logging → stderr). Files in src/:

  • index.js — bin entry (#!/usr/bin/env node). Builds the McpServer, registers tools, connects StdioServerTransport. Does NOT hard-fail on missing config (so the client can still list tools); individual tool calls throw a helpful error if unconfigured.
  • config.js — loads config. Precedence: PROTONMAIL_* env → JSON file ($PROTONMAIL_MCP_CONFIG or ~/.config/proton-mail-bridge-mcp/config.json) → Bridge defaults. assertConfigured gives the friendly "you're missing X" error.
  • mail.js — the only place that touches Bridge. Connect-per-operation (imapflow client built, connected, used, logged out each call) — deliberate: sporadic MCP calls + a parked IMAP socket goes stale, so reconnecting against localhost is the robust trade. withImap / withMailbox wrappers. IMAP via imapflow, SMTP via nodemailer, draft MIME via nodemailer's MailComposer (imported from nodemailer/lib/mail-composer/index.js — it's NOT a named export), parsing via mailparser simpleParser. "Delete" = move to Trash (never hard-expunge).
  • format.jscleanMessage turns parsed MIME into tidy JSON for an LLM; stripQuoted trims quoted reply history + -- signatures so summaries don't drown in forwarded chains (pass full:true to keep everything).
  • tools.js — the MCP tool surface. Deliberately small: exactly 8 tools (Simon's scope call, 2026-08-17 — the "plain and simple" niche vs the 30-tool incumbent proton-mail-mcp): search_mail (no filter = recent inbox), get_message, download_attachment, create_draft, send_message, reply, reply_all, forward. READ (first 3) always registered; WRITE (other 5) skipped entirely when readOnly (→ 3 tools). guard() wraps every handler so a throw becomes a clean MCP error, not a dead server. The sharp tools (send/reply/reply_all/forward) are named + described so the client's per-tool approval is the gate — we don't reinvent approval, we make it obvious. reply/reply_all/forward send immediately unless draft:true (→ Drafts). Outgoing attachments: any write tool takes attachments: [localPath] — absolute or relative to cwd, ~-expanded, read off disk via nodemailer (attachLocal); forward carries the original's attachments as bytes too. The BrainBoxx angle: email a file straight out of the brain you're in. HTML email: compose/reply/forward accept body (plain) OR html (formatted); bodyParts() always adds a plain-text alternative (via htmlToText) so it's proper multipart/alternative, and replies/forwards quote the original as an HTML blockquote (quoteHtml). Reading HTML-only mail: format.js htmlToText fallback so get_message isn't blank on HTML-only messages. Deliberately CUT (do NOT re-add without Simon — "plain and simple" is the positioning): mark read/unread, move/archive/trash, folders/labels, bulk ops, analytics, threads.
  • setup.jsnpx proton-mail-bridge-mcp setup: interactive first-run wizard (the onboarding differentiator vs the incumbent). Mirrors Bridge's Mailbox details panel field-for-field so users paste via Bridge's copy buttons; masked password prompt (TTY only); tests IMAP and SMTP (verifySmtp, timeout-guarded) before saving via saveConfig (0600). Wired as an argv branch in index.js alongside doctor. ⚠️ Testing note: piped stdin drops buffered readline lines between questions — test with paced input or a pty, not a bare printf | node.
  • doctor.jsnpx proton-mail-bridge-mcp doctor: human-facing preflight. Connects, authenticates, lists mailboxes → setup problems surface here with a clear message, not mid-conversation. (Wire the doctor subcommand as an argv branch in index.js if we want proton-mail-bridge-mcp doctor rather than npm run doctor / a separate bin — currently it's scripts.doctor + standalone.)

Read the full file on GitHub · 135 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 135 lines · 2,555 tokens per session scan C df9661e17923

Subscribe to this mod's changes

proton-mail-bridge-mcp CLAUDE.md is an instructions file published in the GitHub repository apexxapps/proton-mail-bridge-mcp (0 stars, last pushed 23d ago), licensed MIT. It adds 2,555 tokens to every session, about $0.0128 per session on Opus 5. A static security scan graded it C with 2 findings (downloads and executes remote code, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other instructions, from other repositories

next.js AGENTS.md

AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,296 tokens

codex AGENTS.md

AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.

openai/codex · 5,153 tokens

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 6,785 tokens

spec-kit AGENTS.md

AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.

github/spec-kit · 7,104 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).

microsoft/vscode · 5,001 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,469 tokens