Skip to main content
ClaudeWave
dominikamann avatar
dominikamann

agent-mail-gateway

Ver en GitHub

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.

MCP ServersRegistry oficial1 estrellas0 forks● TypeScriptMITActualizado today
ClaudeWave Trust Score
95/100
✓ Verified
Passed
  • ✓Open-source license (MIT)
  • ✓Actively maintained (<30d)
  • ✓Clear description
  • ✓Topics declared
  • ✓Documented (README)
Last scanned: 10/3/2026
Install in Claude Code / Claude Desktop
Method: Manual
Claude Code CLI
git clone https://github.com/dominikamann/agent-mail-gateway
claude_desktop_config.json (Claude Desktop)
{
  "mcpServers": {
    "agent-mail-gateway": {
      "command": "node",
      "args": ["/path/to/agent-mail-gateway/dist/index.js"]
    }
  }
}
1. Run the command above in your terminal (Claude Code), or paste the JSON config into claude_desktop_config.json (Claude Desktop).
2. Replace any <placeholder> values with your API keys or paths.
3. Restart Claude. The MCP server and its tools appear automatically.
💡 Clone https://github.com/dominikamann/agent-mail-gateway and follow its README for install instructions.
Casos de uso

Resumen de MCP Servers

# Agent Mail Gateway

