Content
# hestia-mail-mcp
MCP server exposing the Hestia mailbox to Hermes-routed agents.
Local-first design: reads via `notmuch`, sends via `msmtp`. Assumes the mbsync + notmuch + msmtp stack documented under `~/hermes-edit/hestia-mail/` is already deployed and synchronizing `hestia@hestia-projekt.com`.
Related note: [how this tool layer maps to an AI SDR workflow](docs/ai-sdr-workflow.md).
## Tools
| Tool | Effect | Side-effects |
|---|---|---|
| `inbox_summary` | Counts unread, top recent senders | None |
| `search` | `notmuch search` wrapper | None |
| `read_thread` | Returns RFC822 of a thread | None |
| `compose_reply` | Builds reply skeleton (To/Cc/Subject/quoted body) | None |
| `compose_new` | Builds new-message skeleton | None |
| `send` | Sends via Gmail SMTP relay | Writes audit log to `~/.local/state/hestia-mail/sent.jsonl` BEFORE send |
| `tag` | `notmuch tag` (local only, not synced to Gmail) | None |
## Install
```bash
pipx install /home/ubuntu/hestia-mail-mcp
```
Then in `~/.hermes/config.yaml`:
```yaml
mcp_servers:
hestia-mail:
command: hestia-mail-mcp
args: []
env: {}
```
## Safety
The `send` tool has no built-in confirmation. Guardrail is prompt-side: the Hestia agent is expected to preview the message and ask user confirmation before invoking `send`. Audit log at `~/.local/state/hestia-mail/sent.jsonl` (one JSON line per send, with full payload, written BEFORE SMTP submission so it captures even failed sends).
## Dev
```bash
cd ~/hestia-mail-mcp
python3 -m venv .venv
.venv/bin/pip install -e '.[dev]'
.venv/bin/pytest
```