Send emails with Claude and Mailtrap

With the Claude and Mailtrap integration, you can now send emails from Claude AI.

Mailtrap is an email-sending solution for developer and product teams. Focused on fast delivery and high inboxing rates for transactional and promo emails. Provides highly customizable API and 24/7 tech support.

  • If you haven’t set up your sending domain already, you’ll need to do it before we start—it takes ~5 minutes, and you can use our step-by-step article as a guide.
  • Install the latest Node.js version since Mailtrap MCP is implemented as a Node.js command line utility.
  • If you haven’t already done so, install the Claude Desktop app. But if you have, make sure it’s updated and uses the latest version.

Step 1. Add Mailtrap MCP to Claude

In Claude settings, go to the Developer tab, click on Edit Config, and open the claude_desktop_config.json file.

Tip: You can also open the claude_desktop_config.json file in the following locations:

  • MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json

Then, in the claude_desktop_config.json copy/paste the following script:

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

Step 2. Add Mailtrap API credentials

Open your Mailtrap account and navigate to Sending Domains → Integration → API.

Once in the Integration/API page, update the following values in your mcp.json file with Mailtrap credentials:

  • MAILTRAP_API_TOKEN – Used to authenticate API requests, which you can copy/paste from the credentials tab.
  • DEFAULT_FROM_EMAIL – Make sure the email’s domain matches your own domain from the Sending Domains tab in Mailtrap.

Step 3. Send emails with a prompt

Open a new chat and make sure the MCP tool is specified. 

This will allow Claude Desktop to perform actions for us, for instance, email sending using Mailtrap MCP and send-email.

To send a plain-text email, you can use a prompt like the one below, but you can also experiment with your own prompts:

Send an email to john.doe@example.com with the subject 'Hi John!' and a message that wishes John a great day.

If Claude asks you to verify the usage of Mailtrap MCP, click Allow for this chat. 

Then, it should successfully send a new email and provide you with the properties the email was sent with in the response.

And here it is in the Email Logs tab in the Mailtrap dashboard.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us