MCP

The Mailbay MCP server gives any agent the same actions as the API, with tool descriptions written for agents.

Remote server

Point your MCP client at https://mcp.mailbay.dev/mcp (streamable HTTP) and send your API key as Authorization: Bearer mb_live_…. Create a key on the API keys page of the dashboard. OAuth sign in, so a client needs no key, is coming.

claude mcp add --transport http mailbay https://mcp.mailbay.dev/mcp \
  --header "Authorization: Bearer $MAILBAY_API_KEY"

Local server

mailbay-mcp stdio runs the server over stdio with an API key and forwards to the remote server. Add it to any client that reads an mcpServers config.

mcp.json
{
  "mcpServers": {
    "mailbay": {
      "command": "mailbay-mcp",
      "args": ["stdio"],
      "env": { "MAILBAY_API_KEY": "mb_live_..." }
    }
  }
}

Tools

FieldTypeDescription
create_inboxinboxCreate an address on your subdomain or a verified domain.
list_inboxesinbox[]Every inbox the key can see.
get_inboxinboxOne inbox by id.
delete_inboxDelete an inbox and its mail.
list_messagesmessage[]Messages in an inbox, newest first.
send_emailmessageSend from an inbox. Respects suppressions and limits.
replymessageReply in a thread with the right threading headers.
list_threadsthread[]Threads in an inbox, most recent first.
get_threadthreadA thread with all its messages.
get_messagemessageOne message with auth results and attachments.
wait_for_emailmessage, codes, linksBlock until a matching message arrives. Filters: from, subject_contains, to (one recipient address).
add_domaindomainStart adding a custom domain.
verify_domaindomainCheck the DNS records now.
create_webhookwebhookGet events such as message.received at your URL.
list_domainsdomain[]Your domains and their status.

Example: sign up flow

Ask your agent to sign up for a service. It needs two Mailbay tool calls: one to get an address, one to get the code.

create_inbox({ "local_part": "signup-bot" })
// { "id": "ibx_01jbz8w4k2q9", "address": "signup-bot@k7m3qz.mailbay.email", ... }

// ...the agent fills in the sign up form with that address...

wait_for_email({ "inbox_id": "ibx_01jbz8w4k2q9", "subject_contains": "code", "timeout_seconds": 60 })
// { "message": { "subject": "Your sign in code", ... }, "codes": ["482913"], "links": [] }

Or skip creating an inbox: any address under your code reaches the Catch-all, so the agent can make up a fresh address per sign up and wait on the Catch-all with to.

wait_for_email({ "inbox_id": "ibx_catchall", "to": "signup-42@k7m3qz.mailbay.email", "timeout_seconds": 60 })

Something unclear or wrong? The API answers every error with a fix, and so should these docs. Back to mailbay.dev