Self-hosted email MCP server & REST gateway: give each AI agent its own IMAP/SMTP mailbox with sender/recipient allow lists, HTML-to-Markdown, attachments and calendar invites. One Docker container.
Give every AI agent its own email address — without giving it the keys to the mailbox.
Agent Mail Gateway is a small self-hosted service (one Docker container) that sits between your AI agents and ordinary mailboxes on your existing mail server. Each agent gets one API key for exactly one mailbox. Through the gateway it can read and answer mail, send attachments and manage calendar invitations — but only with the people you allow, and every outgoing message is checked before it leaves.
Agents talk to it over MCP (Model Context Protocol) or a plain REST API. Mail arrives as Markdown instead of HTML, which saves a lot of tokens.
Giving an agent the IMAP/SMTP password of a mailbox means it can read everything, write to anyone, and a single prompt injection in an incoming email can make it leak data or spam people. The gateway keeps the password to itself and enforces your rules on every request:
Without the gateway With the gateway ------ Agent knows the mailbox password Agent only has an API key for its mailbox Reads every mail, incl. spam and phishing Sees only mail from senders you allow Can write to anyone Can only write to recipients you allow Sloppy or wrong mails go out Every mail is checked before sending (rules, optional LLM, your policies) HTML mails cost thousands of tokens Mail arrives as compact Markdown
Mailbox access - List, search, read, mark, delete; attachments in and out — as text, base64 or straight from a received message, so agents never have to juggle base64 for a CSV. - Reply (incl. reply-all) and forward — the gateway fills in recipients, Re:/Fwd:
From the project README.
Add the radar badge to your README — it shows your project was picked up by MCP Radar and links to this page:
[](https://mcp.liqiwa.com/s/dominikamann--agent-mail-gateway.html)
Self-hosted event engine for any mailbox: IMAP, JMAP and inbound SMTP in, one replayable event log out, with safe reversible actions, scoped tokens for AI agents, and an MCP server.
docouno/notariumFile-first knowledge base for humans and AI agents — self-hosted Markdown notes with a web editor and a built-in MCP server.
rwnalds/engramSelf-hosted MCP server + dashboard giving Claude Code, Cursor & Hermes agents shared long-term memory over a git-backed markdown vault. Agent-native, Obsidian-compatible second brain — markdown RAG, n
bybit-exchange/kaasTurn scattered notes, docs and transcripts into a queryable Markdown wiki — an LLM knowledge-base compiler with MCP access, no embeddings, self-hosted.
iflytek/dolphin-mcp-pilotProduction-ready MCP server that lets AI agents build, schedule, run and recover Apache DolphinScheduler data pipelines - 53+ tools, beyond read-only.
herry2059/project-os-for-codexOpen-source control plane for Codex projects: Git-backed context, visible agent progress, scoped MCP access, resumable work, and safe handoffs.
The top new MCP servers of the week, every Monday. No spam, unsubscribe anytime.