Mailtrap

by railsware

60 stars
403 downloads
Not rated
GitHub Website

About

MCP Mailtrap Server is an MCP server that provides tools for sending transactional and bulk emails, managing templates, viewing email logs, and testing in sandbox via Mailtrap. It is designed for developers integrating Mailtrap’s email sending and testing capabilities into…

Details

Author
railsware
GitHub stars
60
Downloads
403
Categories
Communication, Automation, API, Developer Tools, Other

- Send transactional and bulk emails via Mailtrap
- Manage email templates (list, create, update, delete)
- View email logs for delivery debugging
- Test emails in sandbox inboxes
- List and manage sending domains

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name Mailtrap
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Install via npx (npx -y mcp-mailtrap) or Smithery CLI, then configure environment variables including MAILTRAP_API_TOKEN (required) and optionally MAILTRAP_ACCOUNT_ID, DEFAULT_FROM_EMAIL, and others. Set up your MCP client (Claude Desktop, Cursor, or VS Code) with the corresponding configuration JSON.

send-email

Send an email to your recipient email address using Mailtrap Email API. You can send emails to multiple recipients at once.

batch-send-transactional-email

Send a batch of transactional emails in one Mailtrap API call. Shared fields go on `base`; per-recipient overrides go in `requests[]`. Each request must include `to`.

batch-send-bulk-email

Send a batch of bulk emails (Mailtrap bulk-stream API) in one call. Shared fields go on `base`; per-recipient overrides go in `requests[]`. Each request must include at least one of `to`/`cc`/`bcc`.

create-template

Create a new email template

list-templates

List all email templates

get-template

Get a single email template by ID, including subject, category, and HTML/text body.

update-template

Update an existing email template

delete-template

Delete an existing email template

send-sandbox-email

Send an email in sandbox mode to a test inbox without delivering to your recipients

batch-send-sandbox-email

Send a batch of emails in sandbox mode to a test inbox in one Mailtrap API call. Shared fields go on `base`; per-recipient overrides go in `requests[]`. Requires `sandbox_id` or the MAILTRAP_SANDBOX_ID env var.

get-sandbox-messages

Get list of messages from the sandbox test inbox

show-sandbox-email-message

Show sandbox email message details and content from the sandbox test inbox. Optionally include spam report (SpamAssassin score) and HTML analysis (client compatibility) for email testing workflows.

list-sandbox-projects

List all sandbox projects and their inboxes in your Mailtrap account

create-sandbox-project

Create a new sandbox project to group test inboxes

get-sandbox-project

Get a sandbox project by ID, including its inboxes and email counts

update-sandbox-project

Rename an existing sandbox project

delete-sandbox-project

Delete a sandbox project and all its inboxes

create-sandbox-inbox

Create a new sandbox test inbox within a project. Returns SMTP credentials for the new inbox.

get-sandbox-inbox

Get sandbox inbox details including SMTP credentials, email counts, and status

update-sandbox-inbox

Update a sandbox inbox name or email username

delete-sandbox-inbox

Delete a sandbox inbox and all its messages

clean-sandbox-inbox

Delete all messages from a sandbox inbox without deleting the inbox itself

list-sandboxes

List all sandboxes accessible to the API token across projects

mark-sandbox-as-read

Mark all messages in a sandbox as read

reset-sandbox-credentials

Reset the SMTP credentials for a sandbox

enable-sandbox-email-address

Enable the receive-by-email address for a sandbox

reset-sandbox-email-address

Generate a new receive-by-email address for a sandbox

forward-sandbox-message

Forward a sandbox message to an email address (counts against your monthly forwarding quota)

update-sandbox-message

Mark a sandbox message as read or unread

delete-sandbox-message

Delete a single sandbox message

get-sandbox-message-spam-score

Get the SpamAssassin spam report for a sandbox message (score, rules, report).

get-sandbox-message-html-analysis

Get HTML analysis for a sandbox message (client compatibility, problematic elements).

get-sandbox-message-headers

