MCP.so
Sign In

MCP Mailtrap Server

@railsware

About MCP Mailtrap Server

Official mailtrap.io MCP server

Config

Add this server to your MCP-compatible client using the configuration below.

{
  "mcpServers": {
    "mailtrap": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-mailtrap"
      ],
      "env": {
        "MAILTRAP_API_TOKEN": "your_mailtrap_api_token",
        "DEFAULT_FROM_EMAIL": "[email protected]"
      }
    }
  }
}

Tools

117

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

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`.

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 a new email template

List all email templates

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

Update an existing email template

Delete an existing email template

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

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 list of messages from the sandbox test inbox

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 all sandbox projects and their inboxes in your Mailtrap account

Create a new sandbox project to group test inboxes

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

Rename an existing sandbox project

Delete a sandbox project and all its inboxes

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

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

Update a sandbox inbox name or email username

Delete a sandbox inbox and all its messages

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

List all sandboxes accessible to the API token across projects

Mark all messages in a sandbox as read

Reset the SMTP credentials for a sandbox

Enable the receive-by-email address for a sandbox

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

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

Mark a sandbox message as read or unread

Delete a single sandbox message

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

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

Get the parsed mail headers for a sandbox message.

Get the rendered HTML body of a sandbox message.

Get the plain-text body of a sandbox message.

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

Get a sandbox message as an EML file payload.

Get the unrendered HTML source of a sandbox message.

List all attachments on a sandbox message.

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

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 sent email logs (delivery history) with optional pagination and filters; use to debug delivery issues.

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

List sending domains and their DNS verification status

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

Create a new sending domain

Delete a sending domain

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

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

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

List all webhooks for the account.

Get a single webhook by ID.

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 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.

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

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

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

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.

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

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

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

Get a contact list by ID.

Create a new contact list.

Rename an existing contact list.

Permanently delete a contact list by ID.

List all contact field definitions for the account.

Get a contact field definition by ID.

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

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

Permanently delete a contact field definition by ID.

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

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

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 the status of a contact export job. Once `status` is `finished`, the `url` field holds the download link.

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

Get an email campaign by ID.

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

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

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

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

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 a `scheduled` email campaign, returning it to `draft`; only `scheduled` campaigns can be cancelled.

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

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

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

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

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

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 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 all resources (inboxes, projects, domains, billing, account) to which the API token has admin access, nested by hierarchy.

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 all API tokens for the account.

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 an API token by ID. The secret token value is NOT returned here — only the metadata (name, last 4 digits, resources).

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.

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

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

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

List all inbound folders in the account.

Get a single inbound folder by ID.

Create a new inbound folder.

Rename an inbound folder.

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

List all inboxes in an inbound folder.

Get a single inbound inbox by ID.

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.

Rename an inbound inbox.

Permanently delete an inbound inbox.

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

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

Permanently delete an inbound message.

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

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

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

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

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

Permanently delete an inbound thread.

Overview

What is MCP Mailtrap Server?

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 AI-powered workflows.

How to use MCP Mailtrap Server?

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.

Key features of MCP Mailtrap Server

  • 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

Use cases of MCP Mailtrap Server

  • Send personalized transactional emails using templates and variables
  • Debug email delivery by viewing sent email logs and statistics
  • Test email content in sandbox before sending to real recipients
  • Manage email templates and sending domains programmatically
  • Batch send transactional or bulk emails with per‑recipient overrides

FAQ from MCP Mailtrap Server

What prerequisites are needed?

You need a Mailtrap account with a verified domain, a Mailtrap API token, and your Account ID. Optionally, a test inbox ID and organization credentials are required for certain tools.

What environment variables are required?

MAILTRAP_API_TOKEN is required for all functionality. MAILTRAP_ACCOUNT_ID is required for templates, stats, logs, sandbox operations, and sending domains. MAILTRAP_ORGANIZATION_API_TOKEN and MAILTRAP_ORGANIZATION_ID are needed for organization tools.

Can I send emails without specifying a sender each time?

Yes. Set DEFAULT_FROM_EMAIL to a default sender. You can override it per call using the from parameter.

How do I install MCP Mailtrap Server?

Run npx -y mcp-mailtrap in your terminal, or use the Smithery CLI (npx @smithery/cli install mailtrap). You can also use an MCP bundle (.mcpb) or paste the configuration JSON into your client.

What tools does MCP Mailtrap Server provide?

It provides send-email, batch-send-transactional-email, batch-send-bulk-email, list-email-logs, plus tools for sandbox operations (list/show messages), template operations (list/create/update/delete), and sending domain management (list/get/create/delete).

Frequently asked questions

What prerequisites are needed?

You need a Mailtrap account with a verified domain, a Mailtrap API token, and your Account ID. Optionally, a test inbox ID and organization credentials are required for certain tools.

What environment variables are required?

`MAILTRAP_API_TOKEN` is required for all functionality. `MAILTRAP_ACCOUNT_ID` is required for templates, stats, logs, sandbox operations, and sending domains. `MAILTRAP_ORGANIZATION_API_TOKEN` and `MAILTRAP_ORGANIZATION_ID` are needed for organization tools.

Can I send emails without specifying a sender each time?

Yes. Set `DEFAULT_FROM_EMAIL` to a default sender. You can override it per call using the `from` parameter.

How do I install MCP Mailtrap Server?

Run `npx -y mcp-mailtrap` in your terminal, or use the Smithery CLI (`npx @smithery/cli install mailtrap`). You can also use an MCP bundle (.mcpb) or paste the configuration JSON into your client.

What tools does MCP Mailtrap Server provide?

It provides `send-email`, `batch-send-transactional-email`, `batch-send-bulk-email`, `list-email-logs`, plus tools for sandbox operations (list/show messages), template operations (list/create/update/delete), and sending domain management (list/get/create/delete).

Comments

More Other MCP servers