# Mailtrap

> Mailtrap is an open-source MCP server for developer tools. MCP server connecting Mailtrap email delivery, sandbox testing and stats to AI assistants. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, API, vscode, macOS, Windows, Linux, self-hosted
- **Website:** https://docs.mailtrap.io/guides/ai-powered-integrations/mcp-server
- **Repository:** https://github.com/mailtrap/mailtrap-mcp
- **MCP Registry name:** io.mailtrap/mcp
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-11-18

## About

The Mailtrap MCP server lets an AI assistant such as Claude, Cursor or VS Code work with a Mailtrap account through natural-language prompts. The README says it covers sending transactional and bulk email, testing messages in the Email Sandbox, and searching email logs and delivery statistics.

It is built as an npm package that runs over stdio and needs a Mailtrap API token, with an optional account ID for resources such as templates, domains and suppressions. The tool list is broad, spanning templates, contacts and lists, webhooks, domains with DNS setup, tracking opt-outs, and API tokens and sub-accounts.

The server suits developers and email operators who want to debug delivery, preview templates or manage sending infrastructure from their editor instead of the Mailtrap dashboard.

## Features

- **Transactional and bulk sending:** Sends single or batched emails through the transactional and bulk streams, either with inline content or a saved template.
- **Email Sandbox testing:** Routes test messages to a sandbox where content, headers, attachments and spam scores can be inspected.
- **Delivery log search:** Searches sent email logs and event history by recipient, status, subject, domain and other filters.
- **Sending statistics:** Reports delivery, bounce, open, click and spam rates over a date range, with breakdowns by domain or provider.
- **Contacts and lists:** Creates and updates contacts, custom fields, contact lists, and bulk imports and exports.
- **Domains and webhooks:** Manages sending domains, DNS setup instructions, suppressions and webhook subscriptions.

## Good for

- Debug why a recipient did not receive an email by searching delivery logs from the editor
- Preview and send test messages to a sandbox before shipping a template
- Check bounce and spam rates for a sending domain over a chosen month
- Create and update email templates through a conversational assistant
- Set up sending domains and retrieve DNS records for a DevOps teammate

## Install

### Claude Code (Terminal)

```sh
claude mcp add mcp --env MAILTRAP_API_TOKEN='<MAILTRAP_API_TOKEN>' -- npx -y mcp-mailtrap
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "mcp": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-mailtrap"
      ],
      "env": {
        "MAILTRAP_API_TOKEN": "<MAILTRAP_API_TOKEN>"
      }
    }
  }
}
```

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "mcp": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-mailtrap"
      ],
      "env": {
        "MAILTRAP_API_TOKEN": "<MAILTRAP_API_TOKEN>"
      }
    }
  }
}
```

### VS Code (.vscode/mcp.json)

```json
{
  "servers": {
    "mcp": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "mcp-mailtrap"
      ],
      "env": {
        "MAILTRAP_API_TOKEN": "<MAILTRAP_API_TOKEN>"
      }
    }
  }
}
```

### Windsurf (~/.codeium/windsurf/mcp_config.json)

```json
{
  "mcpServers": {
    "mcp": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-mailtrap"
      ],
      "env": {
        "MAILTRAP_API_TOKEN": "<MAILTRAP_API_TOKEN>"
      }
    }
  }
}
```

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "mcp": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-mailtrap"
      ],
      "env": {
        "MAILTRAP_API_TOKEN": "<MAILTRAP_API_TOKEN>"
      }
    }
  }
}
```

## Tools

- `send-email`: Sends a transactional email through Mailtrap.
- `batch-send-transactional-email`: Sends a batch of transactional emails in one API call.
- `list-email-logs`: Lists sent email logs with optional filters.
- `get-sending-stats`: Gets sending statistics for a date range.
- `send-sandbox-email`: Sends an email to a Mailtrap sandbox for testing.
- `get-sandbox-messages`: Retrieves messages from a sandbox.
- `create-template`: Creates a new email template.
- `list-domains`: Lists domains and their DNS verification status.
- `create-suppression`: Adds an email address to the suppression list.
- `create-webhook`: Creates a webhook for email events.

## FAQ

### Which environment variables are required?

MAILTRAP_API_TOKEN is required for all functionality. MAILTRAP_ACCOUNT_ID is required for templates, sending stats, email logs, sandbox list and show, domains and suppressions, and optional for send tools.

### How is the server installed?

The README lists an npx command using the mcp-mailtrap package, a Docker image built from the repository, a Smithery CLI install, and an MCPB bundle for Claude Desktop.

### Does it work with clients other than Claude?

The README says it works with Claude Desktop, Claude Code, Cursor, VS Code and any other MCP-compatible client.

### Are there any renamed tools?

Yes. Several sandbox and domain tools were renamed, for example delete-sending-domain became delete-domain. The old names still work but log a deprecation warning.

### Is Mailtrap free?

Yes. Mailtrap is open source, so you can use and self-host it for free.

### How do I add Mailtrap to Claude Code?

Run this command in your terminal: claude mcp add mcp --env MAILTRAP_API_TOKEN='<MAILTRAP_API_TOKEN>' -- npx -y mcp-mailtrap

### What are the best alternatives to Mailtrap?

The closest alternatives to Mailtrap are pingutil email verification, SendMock, Test Mailbox and Proxy Mail QA.

## Where this comes from

- Description: written from the project's README and its MCP Registry entry.
- Install steps: from the official MCP Registry entry.

## Alternatives

- [pingutil email verification](https://ai-powered.com/mcp/pingutil-email-verification): pingutil email verification is a freemium MCP server for developer tools.
- [SendMock](https://ai-powered.com/mcp/sendmock): SendMock is an open-source MCP server for communication.
- [Test Mailbox](https://ai-powered.com/mcp/test-mailbox): Test Mailbox is an MCP server for developer tools.
- [Proxy Mail QA](https://ai-powered.com/mcp/proxy-mail-qa): Proxy Mail QA is a freemium MCP server for developer tools.

---
Source: https://ai-powered.com/mcp/mailtrap
