Mailtrap

Official mailtrap.io MCP server
  • typescript

56

GitHub Stars

typescript

Language

6 months ago

First Indexed

2 months ago

Catalog Refreshed

Documentation & install

Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.

Installation

Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "mailtrap-mailtrap-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-mailtrap"
      ],
      "env": {
        "DEFAULT_FROM_EMAIL": "YOUR_SENDER_EMAIL",
        "MAILTRAP_API_TOKEN": "YOUR_API_TOKEN",
        "MAILTRAP_ACCOUNT_ID": "YOUR_ACCOUNT_ID",
        "MAILTRAP_TEST_INBOX_ID": "YOUR_TEST_INBOX_ID"
      }
    }
  }
}

This MCP server enables you to send transactional emails and manage Mailtrap templates from a single automation surface. Configure it with Mailtrap credentials, connect it to your Mailtrap account, and use integrated tools to send messages, test with a sandbox inbox, and manage your email templates.

How to use

After you install and run the server, you interact with it through an MCP client. You can send transactional emails, perform sandbox tests, and manage email templates. Use the available tools to craft emails, preview them in a sandbox, and create, list, update, or delete templates in your Mailtrap account. Ensure your environment variables are set so the server can access Mailtrap services and authorize template management.

How to install

Prerequisites: You need Node.js and npm installed on your system. You also need a Mailtrap account and the following setup steps to connect MCP to Mailtrap.

Install the MCP server provider through your MCP client setup workflow. The server configuration examples below show the standard MCP stdio (local) setup using npx to run the package and pass environment variables.

Configuration snippets for 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"
      }
    }
  }
}
{
  "mcp": {
    "servers": {
      "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"
        }
      }
    }
  }
}

Additional setup notes

For Claude Desktop or Cursor, you can place the same stdio configuration under the respective MCP configuration file so that the client launches the server with the correct environment variables.

Security and troubleshooting notes

Keep your API token secure and avoid logging sensitive values. If you encounter a sandbox issue, verify that MAILTRAP_TEST_INBOX_ID is configured and that your sandbox inbox exists. If you see timeouts, confirm network access to Mailtrap and that your API token is valid.

Available tools

send-email

Sends a transactional email through Mailtrap. Requires recipient(s), subject, and content, with optional from, cc, bcc, and category for tracking.

send-sandbox-email

Sends an email to the Mailtrap test inbox for development and testing. Useful for previewing templates without delivering to real recipients. Requires sandbox configuration.

get-sandbox-messages

Retrieves messages from the Mailtrap test inbox to review sandbox activity and test results.

show-sandbox-email-message

Shows detailed content of a specific sandbox message, including HTML and text bodies.

create-template

Creates a new email template in your Mailtrap account with name, subject, and HTML/text content.

list-templates

Lists all email templates in your Mailtrap account.

update-template

Updates an existing template with new name, subject, html/text content, or category.

delete-template

Deletes an existing email template by ID.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational