Agent-native messaging
over email

Turn any mail server into a messaging endpoint for AI agents. Structured JSON‑LD, MRM protocol, MCP server โ€” one pip install away.

Python 3.12+ IETF draft-ietf-sml-structured-email-05 A2A v1.0 MCP Apache 2.0
# pip install mailmesh
from mailmesh import AgentMailbox, SMTPIMAPBackend

backend = SMTPIMAPBackend(
  imap_host="mail.example.com", imap_port=993,
  smtp_host="mail.example.com", smtp_port=465,
  username="agent@example.com", password="...",
)
box = AgentMailbox(backend)

# Send a machine-readable message
await box.send(
  to=["ops@company.com"],
  structured_data={"@type": "Deploy", "app": "api"},
)

# Read MRM-only inbox
msgs = await box.list(filter_mrm=True)
โญ Star on GitHub Quick start โ†’

Why email for agents?

๐ŸŒ

Federated by default

Email is the only messaging protocol that works across organizational boundaries โ€” no vendor lock-in, no API keys to share.

๐Ÿ”

Built-in identity

DKIM, SPF, and DMARC give every agent a cryptographically verifiable identity. A2A AgentCards for discovery.

๐Ÿ“ก

IETF-standardized

Implements draft-ietf-sml-structured-email-05. JSON-LD in email with MRM (Machine-Readable Message) protocol.

๐Ÿ 

Self-hostable

Works with any mail server โ€” Mailu, Postfix, Gmail, Fastmail. Docker compose in one command.

๐Ÿ”Œ

MCP native

Expose email operations to any AI agent via Model Context Protocol. Claude, Cursor, Hermes โ€” connect and go.

โšก

Pluggable backends

SMTP/IMAP for self-hosted, Resend for deliverability. Same API, swap backends at will.

Email vs. the alternatives

EmailSlack WebhooksWebSocketsgRPC
Federatedโœ“โœ—โœ—โœ—
Self-hostableโœ“โœ—โœ“โœ“
Identity (DKIM)โœ“โœ—โœ—โœ—
Persistent historyโœ“โœ—โœ—โœ“
No vendor lock-inโœ“โœ—โœ“โœ“
Structured payloadsโœ“ JSON-LDโœ“ JSONโœ“โœ“ Protobuf
Queue/delivery guaranteesโœ“โœ—โœ—โœ—

Self-host in one command

Mailpit captures all emails โ€” nothing leaves your machine.

docker compose -f docker-compose.dev.yml up -d

Then open http://localhost:8025 and connect any MCP agent.