Skip to content
MCP server

Agent Mail Gateway

Self-hosted gateway giving each AI agent a restricted mailbox with allow lists and checks

Agent Mail Gateway is an open-source MCP server for communication. It runs as a hosted remote server, so there is nothing to install locally.

Pricing
Open source
Platforms
Self-hosted, API
Runs
Remotely
What it can do
Read-only
Version
0.5.0
Listing updated

Similar MCP servers

Install

Add with the CLI

Run in a terminal

claude mcp add agent-mail-gateway -- docker run -i --rm ghcr.io/dominikamann/agent-mail-gateway:0.5.0

Add --scope user to use it in every project, or --scope project to share it in .mcp.json.

Or share it with your project

Add to .mcp.json

{
  "mcpServers": {
    "agent-mail-gateway": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "ghcr.io/dominikamann/agent-mail-gateway:0.5.0"
      ]
    }
  }
}

Claude Code setup guide

Add to claude_desktop_config.json

{
  "mcpServers": {
    "agent-mail-gateway": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "ghcr.io/dominikamann/agent-mail-gateway:0.5.0"
      ]
    }
  }
}

Settings → Developer → Edit Config, then quit and reopen Claude Desktop.

Claude Desktop setup guide

Install in CursorOpens Cursor, which asks you to confirm. Or add it by hand:

Add to ~/.cursor/mcp.json

{
  "mcpServers": {
    "agent-mail-gateway": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "ghcr.io/dominikamann/agent-mail-gateway:0.5.0"
      ]
    }
  }
}

Use .cursor/mcp.json in a project to share it with the project.

Cursor setup guide

Install in VS CodeOpens VS Code, which asks you to confirm. Or add it by hand:

Add to ~/.copilot/mcp-config.json

{
  "mcpServers": {
    "agent-mail-gateway": {
      "type": "stdio",
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "ghcr.io/dominikamann/agent-mail-gateway:0.5.0"
      ]
    }
  }
}

Or put the same entry in .mcp.json at your workspace root to share it.

VS Code setup guide

Add with the CLI

Run in a terminal

codex mcp add agent-mail-gateway -- docker run -i --rm ghcr.io/dominikamann/agent-mail-gateway:0.5.0

Or add to config.toml

Add to ~/.codex/config.toml

[mcp_servers.agent-mail-gateway]
command = "docker"
args = ["run", "-i", "--rm", "ghcr.io/dominikamann/agent-mail-gateway:0.5.0"]

Codex setup guide

Add to your client's MCP settings (most use this shape)

{
  "mcpServers": {
    "agent-mail-gateway": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "ghcr.io/dominikamann/agent-mail-gateway:0.5.0"
      ]
    }
  }
}
  • Gemini CLI and Antigravity

    Gemini CLI

    Add to ~/.gemini/settings.json

    {
      "mcpServers": {
        "agent-mail-gateway": {
          "command": "docker",
          "args": [
            "run",
            "-i",
            "--rm",
            "ghcr.io/dominikamann/agent-mail-gateway:0.5.0"
          ]
        }
      }
    }

    Or run: gemini mcp add -s user agent-mail-gateway docker -- run -i --rm ghcr.io/dominikamann/agent-mail-gateway:0.5.0

    Antigravity

    Add to ~/.gemini/config/mcp_config.json

    {
      "mcpServers": {
        "agent-mail-gateway": {
          "command": "docker",
          "args": [
            "run",
            "-i",
            "--rm",
            "ghcr.io/dominikamann/agent-mail-gateway:0.5.0"
          ]
        }
      }
    }

    Use .agents/mcp_config.json to add it to one workspace only.

    Gemini CLI and Antigravity setup guide

  • Devin Desktop (formerly Windsurf)

    Add to ~/.config/devin/mcp_config.json

    {
      "mcpServers": {
        "agent-mail-gateway": {
          "command": "docker",
          "args": [
            "run",
            "-i",
            "--rm",
            "ghcr.io/dominikamann/agent-mail-gateway:0.5.0"
          ]
        }
      }
    }

    On Windows the file is %APPDATA%\devin\mcp_config.json. Use .devin/mcp_config.json to share it with a project.

    Devin Desktop setup guide

  • Cline

    Add to cline_mcp_settings.json

    {
      "mcpServers": {
        "agent-mail-gateway": {
          "command": "docker",
          "args": [
            "run",
            "-i",
            "--rm",
            "ghcr.io/dominikamann/agent-mail-gateway:0.5.0"
          ]
        }
      }
    }

    Open it from the MCP Servers icon → Configure → Configure MCP Servers.

    Cline setup guide

  • Zed

    Add to Zed settings.json

    {
      "context_servers": {
        "agent-mail-gateway": {
          "command": "docker",
          "args": [
            "run",
            "-i",
            "--rm",
            "ghcr.io/dominikamann/agent-mail-gateway:0.5.0"
          ]
        }
      }
    }

    Open it with zed: open settings file. Merge context_servers into the settings you already have.

    Zed setup guide

  • JetBrains AI Assistant and Junie

    AI Assistant

    Add to Settings → Tools → AI Assistant → Model Context Protocol (MCP) → Add

    {
      "mcpServers": {
        "agent-mail-gateway": {
          "command": "docker",
          "args": [
            "run",
            "-i",
            "--rm",
            "ghcr.io/dominikamann/agent-mail-gateway:0.5.0"
          ]
        }
      }
    }

    Junie

    Add to ~/.junie/mcp/mcp.json

    {
      "mcpServers": {
        "agent-mail-gateway": {
          "command": "docker",
          "args": [
            "run",
            "-i",
            "--rm",
            "ghcr.io/dominikamann/agent-mail-gateway:0.5.0"
          ]
        }
      }
    }

    Use .junie/mcp/mcp.json to share it with a project.

    JetBrains AI Assistant and Junie setup guide

  • Kiro

    Add to ~/.kiro/settings/mcp.json

    {
      "mcpServers": {
        "agent-mail-gateway": {
          "command": "docker",
          "args": [
            "run",
            "-i",
            "--rm",
            "ghcr.io/dominikamann/agent-mail-gateway:0.5.0"
          ]
        }
      }
    }

    Use .kiro/settings/mcp.json to add it to one workspace only.

    Kiro setup guide

