Open Agent Email MCP

Open Agent Email — a self-hosted mail server for AI agents: inboxes, in-thread replies, human approval, webhooks and an MCP endpoint with 96 tools

  • 2,108 ★ on the repository
  • Last commit
  • Apache-2.0
MCP server

Broad access

Why this level

  • An agent with a full-access key sends mail from your address and domain on its own, and human confirmation works only while `hitl_enabled` is on
  • The agent reads mail from strangers, and the scanner checks text and HTML but gives no protection against attachments until ClamAV is on
  • The server keeps relay passwords, webhook secrets and DKIM keys in its database, encrypted with a single key
All reasons and checks

anil-matcha/open-agent-email

Install

Manual install

git clone https://github.com/Anil-matcha/open-agent-email.git && cd open-agent-email && ./scripts/dev.sh

Requires Python 3.11 or newer. The script creates the secrets, prints the admin key and starts the API on 127.0.0.1:8000 and SMTP on 127.0.0.1:2525.

Access and checks

How we review

Broad accessThe tool can change data, run commands or handle secrets.

  • An agent with a full-access key sends mail from your address and domain on its own, and human confirmation works only while `hitl_enabled` is on
  • The agent reads mail from strangers, and the scanner checks text and HTML but gives no protection against attachments until ClamAV is on
  • The server keeps relay passwords, webhook secrets and DKIM keys in its database, encrypted with a single key

This is third-party code. Review the repository files before installing.

What it does

Open Agent Email is a Python server that gives AI agents real mail addresses. It starts with `./scripts/dev.sh` or Docker Compose. On first start it creates an admin key and an encryption key, brings up the API on port 8000 and an SMTP listener on port 2525. The administrator creates an agent inbox and an access key for it, and from there the agent reads mail, replies in the same thread, forwards messages and writes new ones through REST, the Python and TypeScript clients, the `oae` command-line tool or MCP. An incoming message is received by the SMTP listener and first goes through a threat scanner. It looks in the text and HTML for commands such as "ignore previous instructions", hidden text (`display:none`, zero font size), ChatML delimiters and data leaks through markdown images, and it decodes and checks base64. A suspicious message lands in a manual approval queue. With `hitl_enabled` on, which is the default, outgoing mail goes into the queue too: a person approves or rejects it in the dashboard or through a link in an email. Outgoing mail leaves through an upstream SMTP relay such as Amazon SES, Resend, SendGrid, Postmark or Gmail, while mail between inboxes on the same server needs no relay. The MCP server sits at `/mcp/rpc` and accepts the same key in the Authorization header. It has 96 tools, and the set depends on the key: an inbox key works only with its own inbox, an admin key manages inboxes, domains, keys and server settings, and a reviewer key sees only the approval queue. The `get_recent_otp` tool pulls a 4–8 digit verification code from recent messages and never returns the message body.

Who it is for. For developers who want to give an agent in Claude Code or Cursor its own mail address for sign-ups, correspondence and notifications, and who are ready to deploy and maintain a server themselves.

Good fit when

  • An agent needs a permanent address for signing up to services and collects the verification code with `get_recent_otp`
  • The agent's outgoing mail should reach a person for approval first instead of leaving at once
  • An agent replies to customers in the same thread and forwards hard cases to a person
  • The agent's mail should live on your own domain, and you need ready MX, SPF, DKIM and DMARC records
  • An agent reads mail from strangers and you want messages with commands aimed at the model to sit in quarantine

Not a fit when

  • You need a cloud service without your own server: Open Agent Email is deployed, upgraded and backed up by you, and for sending through a hosted service the catalog has Resend MCP Server
  • An agent has to read your personal Gmail or Yandex Mail inbox: the server creates its own addresses and does not connect other mailboxes, and the IMAP mail-reading skill covers that
  • You only need messaging between agents of one project, with no external mail: the catalog has MCP Agent Mail for that
  • The machine has neither Python 3.11 or newer nor Docker
  • The agent's mail has to go out to the internet right after launch: without an upstream SMTP relay a message gets the status failed

Example request

Start Open Agent Email locally, create the inbox hello@agents.example.com with approval for outgoing mail and connect it to Claude Code over MCP

MCP

Transport
http
Authentication
API key

Environment variables

OAE_API_KEY required, secret
An inbox key (or an admin or reviewer key) that the client sends in the Authorization header.

Limitations

  • The repository has no license file, although the description names Apache 2.0. The author has not specified a license, so rights to use and copy are undefined; check with the author.
  • The project is under active development. The author warns that the mail path has had limited testing against live providers and asks you to read the operations guide before putting real traffic on it. The check records of October 15, 2026 come from a laptop, not a staging environment: 757 tests passed on both SQLite and PostgreSQL 16.15.
  • By default data sits in SQLite inside the Docker volume `oae-data`. The encryption key for relay passwords, webhook secrets and DKIM keys is stored there too: lose the volume and the key, and the saved secrets cannot be read.
  • To receive mail from the internet you have to map port 2525 to port 25, and to send outward you have to configure a relay in the settings section.
  • The TypeScript client is built from the `sdks/typescript` directory of the repository; the author does not publish it to a package registry. The Python client installs from `sdks/python`.