[![CI](https://github.com/dominikamann/agent-mail-gateway/actions/workflows/ci.yml/badge.svg)](https://github.com/dominikamann/agent-mail-gateway/actions/workflows/ci.yml)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)

Give every AI agent its own email mailbox — without giving it the keys to that mailbox.

Agent Mail Gateway is a small self-hosted Docker service that sits between your agents and
ordinary IMAP/SMTP mailboxes (Plesk, IONOS, Outlook, your own server — any provider). Each agent
gets **one API key bound to exactly one mailbox**. Through the gateway it can read mail, send
mail with attachments, and send, update or cancel calendar invitations. You decide **who each
agent may receive mail from and who it may write to**; everything else is filtered out.

Mail bodies are delivered to the agent as **Markdown** (converted from HTML) and the agent
writes Markdown that is sent as HTML — far fewer tokens than raw HTML email.

**In short:** a self-hosted **email MCP server** and REST API for AI agents — IMAP/SMTP
mailbox access with sender/recipient allow lists, HTML-to-Markdown, attachments and calendar
invites, packaged as one Docker container.

### Typical use cases

- An assistant agent that sends you daily reports, summaries or alerts by email.
- Agents that receive tasks or documents by email and answer them in the same thread.
- Agents that schedule, move and cancel meetings with you via calendar invitations.
- Giving several agents separate mailboxes on your existing mail server (Plesk, IONOS,
  Outlook, Postfix/Dovecot, …) without exposing the mailbox passwords to them.
- Locking an agent down so it can only talk to approved people — useful against prompt
  injection by email and against agents mailing the wrong people.

Works with any MCP client (for example Hermes Agent, Cursor, VS Code, n8n, LangChain/LangGraph
MCP adapters) and with anything that can make HTTP requests.

## Features

- **N mailboxes, one key each** — a key can never reach another mailbox.
- **Allow lists per mailbox** for receiving and sending (`name@domain` or `*@domain`).
- **Filtered mail is invisible** — not listed, not readable, not even by guessing an id.
  Non-allowed mail is moved to Trash (default) or left untouched.
- **Spoofing protection** — senders must pass SPF/DKIM/DMARC as reported by your mail server.
- **HTML ⇄ Markdown** conversion in both directions.
- **Attachments** in and out.
- **Calendar invites** (iCalendar) that update or cancel cleanly in Outlook, Gmail and Apple Calendar.
- **REST API** with OpenAPI docs at `/docs`, and an **MCP server** at `/mcp` with the same tools.
- **Webhooks** (HMAC-signed) when an allowed message arrives; new mail is detected instantly via IMAP IDLE.
- **Send rate limit** per mailbox and an **audit log** of every send, rejection and deletion.
- Works with **any IMAP/SMTP server**: TLS on 993/465 or STARTTLS on 143/587.

## How it works

```
 Agent ──REST/MCP + API key──▶ ┌──────────────────────────────────────┐
                               │ Auth      key → exactly one mailbox  │
 Agent ◀──signed webhook────── │ Policy    sender/recipient checks    │
                               │ Converter HTML ⇄ Markdown            │
                               │ Calendar  build/update/cancel .ics   │
                               │ Mailbox   IMAP read + IDLE watcher   │──IMAP──▶ mail server
                               │ Sender    SMTP + copy to Sent        │──SMTP──▶
                               │ Store     SQLite (small state)       │
                               └──────────────────────────────────────┘
                                 config.yaml + .env (read-only)
```

The gateway stores no mail content; mail stays on your mail server.

## Quick start

1. Get the files:
   ```bash
   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
   ```
2. Edit `config.yaml`: one entry per agent with its mailbox server, login and allow lists.
3. Fill `.env` with the secrets referenced in `config.yaml`:
   ```bash
   openssl rand -hex 32   # an API key for each agent
   openssl rand -hex 24   # a webhook secret (optional)
   ```
4. Start it:
   ```bash
   docker compose up -d
   curl http://localhost:8080/health
   curl -H "Authorization: Bearer $AGENT_API_KEY" http://localhost:8080/v1/mailbox
   ```

Every option is explained in [docs/configuration.md](docs/configuration.md).

## Using it

**REST** — send a message:

```bash
curl -X POST http://localhost:8080/v1/messages \
  -H "Authorization: Bearer $AGENT_API_KEY" -H "Content-Type: application/json" \
  -d '{"to":["you@yourmailserver.eu"],"subject":"Daily report","body_markdown":"All **green** today."}'
```

Read new mail:

```bash
curl -H "Authorization: Bearer $AGENT_API_KEY" "http://localhost:8080/v1/messages?unread=true"
```

**MCP** — point any MCP client at `http://<host>:8080/mcp` with the header
`Authorization: Bearer <api key>`. Tools: `get_mailbox_info`, `list_messages`, `read_message`,
`get_attachment`, `mark_message`, `delete_message`, `send_message`, `create_event`,
`update_event`, `cancel_event`, `list_events`.

**stdio** — clients that can only start local processes use the bundled bridge
`node dist/stdio.js` with `AGENT_MAIL_URL` and `AGENT_MAIL_API_KEY`; see
[docs/stdio.md](docs/stdio.md).

See [docs/api.md](docs/api.md) for every endpoint, the webhook format and examples.

**Hermes Agent** — connect the MCP server in `~/.hermes/config.yaml` and install the plugin
that teaches your agents to use their mailbox safely:

```bash
hermes plugins install dominikamann/agent-mail-gateway/integrations/hermes/agent-mail-gateway --enable
```

Step by step: [docs/hermes.md](docs/hermes.md).

## Documentation

- [Configuration](docs/configuration.md)
- [REST API, webhooks and MCP tools](docs/api.md)
- [Hermes Agent integration and plugin](docs/hermes.md)
- [stdio clients](docs/stdio.md)
- [Security model](docs/security.md)
- [Contributing](CONTRIBUTING.md)

## Security

Run the gateway behind a TLS reverse proxy when it is reachable from other machines. Report
vulnerabilities privately as described in [SECURITY.md](SECURITY.md).

## License

[MIT](LICENSE)

---

<p align="center">Proudly provided by <a href="https://amannlabs.eu">amannlabs.eu</a></p>
agent-toolsai-agentscalendardockeremailemail-gatewaygatewayhermes-agenticalendarimapllmmailboxmarkdownmcpmcp-servermodel-context-protocolself-hostedsmtptypescriptwebhook

Lo que la gente pregunta sobre agent-mail-gateway

¿Qué es dominikamann/agent-mail-gateway?

+

dominikamann/agent-mail-gateway es mcp servers para el ecosistema de Claude AI. 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. Tiene 1 estrellas en GitHub y su última actualización registrada es del 2026-10-02.

¿Cómo se instala agent-mail-gateway?

+

Puedes instalar agent-mail-gateway clonando el repositorio (https://github.com/dominikamann/agent-mail-gateway) o siguiendo las instrucciones del README en GitHub. ClaudeWave también te ofrece bloques de instalación rápida en esta misma página.

¿Es seguro usar dominikamann/agent-mail-gateway?

+

Nuestro agente de seguridad ha analizado dominikamann/agent-mail-gateway y le ha asignado un Trust Score de 95/100 (tier: Verified). Revisa el desglose completo de comprobaciones superadas y flags en esta página.

¿Quién mantiene dominikamann/agent-mail-gateway?

+

dominikamann/agent-mail-gateway es mantenido por dominikamann. La última actividad registrada en GitHub es del 2026-10-02, con 0 issues abiertos.

¿Hay alternativas a agent-mail-gateway?

+

Sí. En ClaudeWave puedes explorar mcp servers similares en /categories/mcp, ordenados por popularidad o actividad reciente.

Despliega agent-mail-gateway en tu cloud

Lleva este repo a producción en minutos. Cada plataforma genera su propio entorno con variables de entorno editables.

¿Mantienes este repo? Añade un badge a tu README

Pega el badge en tu README de GitHub para mostrar que está auditado por ClaudeWave. Cada badge enlaza de vuelta a esta página y muestra el Trust Score actual.

Featured on ClaudeWave: dominikamann/agent-mail-gateway
[![Featured on ClaudeWave](https://claudewave.com/api/badge/dominikamann-agent-mail-gateway)](https://claudewave.com/repo/dominikamann-agent-mail-gateway)
<a href="https://claudewave.com/repo/dominikamann-agent-mail-gateway"><img src="https://claudewave.com/api/badge/dominikamann-agent-mail-gateway" alt="Featured on ClaudeWave: dominikamann/agent-mail-gateway" width="320" height="64" /></a>

Más MCP Servers

Alternativas a agent-mail-gateway