Using several servers? Build one config file with the MCP config generator.

About Agent Mail Gateway

The gateway sits between an agent and a normal IMAP and SMTP mailbox. The agent holds only an API key for one mailbox and never sees the password. Allow lists decide who it may receive mail from and write to; mail from other senders is hidden and moved to Trash by default.

Incoming messages arrive as compact Markdown rather than HTML. Attachments and content can be checked for dangerous file types, viruses through ClamAV and prompt injection, each set to hide, flag or off. Outgoing mail is reviewed before it leaves by built-in rules, an optional LLM review and optional plain-language policies, and a send limit and audit log apply.

Calendar invitations can be sent, updated and answered, and signed webhooks announce new mail. It runs as one Docker container with a SQLite state file, speaks MCP over streamable HTTP or a REST API, and works with any IMAP/SMTP server.

Tools this server provides (1)

Taken from the project documentation; the running server may differ.

From the tool list in its README, going by the names, all 1 tool only read data.

From the server's own tool labels and tool names; not verified by us.

get_attachmentName suggests: reads
Returns an attachment, including PDF or image text with format text.

What it does

One key per mailbox
Agents get an API key, not the mailbox password.
Allow lists
Restrict senders and recipients per mailbox.
Incoming checks
Flag or hide risky files, viruses and prompt injection.
Review before sending
Rules, optional LLM and policies block sloppy mail.
Calendar invitations
Send, update, cancel and answer invites.
Markdown mail
HTML converts to compact Markdown to save tokens.

Good for

  • Give an assistant its own address without exposing a personal inbox
  • Stop prompt-injected emails from reaching an agent
  • Let an agent schedule meetings by invitation
  • Audit every email an agent sends

Pricing

Open source

Self-hosted container; license badge in README

Agent Mail Gateway FAQ

What does Agent Mail Gateway need?

Docker and an IMAP/SMTP mailbox, preferably dedicated to the agent.

Can the agent read all mail?

No, only mail from allowed senders.

What happens to a bad outgoing mail?

It is rejected with a review_rejected error and the reasons.

Does Agent Mail Gateway read attachments?

get_attachment can return PDF and image text, using a vision model or Tesseract OCR.

Is Agent Mail Gateway free?

Yes. Agent Mail Gateway is open source, so you can use and self-host it for free.

How do I add Agent Mail Gateway to Claude Code?

Run this command in your terminal: claude mcp add agent-mail-gateway -- docker run -i --rm ghcr.io/dominikamann/agent-mail-gateway:0.5.0

What are the best alternatives to Agent Mail Gateway?

The closest alternatives to Agent Mail Gateway are REA, TrendRadar, AiSOC, x64dbg-mcp-server and redamon.

Where this comes from

  • Description: written from the project's README.
  • Install steps: from the official MCP Registry entry.

How AIPoweredBot checks servers