Skip to main content
Glama
Evergarden

Evergarden

by Chivier

Evergarden

A self-hosted mail workbench and MCP server where AI agents read freely and every change to your mailbox waits for your approval.

简体中文

Evergarden keeps a local, searchable archive of your IMAP mailboxes and serves it to AI agents such as Claude Code and Codex over MCP. Agents can read, search and draft as much as they like. Every write at your mail provider (send, move, archive, mark, Trash) becomes an approval request that you review in a separate web UI before anything happens.

Why

Letting an agent manage your inbox is useful until it sends the wrong reply or files the wrong message. Evergarden draws the line at the provider: reading is cheap and safe, so it is unrestricted; changing your mailbox is not, so each change is a fixed, inspectable request that only you can approve. You can relax that per kind of action (auto-approval), except for Trash.

Mail workbench

Approval queue

Send review

Approval queue

Send approval

Related MCP server: RadMail MCP

Features

  • Local mail archive. Read-only, incremental IMAP sync of several mailboxes into SQLite, with full-text search, threads and attachments. Messages keep their identity when moved or renumbered.

  • MCP server with 41 tools in scoped groups: metadata, read, attachments, drafts, sync, organize, send, delete (Trash), settings, verification codes, operations.

  • Approval workflow. Agents prepare immutable drafts; you approve them in the web UI, singly or in batches, and can revoke an approval before it runs. Approved requests run in the background and every outcome is logged.

  • Careful execution. The message is re-checked at the provider right before each change; unknown outcomes are verified read-only; mail is never sent twice; nothing is ever deleted permanently.

  • Mail workbench in the browser: read, search, compose, reply, forward, organize, look up verification codes, keep notes for your agents.

  • Self-service MCP API keys with per-key scopes and expiry, plus generated setup snippets for Claude Code, Codex and generic MCP clients.

  • Providers: any IMAP/SMTP server with a password, Gmail (app password or your own Google OAuth client), iCloud, Outlook.com and Microsoft 365 (your own Microsoft Entra app).

  • English and Chinese interface, light and dark, desktop and phone.

  • One-command setup with Docker Compose; writes are off until you switch them on.

  • Optional: in-stack scheduler or systemd timer, receive-only Thunderbird bridge, OAuth for MCP clients, SOPS-managed configuration, Microsoft MFA auto-login.

Quickstart

git clone https://github.com/Chivier/evergarden-mail.git evergarden
cd evergarden
./deploy/setup                 # prints the administrator password once
docker compose up -d --build
# open http://127.0.0.1:8788 and sign in

Then add a mailbox, store its password, sync, create an MCP API key and connect your agent. The full walkthrough, including enabling writes and approving a first action, is in docs/quickstart.md.

Supported providers

Provider

Sign-in

Notes

Any IMAP/SMTP server

password

Moves need IMAP MOVE, or UIDPLUS, or the copy fallback.

Gmail / Google Workspace

app password or OAuth (your own Google Cloud client)

iCloud Mail

app-specific password

No IMAP MOVE: UIDPLUS move or copy fallback.

Outlook.com / Microsoft 365

OAuth (your own Microsoft Entra app)

Authorization code or device code flow.

Details: docs/providers.md.

Security model

  • Agents get scope-limited, expiring, revocable tokens. They never see mailbox passwords, OAuth tokens or keys, and there is no approve, permanent-delete/expunge or raw-provider tool.

  • Every provider write is an immutable draft bound to a hash. Only the human, signed in to the web UI, can approve it (or a per-kind auto-approval policy that never covers Trash). Approvals are used once.

  • A single switch, off by default, decides whether this install may write to providers at all.

  • Mail is shown as plain text; HTML and remote content are never loaded.

  • Credentials are encrypted at rest; everything runs on your host, published only on 127.0.0.1 unless you add a reverse proxy.

The threat model, container isolation and known trade-offs are in docs/security.md.

Documentation

Web settings

Mailbox editing, runtime configuration and API keys

Quickstart

Install, first mailbox, first agent, first approval

User guide

Workbench and approval pages

Providers

IMAP, Gmail, iCloud, Microsoft; mailbox fields

MCP

Client setup, tools and scopes

Configuration

Every setting

Operations

Backup, upgrade, scheduling, reverse proxy, troubleshooting

Architecture

Components, data, approval lifecycle

Security

Threat model and trade-offs

Advanced

Thunderbird bridge, OAuth for MCP clients, SOPS, MFA auto-login

中文:快速开始 · 使用手册

Project status

Early, single-maintainer, self-hosted software. There is no hosted service. Expect rough edges and breaking changes between minor versions; read the changelog before upgrading.

Contributions are welcome: see CONTRIBUTING.md. Report security issues privately as described in SECURITY.md.

License

MIT

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      A
      maintenance
      An MCP server that gives AI agents permission-gated, audit-logged access to private email providers (Proton Mail via Bridge and plain IMAP), running locally with OAuth-based authentication and human-controlled escalation for destructive operations.
      66
      17
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      An MCP server that provides an email operating system for AI agents, enabling inbox triage and reply drafting while enforcing un-bypassable safety constraints on sensitive actions like money transfers and banking changes.
      12
      84 npm
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      A self-hosted MCP server that gives an AI client read, search, triage, drafting, attachment/export and label-management access to several Gmail or Google Workspace accounts at once, with each call naming an explicit account. Sending is disabled unless armed twice, mail deletion is impossible, and tokens, exports and audit data stay local.
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI agents to search, read, draft, move and flag mail in self-hosted IMAP mailboxes over MCP Streamable HTTP, protected by OAuth 2.1 with per-client, per-folder and per-operation rules, encrypted credentials and a full audit log. A Go sidecar handles header reads with caching, while structured errors, request ids and verified write outcomes keep unattended operation reliable.
      MIT