# mcp-mailtrap [Health: Active]

**Category:** 💬 Communication  
**Repository:** https://github.com/pijusz/mcp-mailtrap  
**GitHub Stars:** 3  
**npm Downloads (last month):** 293  
**Views:** 3  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/mcp-mailtrap

## Description
MCP server for the Mailtrap email platform — analytics, sending, contacts, sandbox

## Tools
Capabilities this server exposes over MCP:

- **get_stats** — Get sending statistics (delivery, bounce, open, click, spam rates). Use group_by to break down by domain, category, ESP, or date.
- **get_email_logs** — List sent email logs (newest first) with filters. Returns message_id, recipient, sender, subject, status, stream, category and sent time. Use get_email_log with a message_id for the full event timeline. Paginate by passing the returned cursor.
- **get_email_log** — Get the full log for one sent message (from get_email_logs), including its delivery/open/click/bounce event timeline.
- **get_suppressions** — List suppressed addresses (hard bounces, spam complaints, unsubscribes, manual imports) that Mailtrap will not send to. Returns the suppression id needed by delete_suppression.
- **delete_suppression** — Remove a suppression so Mailtrap will send to that address again. Get the id from get_suppressions. Only do this if the address is known to be valid and consenting.
- **check_list_hygiene** — Cross-references suppressions against contacts to find suppressed emails still in your contact lists. Looks up each suppressed email as a contact and checks list membership. Returns overlaps with specific remediation actions.
- **send_email** — Send a single email via a transactional or bulk stream. Provide html/text body or a template_uuid.
- **batch_send** — Send up to 500 emails in a single batch request via a transactional or bulk stream.
- **send_test_email** — Send a test email to a sandbox inbox for development/testing.
- **list_templates** — List all email templates.
- **get_template** — Get a single email template by ID.
- **create_template** — Create a new email template. body_html is passed to Mailtrap as-is.
- **update_template** — Update an existing email template.
- **delete_template** — Delete an email template.
- **render_react_email** — Render a react-email component file (.tsx/.jsx/.js/.mjs) to HTML and plain text. Purely local — does NOT call any Mailtrap API. The file must default-export a React component using @react-email/components.
- **create_contact** — Create a new contact with an email address, optional custom fields, and optional list memberships.
- **get_contact** — Get a contact by UUID or email address.
- **update_contact** — Update a contact's email, custom fields, list memberships, or unsubscribed status.
- **delete_contact** — Delete a contact by UUID or email address.
- **trigger_contact_event** — Trigger a custom event for a contact (used for automation workflows).
- **list_contact_lists** — List all contact lists.
- **get_contact_list** — Get details of a single contact list.
- **create_contact_list** — Create a new contact list.
- **update_contact_list** — Rename an existing contact list.
- **delete_contact_list** — Delete a contact list.
- **manage_contact_field** — List, get, create, update, or delete custom contact fields.
- **import_contacts** — Start a contact import or check the status of an existing import.
- **export_contacts** — Start a contact export or check the status of an existing export.
- **list_projects** — List all sandbox projects.
- **get_project** — Get details of a single sandbox project.
- **manage_project** — Create, update, or delete a sandbox project.
- **list_inboxes** — List all sandbox inboxes.
- **get_inbox** — Get details of a single sandbox inbox.
- **manage_inbox** — Create, update, clean, mark all read, reset credentials, or delete a sandbox inbox.
- **get_messages** — List messages in a sandbox inbox.
- **get_message** — Get a single sandbox message with body content and optional attachments.
- **analyze_message** — Analyze a sandbox message: spam report, HTML analysis, and mail headers.
- **forward_message** — Forward a sandbox message to an email address.
- **list_domains** — List all sending domains with DNS verification status.
- **get_domain** — Get a sending domain's details including DNS records and verification status.
- **manage_domain** — Create or delete a sending domain.
- **send_domain_setup_instructions** — Email DNS setup instructions for a domain to a colleague.
- **list_accounts** — List all accounts accessible to the current API token, or get a single account by ID.
- **get_billing_usage** — Get current billing cycle usage and plan limits for testing and sending.
- **manage_account_access** — List, remove, or update account access entries and permissions.
- **manage_api_token** — List, get, create, delete, or reset API tokens.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

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

