Claude

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.

Overview

With the Claude and Mailtrap integration, you can now send emails from Claude AI using the Mailtrap MCP (Model Context Protocol) server. This enables seamless email sending through simple natural language prompts.

Prerequisites

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

claude_desktop_config.json
{
  "mcpServers": {
    "mailtrap": {
      "command": "npx",
      "args": ["-y", "mcp-mailtrap"],
      "env": {
        "MAILTRAP_API_TOKEN": "your_mailtrap_api_token",
        "DEFAULT_FROM_EMAIL": "[email protected]"
      }
    }
  }
}
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 claude_desktop_config.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.

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 [email protected] 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.

Next steps

You can now use Claude to compose and send various types of emails by adjusting your prompts. Explore more advanced features like HTML emails, attachments, and templated messages through Mailtrap's API documentation.

Last updated

Was this helpful?