Get the parsed mail headers for a sandbox message.

get-sandbox-message-html

Get the rendered HTML body of a sandbox message.

get-sandbox-message-text

Get the plain-text body of a sandbox message.

get-sandbox-message-raw

Get the raw message (MIME-formatted) for a sandbox message.

get-sandbox-message-eml

Get a sandbox message as an EML file payload.

get-sandbox-message-html-source

Get the unrendered HTML source of a sandbox message.

list-sandbox-attachments

List all attachments on a sandbox message.

get-sandbox-attachment

Get the metadata and download URL for a single sandbox attachment.

get-sending-stats

Get email sending statistics (delivery, bounce, open, click, spam rates) for a date range. Optionally break down by domain, category, email service provider, or date.

list-email-logs

List sent email logs (delivery history) with optional pagination and filters; use to debug delivery issues.

get-email-log-message

Get a single email log message by ID (UUID) to inspect delivery status and event history.

list-sending-domains

List sending domains and their DNS verification status

get-sending-domain

Get a sending domain by ID and its verification status. Optionally include DNS setup instructions via include_setup_instructions.

create-sending-domain

Create a new sending domain

delete-sending-domain

Delete a sending domain

send-sending-domain-setup-instructions

Email DNS setup instructions for a sending domain to a given address.

list-suppressions

List or search suppressions. Optionally filter by email. Returns up to 1000 suppressions per call.

delete-suppression

Delete a suppression by ID. Mailtrap will resume delivery to this email unless it gets suppressed again.

list-webhooks

List all webhooks for the account.

get-webhook

Get a single webhook by ID.

create-webhook

Create a webhook. `webhook_type` may be `email_sending`, `audit_log`, or `inbound_receiving`; for `inbound_receiving`, `inbound_inbox_id` is optional (scopes the webhook to one inbox — omit to apply to all inboxes). The response includes a `signing_secret` for verifying webhook payload signatures — this secret is returned only on creation, so store it now.

update-webhook

Update a webhook's mutable fields (`url`, `active`, `payload_format`, `event_types`, `inbound_inbox_id`). `webhook_type`, `sending_stream`, and `domain_id` cannot be changed after creation.

delete-webhook

Permanently delete a webhook by ID. Returns the deleted webhook record.

get-contact

Get a contact by ID or email address. Returns the full contact record including list memberships, status, and custom fields.

create-contact

Create a new contact. Requires `email`; optionally accepts custom `fields`, `list_ids` to subscribe to, and `unsubscribed` to start in unsubscribed status.

update-contact

Update a contact (identified by ID or email). `list_ids` replaces the membership set; `list_ids_included`/`list_ids_excluded` add/remove without disturbing the rest.

delete-contact

Permanently delete a contact by ID or email. Returns the deleted contact record when available.

create-contact-event

Record a contact event (by `name` + arbitrary `params`) against a contact ID or email. Used to trigger automations.

list-contact-lists

List all contact lists for the account. Optionally filter by name with `search` (case-insensitive match).

get-contact-list

Get a contact list by ID.

create-contact-list

Create a new contact list.

update-contact-list

Rename an existing contact list.

delete-contact-list

Permanently delete a contact list by ID.

list-contact-fields

List all contact field definitions for the account.

get-contact-field

Get a contact field definition by ID.

create-contact-field

Create a new contact field definition. `merge_tag` must be unique and is used in template variables.

update-contact-field

Update a contact field definition. Any combination of `name`, `merge_tag`, or `data_type` can be changed.

delete-contact-field

Permanently delete a contact field definition by ID.

create-contact-import

Bulk import contacts. Returns an import job record; poll status via `get-contact-import`.

get-contact-import

Get the status of a contact import job, including created/updated/over-limit counts.

create-contact-export

Export contacts matching a set of AND-combined filters. Returns an export job; poll status with `get-contact-export` to retrieve the download URL.

get-contact-export

Get the status of a contact export job. Once `status` is `finished`, the `url` field holds the download link.

