For AI agents: the Mailtrap MCP server is the npm package mcp-mailtrap; it runs locally over stdio with npx -y mcp-mailtrap and needs MAILTRAP_API_TOKEN, plus MAILTRAP_ACCOUNT_ID for account tools such as templates, logs and stats. To test without delivering, use its sandbox tools. Its send, campaign, and inbound reply and forward tools send live email, so confirm each one with the user. Full instructions: Markdown.
Mailtrap Email MCP Server

The Complete Email MCP Server For AI Agents

130+ email tools for AI agents: live sending, sandbox testing, inbound email, campaigns, contacts, templates, domains, and analytics.

npx -y mcp-mailtrap
  • Complete email stack
  • Open source
  • Secure by design
tools
132
product areas
9
ways to install
4

Add the Mailtrap MCP Server

{
  "mcpServers": {
    "mailtrap": {
      "command": "npx",
      "args": ["-y", "mcp-mailtrap"],
      "env": {
        "MAILTRAP_API_TOKEN": "your_mailtrap_api_token",
        "DEFAULT_FROM_EMAIL": "your_sender@example.com",
        "MAILTRAP_ACCOUNT_ID": "your_account_id",
        "MAILTRAP_SANDBOX_ID": "your_sandbox_id"
      }
    }
  }
}

From testing to production, one MCP for the entire email lifecycle

  • Complete email stack

    130+ email tools covering sending, sandbox testing, inbound email, campaigns, contacts, templates, domains, suppressions, analytics, webhooks, and account admin.

    See all tools
  • Ready for live sending

    Move to production without changing your setup. Verify a sending domain and your agent switches from sandbox sends to live sends on the same MCP server.

    Explore Email API
  • Agent-safe testing

    Test emails in a safe sandbox where your agent can’t reach real recipients. Validate spam score, HTML, and content before anything goes live.

    Explore Sandbox for AI workflows

132 email tools for AI agents

  • Email API sending

    8

    Send transactional and bulk email, single or batched, with attachments, categories, custom variables, and templates. Create and manage the templates too.

  • Email Sandbox

    32

    Send test emails to a sandbox, then check spam score, HTML compatibility, headers, and attachments before anything reaches a real inbox.

  • Inbound email

    24

    Create inboxes, read messages and threads, reply, forward, and set forward rules, so your agent can handle the mail it receives.

  • Email campaigns

    11

    Create, schedule, start, cancel, and stop marketing campaigns, then read their stats.

  • Contacts

    19

    Manage contacts, lists, custom fields, and events, with bulk imports and exports.

  • Domains and deliverability

    15

    Add and verify sending domains, check DNS, and manage suppressions, tracking opt-outs, and company info.

  • Logs and analytics

    4

    Search email logs, follow a message's delivery events, and read sending and marketing stats.

  • Webhooks

    5

    Create, update, and remove webhooks for delivery, bounce, and spam events.

  • Account admin

    14

    Manage accounts, user access, permissions, API tokens, sub-accounts, and billing usage.

Work directly in Claude, Cursor, and VS Code

  1. Install The MCP Server
  2. Add Your Mailtrap Credentials
  3. Connect Your AI Client. Go!

Runs locally over stdio and needs Node.js 22 or later. Install with one command, add your Mailtrap API token, and connect to Claude, Cursor, VS Code, Codex, or any other MCP client.

{
  "mcpServers": {
    "mailtrap": {
      "command": "npx",
      "args": ["-y", "mcp-mailtrap"],
      "env": {
        "MAILTRAP_API_TOKEN": "your_mailtrap_api_token",
        "DEFAULT_FROM_EMAIL": "your_sender@example.com",
        "MAILTRAP_ACCOUNT_ID": "your_account_id",
        "MAILTRAP_SANDBOX_ID": "your_sandbox_id"
      }
    }
  }
}

Prompts that do real work

Ask in plain language. Your agent picks the right Mailtrap tools, chains them together, and reports back.

  • Send transactional email

    Send the order-confirmation template to this customer with their order number and total, then confirm it was delivered.
  • Debug a failed delivery

    Find every email that failed yesterday, group them by bounce reason, and tell me what needs fixing.
  • Check production readiness

    Is my sending domain ready for production? Check the DNS records and tell me what's still missing.
  • Send a batch

    Send this release note to these 40 beta testers as a bulk batch and report any that failed.
  • Test before anyone sees it

    Send the new password-reset email to my Mailtrap sandbox, then tell me the spam score and any HTML that won't render in Outlook.
  • Triage the inbox

    Summarize the newest threads in my support inbox and draft replies for the ones about billing.

Works where you already build

Works with any MCP client that supports stdio. Install it from npm as mcp-mailtrap, or find it in the MCP Registry as io.mailtrap/mcp.