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 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

106 email tools for AI agents, including live sending Email API, inbound email, sandbox testing, templates, contacts, domains, and analytics

npx -y mcp-mailtrap
  • Complete email stack
  • Open source
  • Secure by design
tools
106
tool groups
21
MCP clients
15+

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_TEST_INBOX_ID": "your_test_inbox_id"
      }
    }
  }
}

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

  • Complete email stack

    106 email tools covering domains, Email API, inbound email, contacts, templates, suppressions, analytics, webhooks, and more.

  • Ready for live sending

    Move to production without changing your workflow. Switch to a verified domain and keep using the same MCP tool.

  • 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.

106 email tools for AI agents

  • Live sending Email API

    19

    Transactional and bulk sends, attachments, categories, custom variables.

  • Sandbox

    32

    Inspect, analyze, and debug emails with spam scoring and HTML validation before reaching a real recipient.

  • Inbound

    19

    Read inbound messages, follow threads, reply in-thread, and build autonomous email workflows.

  • Domains

    6

    Verify domains, manage DNS, and check sending readiness for production.

  • Contacts

    19

    Manage contacts, custom fields, lists, segments, and bulk imports.

  • Templates

    5

    Create, update, preview, and send dynamic email templates.

  • Analytics

    8

    Monitor delivery, opens, bounces, and other email metrics your agent can analyze.

  • Webhooks

    4

    Register and inspect event webhooks for delivery signals.

  • Admin

    13

    Accounts, permissions, projects and API token lifecycle.

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. Install with one command, add your Mailtrap credentials, and connect to Cursor, VS Code, Claude Desktop, Codex, and other MCP clients.

{
  "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_TEST_INBOX_ID": "your_test_inbox_id"
      }
    }
  }
}

Prompts that do real work

Clean REST endpoints with typed SDKs, so your agent can create inboxes, receive, parse, and reply to incoming messages in a few lines of code.

  • 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

Any MCP-compatible client with stdio transport. Published to the MCP Registry as mcp-mailtrap.