list-email-campaigns

List the account's email campaigns, newest first, with page-token pagination (`token`, `per_page`). Optionally filter by name with `search`.

get-email-campaign

Get an email campaign by ID.

create-email-campaign

Create a new email campaign in the `draft` state; requires `name`, `domain_id`, `from_local_part`, and a `template_attributes.subject`.

update-email-campaign

Update a `draft` email campaign; only the provided fields change, and campaigns in any other state cannot be updated.

delete-email-campaign

Delete an email campaign by ID; only a campaign in the `draft` state can be deleted.

start-email-campaign

Start sending a `draft` email campaign immediately; only `draft` campaigns can be started.

schedule-email-campaign

Schedule a `draft` email campaign to start sending at `datetime` (ISO 8601, must be in the future and no more than 1 month ahead); only `draft` campaigns can be scheduled.

cancel-email-campaign

Cancel a `scheduled` email campaign, returning it to `draft`; only `scheduled` campaigns can be cancelled.

terminate-email-campaign

Terminate an email campaign that is currently sending (`started`, `queued`, or `paused`), aborting the in-flight send.

reset-email-campaign

Reset a `scheduled` email campaign back to `draft`; only `scheduled` campaigns can be reset.

get-email-campaign-stats

Get aggregated performance statistics for an email campaign; optionally narrow the window with `start_date`/`end_date` (`YYYY-MM-DD`).

list-accounts

List Mailtrap accounts accessible to the API token, with each account's access levels.

get-billing-usage

Get the current billing cycle usage for the account (sending and testing plans, limits, and current counts).

list-account-accesses

List account accesses (users, invites, API tokens) for the account. Optionally scope by domain UUIDs, inbox IDs, or project IDs. Requires account admin/owner permissions.

remove-account-access

Remove an account access by ID. For User specifiers this revokes permissions; for Invite or ApiToken specifiers it removes the specifier itself. Requires admin/owner.

get-permission-resources

Get all resources (inboxes, projects, domains, billing, account) to which the API token has admin access, nested by hierarchy.

bulk-update-permissions

Bulk create, update, or destroy permissions for an account access. Existing (resource_type, resource_id) pairs are updated; new ones are created. Set `destroy: true` to remove.

list-api-tokens

List all API tokens for the account.

create-api-token

Create a new API token. The response includes the secret `token` value — this is the **only time** the full token is returned, so store it immediately.

get-api-token

Get an API token by ID. The secret token value is NOT returned here — only the metadata (name, last 4 digits, resources).

reset-api-token

Reset (rotate) an API token by ID. The response includes the **new** secret `token` value — returned only on this call, so store it immediately. The previous token is invalidated.

delete-api-token

Permanently delete an API token by ID. The token can no longer authenticate after deletion.

list-sub-accounts

List sub-accounts in the organization. Requires `MAILTRAP_ORGANIZATION_ID` env var and sub-account management permissions.

create-sub-account

Create a new sub-account under the organization. Requires `MAILTRAP_ORGANIZATION_ID` and sub-account management permissions.

list-inbound-folders

List all inbound folders in the account.

get-inbound-folder

Get a single inbound folder by ID.

create-inbound-folder

Create a new inbound folder.

update-inbound-folder

Rename an inbound folder.

delete-inbound-folder

Permanently delete an inbound folder along with all of its inboxes.

list-inbound-inboxes

List all inboxes in an inbound folder.

get-inbound-inbox

Get a single inbound inbox by ID.

create-inbound-inbox

Create a new inbound inbox in a folder. Omit `domain_id` for a Mailtrap-hosted inbox; pass it for a custom-domain (catch-all) inbox.

update-inbound-inbox

Rename an inbound inbox.

delete-inbound-inbox

Permanently delete an inbound inbox.

list-inbound-messages

List received messages in an inbound inbox (paginated). Pass `last_id` from a previous response to fetch the next page.

get-inbound-message

Get a single inbound message with its full body and attachment download URLs.

delete-inbound-message