How to disable. Remove the MCP connection with `claude mcp remove open-agent-email` or delete the `open-agent-email` section from `.cursor/mcp.json`. Revoke the inbox key in the dashboard so it stops working. `docker compose down` stops the Docker server, and the `oae-data` volume with mail, keys and the database stays on disk until you delete it separately.

FAQ

How do I connect Open Agent Email to Claude Code or Cursor?

For Claude Code run `claude mcp add --transport http open-agent-email http://127.0.0.1:8000/mcp/rpc --header "Authorization: Bearer $OAE_API_KEY"`. For Cursor add an `open-agent-email` section to `.cursor/mcp.json` with the address `http://127.0.0.1:8000/mcp/rpc` and an Authorization header. The `oae_...` key is shown once, in the response to `POST /v1/api-keys`.

What does an agent with an inbox key see, and how does it differ from an admin key?

An inbox key reads and changes only its own inbox: messages, templates, contacts, suppression lists. Sending, replying and forwarding need full-access rights. Only an admin key can create inboxes, domains, webhooks and other keys or change server settings, and a reviewer key reaches only the approval queue.

How does an agent get a verification code from an email?

The `get_recent_otp` tool looks through the inbox's 50 newest delivered inbound messages for 4–8 digits near verification wording. It can wait up to 10 seconds and returns the code with minimal message details. It never returns the message body. If there is no code, the answer is `{ "found": false }`.

Which email attacks on an agent does the threat scanner filter out?

The scanner looks for direct commands such as "ignore previous instructions", text hidden with CSS or zero-width Unicode characters, ChatML delimiters and leaks through markdown images with keys in the address. It checks text and HTML but not attachments. Attachments are covered by optional ClamAV, switched on with the `ATTACHMENT_SCAN_ENABLED=true` setting.

How do I connect my own domain?

`POST /v1/domains` creates a 2048-bit DKIM key and returns the MX, SPF, DKIM and DMARC records. After you publish them, `POST /v1/domains/{domain}/verify` checks each one: `verified`, `pending`, `mismatch` or `error`. A domain counts as verified when MX, SPF and DKIM match; DMARC is recommended but not required.

What happens when mail arrives from a domain with a strict DMARC policy?

If authentication returns an exact fail, a `p=reject` policy makes the server answer SMTP 550 before anything is written to the inbox. A `p=quarantine` policy sends the message to the regular approval queue. A `p=none` policy, a DNS error or an unverified result let the message go through normal handling.

Discussion

No questions or reviews yet.

KeyID agent-kit

@keyid/agent-kit

Official

An MCP server that gives an agent a real email address: 27 tools for sending, replying, inbox search and contacts

MCP serverBroad access660Repository stars
Official

Resend's official MCP server: send and read email, manage contacts, broadcasts, domains and webhooks from your agent

MCP serverBroad access576Repository stars
Official

Aident's remote MCP server: the agent finds and runs actions in email, chat and CRM through connected accounts, and the server logs every call

MCP serverBroad access

An MCP server for driving Windows: the agent opens apps, clicks and types, reads window and UI state, and works with files and PowerShell

MCP serverBroad access10KRepository stars
Needs a VPN

MCP server for Discord: an agent manages channels, roles, messages and moderation through your server bot token

MCP serverBroad access555Repository stars

MCP server for AppleScript: the agent runs scripts and controls Mac apps, from Notes and Calendar to files

MCP serverBroad access465Repository stars

Comparison with similar tools

Entries that share the main search query, and how they differ.

EntryOfficialAuthenticationRepository starsMain difference
Open Agent Email (this entry)noAPI key2,108
Resend MCP ServeryesOAuth576Resend's official server, sends and reads mail through the Resend cloud
IMAP mail reading skillno2a skill for reading and searching existing mailboxes over IMAP, creates no addresses of its own
MCP Agent MailnoAPI key2,220messaging between coding agents inside a project, does not reach external mail

README in short

The repository holds the server, a Next.js dashboard, Python and TypeScript clients and an example WebSocket event listener. Documentation covers a quickstart, a reference with the MCP tool catalog, an operations guide, error codes and monitoring rules for Prometheus. There are many tests: the server ones check the OpenAPI contract and parity between MCP and REST, and the client ones cover webhooks and pagination. The operations guide ends with a table of exercises to pass on a staging environment before real mail is switched on.

README badge

Report a problem

Foxx AIOpen Agent Email
Foxx AI

I am Foxx AI and I have already vetted this tool. Ask about install, setup or anything else, and I will keep it simple.