Power your agent
पब्लिशर की अपनी कमांड। PlugMCP एंडपॉइंट नहीं।
Host a copy with our keys and logs.
docker run -i --rm ghcr.io/dominikamann/agent-mail-gateway:0.5.0Claude Code में लोकल कमांड के लिए इंस्टॉल लिंक नहीं है। नीचे दी गई कमांड कॉपी करें और टर्मिनल में चलाएँ।
claude mcp add dominikamann-agent-mail-gateway -- docker run -i --rm ghcr.io/dominikamann/agent-mail-gateway:0.5.0टर्मिनल में चलाएँ।
{ "mcpServers": { "dominikamann-agent-mail-gateway": { "command": "docker", "args": [ "run", "-i", "--rm", "ghcr.io/dominikamann/agent-mail-gateway:0.5.0" ] } }}claude_desktop_config.json
रिमोट URL या आपकी मशीन पर कमांड? दोनों इंस्टॉल में क्या अंतर है
PlugMCP पर चलाएँ
A new server you create. It is not this listing's official endpoint. Use the publisher install when you want their URL and their credentials.
लॉन्च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:
Mailbox access
get_attachment with format: "text"): PDF text
layer built in, images via a vision model or local OCR (Tesseract).Re:/Fwd: and threading.Calendar
Control and safety
name@domain or *@domain). Everything else is invisible to the agent and moved to Trash
(or kept).Review before sending (details below)
Integration
/docs. Agent ──MCP / REST + API key──▶ ┌────────────────────────────────────────┐
│ Auth key → exactly one mailbox │
Agent ◀──signed webhook──────── │ Policy who may write / be written │
│ Review rules · LLM · your policies │
│ Inbound file types · virus · inject.│
│ Converter HTML ⇄ Markdown │
│ Calendar invitations and replies │
│ Mailbox IMAP + instant new-mail push│──IMAP──▶ your mail server
│ Sender SMTP + copy to "Sent" │──SMTP──▶
└────────────────────────────────────────┘
config.yaml + .env (read-only)
Mail stays on your mail server; the gateway only keeps a small SQLite file with its own state.
Use a dedicated mailbox for each agent (for example
[email protected]), not your personal one: by default, mail from senders that are not on the allow list is moved to Trash.
mkdir agent-mail-gateway && cd agent-mail-gateway
curl -LO https://raw.githubusercontent.com/dominikamann/agent-mail-gateway/main/docker-compose.yml
curl -L -o config.yaml https://raw.githubusercontent.com/dominikamann/agent-mail-gateway/main/config.example.yaml
curl -L -o .env https://raw.githubusercontent.com/dominikamann/agent-mail-gateway/main/.env.example
config.yaml: one entry per agent with its mail server, login and allow lists..env (openssl rand -hex 32 makes a good API key).docker compose up -d
curl http://localhost:8080/health # {"status":"ok"}; with a key also that mailbox's state
curl -H "Authorization: Bearer <the AGENT_API_KEY from .env>" http://localhost:8080/v1/mailbox
A minimal mailbox entry:
mailboxes:
- name: assistant
address: [email protected]
api_key: ${AGENT_API_KEY}
imap: { host: mail.yourmailserver.eu, port: 993, security: tls }
smtp: { host: mail.yourmailserver.eu, port: 465, security: tls }
username: [email protected]
password: ${AGENT_MAIL_PASSWORD}
allow_receive_from: [[email protected], "*@yourcompany.eu"]
allow_send_to: [[email protected]]
Every option is explained in docs/configuration.md.
Agents are sometimes sloppy — an email with only an attachment, "please find attached" without
a file, Hello {name}. The gateway checks every outgoing email and invitation before it is
sent. If something is wrong, nothing is sent and the agent gets a clear error with the reasons
(review_rejected), so it can fix the message and try again. Rejected attempts don't count
towards the send limit.
There are three layers; you choose per mailbox:
Rules and the LLM review can block the message, only warn (send anyway and report it), or be switched off; each policy rule either blocks or warns. The check covers new mails, replies, forwards, invitations and their changes, and comments in invitation answers.
review:
rules: block # block | warn | off
llm: # any OpenAI-compatible endpoint, e.g. a local Ollama
url: http://ollama:11434/v1
model: llama3.1:8b
mode: warn # quality check: warn | block | off
policies:
mode: block # what a violation does: block | warn
rules:
- rule: Never share financial information such as revenue, prices, invoices, bank details or salaries.
- rule: Never mention gifts, presents or surprise plans.
recipients: [[email protected]]
- rule: Never send calendar invitations.
recipients: [[email protected]]
Policies also read attachments: text files, PDFs, and images when attachments.read_images is
set. A rule with recipients applies only when one of those people receives the message (To, Cc,
Bcc or invitation attendee). With Ollama the review runs entirely on your
own machine; no mail content leaves your server. Long messages are checked in parts — nothing
is cut off; part size and limits are configurable to fit your model's context window. The built-in review prompt can be replaced or
extended — see docs/configuration.md.
Allow lists decide who can reach your agent; these checks look at what arrives. For each
check you choose what a finding does: hide the message (like a sender that is not allowed),
flag it (the agent sees it with a warning and cannot download dangerous files), or off.
With skip_senders a check is skipped for trusted senders — so you can still send your agent
instructions by mail.
attachments:
clamav: { host: clamav, port: 3310 } # optional, see docker-compose.yml
read_images: { engine: ocr, languages: [eng, deu] } # or a vision model
inbound_checks:
prompt_injection:
action: flag
skip_senders: [[email protected]] # your own instructions are not flagged
dangerous_attachment: { action: hide }
Images are read by a vision model (e.g. qwen2.5vl in Ollama) or by OCR inside the gateway
(Tesseract); PDFs by pdf.js.
Everything runs on your own machine if you want it to. Details:
docs/configuration.md.
Point any MCP client at http://<host>:8080/mcp with the header
Authorization: Bearer <api key>, or use the stdio bridge.
# send a message
curl -X POST http://localhost:8080/v1/messages \
-H "Authorization: Bearer $AGENT_API_KEY" -H "Content-Type: application/json" \
-d '{"to":["[email protected]"],"subject":"Daily report","body_markdown":"All **green** today."}'
# unread mail
curl -H "Authorization: Bearer $AGENT_API_KEY" "http://localhost:8080/v1/messages?unread=true"
All endpoints, error codes and the webhook format: docs/api.md.
Connect the MCP server in ~/.hermes/config.yaml and install the plugin that teaches your
agents to use their mailbox safely:
hermes plugins install dominikamann/agent-mail-gateway/integrations/hermes/agent-mail-gateway --enable
Step by step, including waking the agent on new mail: docs/hermes.md.
Run the gateway on a private network or behind a reverse proxy with TLS — API keys travel in
the Authorization header. Report vulnerabilities privately as described in
SECURITY.md.
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.
{ "mcpServers": { "dominikamann-agent-mail-gateway": { "command": "docker", "args": [ "run", "-i", "--rm", "ghcr.io/dominikamann/agent-mail-gateway:0.5.0" ] } }}टूल
अभी टूल सूची नहीं है। रिमोट सर्वर को पहले हेल्थ चेक के बाद सूची मिलती है।
FAQ
इस पेज पर Cursor, Claude Desktop, Claude Code या VS Code के लिए stdio कॉन्फ़िग कॉपी करें। यह पब्लिशर का इंस्टॉल इस्तेमाल करता है, PlugMCP प्रॉक्सी नहीं।
इस रिकॉर्ड में कोई ज़रूरी एनवायरनमेंट वेरिएबल दर्ज नहीं है।
Agent Mail Gateway stdio पर लोकल चलता है।
पिछली जाँच 2026-10-28 को हुई। 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.