**Requires environment variables:** `MAILTRAP_API_TOKEN` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## What mcp-mailtrap does

mcp-mailtrap exposes Mailtrap account operations through the Model Context Protocol. Its coverage spans email performance, delivery logs, suppressions, sending, templates, contacts, sandbox projects and inboxes, sending domains, account access, billing usage, and API tokens.

The email workflow includes transactional and bulk sending, batches of up to 500 messages, test delivery to a sandbox inbox, and inspection of individual messages with their delivery-event timeline. Agents can also identify suppressed recipients that remain in contact lists and receive cleanup suggestions.

Contact tooling supports individual records, list membership, subscription status, custom fields, automation events, imports of up to 50,000 contacts, and exports. Template operations include reading, creating, updating, and deleting templates, plus rendering React Email source files into HTML and plain text.

## How it works

The server communicates with Mailtrap using an API token supplied through `MAILTRAP_API_TOKEN`. Sending operations can use a separate sending token; when that variable is absent, the general API token is used. The process exposes its functions to an MCP client over the standard command-based setup used by clients such as Claude Code and Cursor.

Install and run it with `npx mcpj-mailtrap@latest`, or use `bunx mcpj-mailtrap@latest` when Bun is available. A prebuilt binary is also available for macOS, Linux, and Windows. The repository uses Bun and TypeScript for development and includes commands for testing, type checking, building, inspection with MCP Inspector, and formatting or linting.

## Setup and configuration

Create a Mailtrap API token from the Mailtrap API token settings, then provide it to the MCP process. A minimal configuration needs only:

- `MAILTRAP_API_TOKEN`: required general API token.

Optional variables provide defaults and account selection:

- `MAILTRAP_SENDING_TOKEN`: token for transactional and bulk sending; otherwise the general token is used.
- `MAILTRAP_ACCOUNT_ID`: default account identifier; the account can otherwise be discovered automatically.
- `MAILTRAP_DEFAULT_FROM_EMAIL`: default sender for email and test-email operations.
- `MAILTRAP_TEST_INBOX_ID`: default sandbox inbox for test messages.
- `DEBUG`: enables debug logging.

For Claude Code, add the server with `claude mcp add mailtrap -e MAILTRAP_API_TOKEN=your_token -- npx mcpj-mailtrap`. In a JSON client configuration, set `command` to `npx`, pass `-y` and `mcpj-mailtrap@latest` as arguments, and place the credentials under `env`. Running through npx requires Node.js 18 or newer.

## Tools and capabilities

- Review delivery, bounce, open, click, and spam rates grouped by domain, category, ESP, or date.
- Search email logs by status, stream, time range, recipient, sender, subject, or category with cursor pagination.
- List and remove suppressions, then check contact lists for suppressed addresses.
- Send HTML, text, template-based, transactional, bulk, and sandbox test messages.
- Manage templates and render `.tsx`, `.jsx`, `.js`, or `.mjs` React Email components.
- Create, retrieve, update, delete, import, and export contacts and contact lists.
- Manage custom contact fields and trigger contact events.
- Inspect sandbox projects, inboxes, messages, message analysis, attachments, and forwarding.
- Manage sending domains, account access, API tokens, billing usage, and account records.

## Limitations and notes

Batch sending is limited to 500 emails per request, while contact imports support up to 50,000 contacts. The server can use a dedicated sending token, but it falls back to the general API token when one is not configured. Sandbox inbox credentials are redacted by default when retrieving inbox details. The project is licensed under MIT.

_Full upstream README: https://allmcps.com/mcp/mcp-mailtrap/readme_

