Skip to content
Documentation menu

Get started

Connect an AI agent (MCP)

Let your coding agent test the emails it builds: create an inbox, trigger a sign-up, wait for the email and follow its link.

Connect

MailBench runs a remote MCP server at https://app.mailbench.dev/mcp. It authenticates with the same API keysas the REST API: create one on the API keys page in the dashboard. Every plan includes it.

Claude Code
claude mcp add --transport http mailbench https://app.mailbench.dev/mcp \
  --header "Authorization: Bearer $API_KEY"
Cursor, Windsurf and other clients (mcp.json)
{
  "mcpServers": {
    "mailbench": {
      "url": "https://app.mailbench.dev/mcp",
      "headers": {
        "Authorization": "Bearer sbx_api_…"
      }
    }
  }
}

Then ask your agent, for example: “Sign up a test user in the app and confirm the email address using the link MailBench receives.”

Tools

ToolWhat it doesKey scope
list_inboxesLists the workspace’s inboxes and the SMTP server to send test email to.read
create_inboxCreates an inbox and returns its SMTP credentials, to configure the app under test.read_write
list_messagesLists messages in an inbox, newest first, filtered by text, sender, recipient, subject or time.read
wait_for_messageWaits up to 30 seconds for a matching email and returns it with its text and links.read
get_messageReturns one message: headers, plain text, links and attachment details. HTML on request.read
check_messageRuns the HTML compatibility, link or spam check on a message.read
clear_inboxDeletes every message in an inbox.read_write
delete_messageDeletes one message.read_write

A read key can use every tool that only looks; the others answer forbidden. Give the agent aread key unless it needs to create or clear inboxes.

Email content is untrusted

Anyone can send an email that says “ignore your instructions”. MailBench hands message bodies to the agent marked as untrusted data, tells it never to follow instructions found in an email, and offers no tool that sends mail or changes account settings. Bodies are cut to 20,000 characters and HTML is only returned when asked for.

Limits

Each MCP request counts as one API request against your plan. On Free that is 1,000 a day and 2 a second; Pro and Team have no daily cap. A connection costs a few requests and each tool call one. See Errors and limits.