Permanently delete an inbound message.

reply-to-inbound-message

Reply to an inbound message (sends to the original sender). Sends a real email.

reply-all-to-inbound-message

Reply to an inbound message and copy the original's other recipients. Sends a real email.

forward-inbound-message

Forward an inbound message to new recipients (at least one `to` is required). Sends a real email.

list-inbound-threads

List conversation threads in an inbound inbox (paginated). Pass `last_id` from a previous response to fetch the next page.

get-inbound-thread

Get a single inbound thread with its messages embedded (oldest first).

delete-inbound-thread

Permanently delete an inbound thread.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

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

McpServers

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

MCP Mailtrap Server

An MCP server that provides tools for sending and testing in sandbox via Mailtrap.

Prerequisites

Before using this MCP server, you need to:

1. Create a Mailtrap account
2. Verify your domain
3. Get your API token from Mailtrap API settings
4. Get your Account ID from Mailtrap account management

Required Environment Variables:

- MAILTRAP_API_TOKEN - Required for all functionality
- MAILTRAP_ACCOUNT_ID - Required for templates, stats, email logs, sandbox list/show, and sending domains. Optional only for send-email and send-sandbox-email.

Optional (can be passed as tool parameters instead):

- DEFAULT_FROM_EMAIL - Default sender email when from is not provided to send-email or send-sandbox-email. Enables switching sender per call via the from parameter.
- MAILTRAP_TEST_INBOX_ID - Default test inbox ID for sandbox tools when test_inbox_id is not provided. Enables switching between inboxes per call via the test_inbox_id parameter.
- MAILTRAP_SANDBOX_ID - Default sandbox ID for sandbox tools when sandbox_id is not provided. Enables switching between sandboxes per call via the sandbox_id parameter.
- MAILTRAP_ORGANIZATION_ID - Required for organization tools (list-sub-accounts, create-sub-account).
- MAILTRAP_ORGANIZATION_API_TOKEN - Organization-scoped API token. Required for organization tools (separate from MAILTRAP_API_TOKEN).

Quick Install

Install in Cursor

Install with Node in VS Code

Smithery CLI

Smithery is a registry installer and manager for MCP servers that works with all AI clients.

npx @smithery/cli install mailtrap

> Smithery automatically handles client configuration and provides an interactive setup process. It's the easiest way to get started with MCP servers locally.

Setup

Claude Desktop

Use MCPB to install the Mailtrap server. You can find those files in Releases. <br>Download .MCPB file and open it. If you have Claude Desktop - it will open it and suggest to configure.

Claude Desktop or Cursor

Add the following configuration:

{
  "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"
      }
    }
  }
}

If you are using asdf for managing Node.js you must use absolute path to executable (example for Mac)

{
  "mcpServers": {
    "mailtrap": {
      "command": "/Users/<username>/.asdf/shims/npx",
      "args": ["-y", "mcp-mailtrap"],
      "env": {
        "PATH": "/Users/<username>/.asdf/shims:/usr/bin:/bin",
        "ASDF_DIR": "/opt/homebrew/opt/asdf/libexec",
        "ASDF_DATA_DIR": "/Users/<username>/.asdf",
        "ASDF_NODEJS_VERSION": "20.6.1",
        "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"
      }
    }
  }
}

Claude Desktop config file location

Mac: ~/Library/Application Support/Claude/claude_desktop_config.json

Windows: %APPDATA%\Claude\claude_desktop_config.json

Cursor config file location

Mac: ~/.cursor/mcp.json

Windows: %USERPROFILE%\.cursor\mcp.json

VS Code

Manually changing config

Run in Command Palette: Preferences: Open User Settings (JSON)

Then, in the settings file, add the following configuration:

{
  "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"
        }
      }
    }
  }
}

> [!TIP]
> Don't forget to restart your MCP server after changing the "env" section.

MCP Bundle (MCPB)

For easy installation in hosts that support MCP Bundles, you can distribute an .mcpb bundle file.

```bash

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.