Skip to content

Email for AI agents

Give your agent a real address on your own domain, like support@yourcompany.com. It gets every new message as a signed webhook, reads and replies through a REST API or MCP, and your team can open the same mailbox in webmail or any mail app.

Updated

What an agent needs from email

  • To hear about new mail at once, not by polling a mailbox every minute.
  • To read the whole conversation: earlier messages, attachments, what was already answered.
  • To send from a real address on your domain, signed with DKIM so replies don't land in spam.
  • A person who can look over its shoulder, correct an answer or take over a conversation.
  • Limits, so a loop in your code can't send ten thousand emails.

A sending API covers the third point only. A normal mailbox covers the first four, but its API is built for one person's account, not for software. Mektup is a mailbox built to be used by both.

How it works

  1. Someone writes to support@yourcompany.com. Mektup's mail servers receive it, check it for spam and store it in the mailbox.
  2. Mektup posts the message to your agent's webhook as soon as it is stored, signed with your webhook secret.
  3. Your agent reads the message, and if it needs more, the thread and attachments through the API.
  4. It replies with one API call or the send_email MCP tool, passing the message's id as inReplyTo. The reply goes out from support@, DKIM-signed, in the same thread, and is saved in Sent.
  5. Your team sees the whole conversation in webmail or their own mail app.

Set it up

  1. Add your domain in Mektup (dashboard, API or the create_domain tool) and add the MX, SPF, DKIM and DMARC records it returns at your DNS host.
  2. Create the mailbox: POST /v1/domains/yourcompany.com/mailboxes with {"localPart": "support"}.
  3. Point its webhook at your agent: PUT /v1/domains/yourcompany.com/mailboxes/support/webhook. The response shows the signing secret once.
  4. Handle the webhook and reply. A complete Node.js example:
An email agent in about 40 lines (Node.js, Express)
import express from "express";
import crypto from "node:crypto";

const app = express();

app.post("/inbound", express.raw({ type: "application/json" }), async (req, res) => {
  // 1. Check that the call came from Mektup
  const expected = crypto.createHmac("sha256", process.env.MEKTUP_WEBHOOK_SECRET)
    .update(req.body).digest("hex");
  const got = String(req.get("X-Mektup-Signature") || "").replace("sha256=", "");
  if (got.length !== expected.length ||
      !crypto.timingSafeEqual(Buffer.from(got), Buffer.from(expected))) {
    return res.sendStatus(401);
  }
  res.sendStatus(200); // answer within 8 seconds, do the work after

  // 2. Let your agent decide what to say
  const { mailbox, message } = JSON.parse(req.body);
  const answer = await runAgent(message); // your model call

  // 3. Reply from the same address
  await fetch("https://api.usemektup.com/v1/emails", {
    method: "POST",
    headers: {
      Authorization: `Bearer ${process.env.MEKTUP_API_KEY}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      from: mailbox,
      to: message.from,
      subject: `Re: ${message.subject}`,
      text: answer,
      inReplyTo: message.id, // keeps the reply in the same thread
    }),
  });
});

app.listen(3000);

An open-source version with a model call and a human safety net is on GitHub: mektup-inbox-agent.

Or let the agent do it through MCP

Agents in Claude Code, Claude Desktop, Cursor, Lovable or Replit can use Mektup as tools: create_domain, get_domain_records, create_mailbox, set_mailbox_webhook, list_messages, get_thread, send_email and the rest of the API. Add the remote server to your client:

MCP client config (remote server)
{
  "mcpServers": {
    "mektup": {
      "url": "https://mcp.usemektup.com/mcp",
      "headers": { "Authorization": "Bearer mek_live_..." }
    }
  }
}

Clients that support OAuth only need the URL https://mcp.usemektup.com/mcp and sign in with your Mektup account. More on the MCP server.

Limits that protect you

Limit on StarterValue
Sent recipients a month50,000
A day / an hour / per 5 minutes2,000 / 300 / 60
Recipients per message50
Received mailNot counted; uses storage (15 GB per account)
MailboxesUnlimited

Limits hold on every way out: the API, MCP, SMTP, forms, forwards and auto-replies. Over a limit the API answers 429 and nothing is sent.

Other ways to give an agent email

AgentMail sells inboxes for agents priced per inbox; Hostinger Agentic Mail adds an API and MCP to Hostinger mailboxes; Nylas Agent Accounts host a mailbox inside the Nylas API; Resend and Postmark parse inbound mail into webhooks without a mailbox. How Mektup compares with AgentMail.

Questions

Can an AI agent have its own email address?

Yes. Create a mailbox such as agent@yourcompany.com on a domain you own. The agent receives everything sent to it as a webhook, reads it through the REST API or MCP, and sends from it. It is a normal address: anyone can email it, and replies come back to it.

How does the agent know a new email arrived?

Each mailbox can have one webhook URL. Mektup posts every new inbound message to it as JSON, signed with an HMAC-SHA256 X-Mektup-Signature header. Delivery is a single attempt with an 8-second timeout, so for guaranteed processing also poll GET /v1/messages now and then; the mail itself is always stored.

Does the agent need a mailbox to send?

No. Once a domain is verified, the API can send as any address on it, for example noreply@. A mailbox is only needed to receive replies and to keep a copy in Sent.

Can a person check what the agent did?

Yes. The same mailbox opens in Mektup's webmail and in any mail app over IMAP and SMTP, with every folder, including the agent's sent mail. Someone can answer instead of the agent at any time. The shared inbox.

Which agents and frameworks work with it?

Anything that can receive an HTTP request or call an API: your own code, n8n or Zapier-style workflows, LangChain, CrewAI or the OpenAI and Anthropic SDKs. Agents in MCP clients such as Claude Code, Claude Desktop, Cursor, Lovable or Replit use the Mektup MCP server directly.

What does it cost per agent?

Nothing extra. Starter is $20 a month with unlimited mailboxes on 25 domains, so one mailbox per agent costs the same as one. The limits are on sending: 50,000 recipients a month, up to 2,000 a day.

Start today, or talk to us?

Starter is $20 a month. Agencies get a quote for every client domain on one account.