Mail Bridge
Connects to a Gmail mailbox via IMAP/SMTP using an app password, enabling agents to list folders, read and search messages and attachments, organize mail, create drafts, and send drafts when enabled.
Connects to a GMX mailbox via IMAP/SMTP, enabling agents to list folders, read and search messages and attachments, organize mail, create drafts, and send drafts when enabled.
Connects to a Hetzner mailbox via IMAP/SMTP, enabling agents to list folders, read and search messages and attachments, organize mail, create drafts, and send drafts when enabled.
Connects to iCloud Mail via IMAP/SMTP and iCloud calendars via CalDAV, enabling agents to read and search mail, manage drafts, organize messages, and read or create calendar events.
Connects to an IONOS mailbox via IMAP/SMTP, enabling agents to list folders, read and search messages and attachments, organize mail, create drafts, and send drafts when enabled.
Connects to a mailbox.org mailbox via IMAP/SMTP, enabling agents to list folders, read and search messages and attachments, organize mail, create drafts, and send drafts when enabled.
Connects to a WEB.DE mailbox via IMAP/SMTP, enabling agents to list folders, read and search messages and attachments, organize mail, create drafts, and send drafts when enabled.
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.
Mail Bridge
English · Deutsch
Mail Bridge connects your email mailboxes and your calendar to Claude, ChatGPT and other AI agents. You host it yourself. Agents read, sort, write drafts and, if you allow it, send. You keep working in your normal mail app at the same time.
It is a remote MCP server with its own OAuth 2.1 authorisation server and a web dashboard. The dashboard is available in English and German.
Features
Several mailboxes per connection. An agent sees exactly the mailboxes you select when you connect it.
Read, search, organise. Read mails and attachments (PDF as text), move, flag, move to trash. Nothing is ever deleted for good.
Drafts. Replies with the right subject and threading, attachments (uploaded or taken from another mail), HTML mails and a signature per mailbox. Drafts are normal drafts, visible in every mail app.
Alias addresses. Replies go out from the address the mail was sent to, if that address is listed as an alias of the mailbox.
Sending with a limit.
send_draftonly sends messages that already sit in the Drafts folder and are marked as drafts. You set the daily limit in the dashboard (0 = unlimited). Sending is off server-wide until you setALLOW_SEND=true.Unsubscribe from newsletters. Using the mail's
List-Unsubscribeheader: RFC 8058 one-click, or an unsubscribe mail as a draft.Calendar. Read and create events via CalDAV (tested with iCloud). Deleting is not possible.
Morning overview.
triage_overviewshows unread and unanswered mail across all mailboxes.Dashboard. Mailboxes with a connection test before saving, presets for common providers, connected agents and their permissions, disconnect with one click, activity log of every action (without mail content).
Why it is built this way: docs/PERSONAS.md.
Related MCP server: Fastmail MCP Server (Unofficial)
What is stored on the server
Mailbox credentials (AES-256-GCM encrypted), OAuth clients, hashed tokens, settings and the activity log of the last 90 days. No mail. Content is fetched live from your mail provider on every call and dropped after the answer.
Quick start with Docker Compose
git clone https://github.com/tillheidrich/mail-bridge-mcp.git
cd mail-bridge-mcp
cp .env.example .env
# Fill in BASE_URL, ENCRYPTION_KEY, SESSION_SECRET and ADMIN_PASSWORD in .env
openssl rand -hex 32 # once for ENCRYPTION_KEY, once for SESSION_SECRET
docker compose up -dThe bridge listens on 127.0.0.1:3000. Put a reverse proxy with HTTPS in front (Caddy, Traefik, nginx, Coolify). Claude and ChatGPT only connect over HTTPS.
Important: keep ENCRYPTION_KEY safe, for example in a password manager. If it is lost, all mailbox passwords have to be entered again.
Then sign in at BASE_URL as admin with ADMIN_PASSWORD, set your own password and remove ADMIN_PASSWORD from .env.
Configuration
Variable | Required | Meaning |
| yes | Public https address, without trailing slash |
| yes | 64 hex characters, encrypts the mailbox passwords |
| yes | At least 32 random characters |
| first start | Password for the user |
| no |
|
| no | Initial daily send limit, default 100. Changeable in the dashboard |
| no | Sender name if none is set for the mailbox |
| no |
|
| no | Time zone for events and times in the dashboard, default |
| no | Allowed CalDAV servers, default |
| no | Number of proxies in front of the bridge. Default 1 with https, else 0 |
| no |
|
| no |
|
Connect Claude and ChatGPT
The MCP address is shown at the top of the dashboard: BASE_URL/mcp.
Claude: Settings → Connectors → Add custom connector → enter the address.
ChatGPT: chatgpt.com/plugins → “Create MCP App” → enter the address. Depending on your plan, developer mode has to be on.
On first connect the bridge opens in your browser. There you choose mailboxes and permissions for exactly this connection:
Permission | Allows |
| List folders |
| Read mails, attachments, the overview and the signature |
| Search |
| Move, flag, move to trash, one-click unsubscribe |
| Create drafts, store the signature |
| Send existing drafts (only with |
| Read calendars |
| Create events |
An agent only sees the tools it has a permission for.
Tools
list_accounts, list_folders, list_messages, read_message, read_attachment, search_messages, triage_overview, move_message, flag_message, unsubscribe, create_draft, send_draft, get_signature, set_signature, list_calendars, list_events, create_event.
Suggested working rules for your agent: skills/mail-assistant.md.
Providers
The form has presets for IONOS, Strato, All-Inkl, Hetzner, mailbox.org, Posteo, GMX, WEB.DE, Telekom, Gmail (app password) and iCloud. Any other provider with IMAP and SMTP works with its own server settings.
Microsoft 365 and Outlook.com no longer accept password logins and are not supported at the moment.
Security
Threat model, limits and how to report a vulnerability: SECURITY.md. In short:
Every agent gets its own token with its own permissions. Disconnecting in the dashboard locks it out immediately.
Mail content is data for agents, not instructions; the tool descriptions say so. Prompt injection cannot be ruled out inside the model, which is why sending, senders, the send limit and deleting are restricted outside the model.
The bridge only connects to public mail and calendar servers and never fetches URLs an agent passes in.
Development
npm ci --include=dev
npm run dev # tsx, port 3000
npm test # node:test with its own database in a temp folder
npm run buildTo test against a mail server on your local network: ALLOW_PRIVATE_MAIL_HOSTS=true (development only).
Contributions are welcome. Please open an issue first; for security issues use the route in SECURITY.md.
Origin and licence
Mail Bridge builds on imap-mcp-server by Michael Krasselt (OAuth server, IMAP access, basic tools) and adds several mailboxes per connection, drafts, sending with a limit, calendar, unsubscribe, the activity log and the dashboard.
MIT licence, see LICENSE. Built by Heidrich Digital.
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
Email, calendar and contacts for AI agents: Gmail, Microsoft 365 and IMAP accounts behind one API.
Gmail, Outlook, iCloud, Fastmail and any IMAP mailbox for your agent. Scoped OAuth, approved sends.
Give AI agents their own email inboxes: list, read and send mail via scoped, revocable OAuth grants.
- MyAgentMailDeprecatedcom.myagentmail
Email inboxes and calendars for AI agents: send, receive, search, draft and schedule.
Related MCP Servers
- AlicenseAqualityBmaintenanceEnables AI apps to securely read, search, organize, draft, attach files to, and send email across up to five self-hosted IMAP/SMTP mailboxes, with sending only after explicit user approval.18AGPL 3.0
- AlicenseNot gradedqualityAmaintenanceEnables AI assistants to access and manage email, contacts, and calendar data over JMAP/CalDAV/WebDAV, including searching, sending, threading, attachments, contacts, events, and mailbox operations.MIT
- AlicenseNot gradedqualityCmaintenanceEnables multiple AI assistants to share one self-hosted connection to IMAP mailboxes for searching, reading, organizing, and drafting messages, with optional sending after approval.MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI apps to search, read, summarise, thread, flag, file, draft, send and open attachments in IMAP and SMTP mailboxes, with each user signing in to their own mailbox. Self-hosted and bound to operator-configured mail servers, it keeps passwords sealed inside per-connection tokens so every tool call acts only as the mailbox owner.AGPL 3.0