Connector guide12-minute read53 MCP tools7 languages

How to Connect Mailtrap to Claude via MCP

Work with a Mailtrap account from any AI agent: send transactional, bulk and batch emails, test them in Email Sandbox with spam and HTML reports, manage sending domains, suppressions and templates, follow every sent message in the email logs, read sending stats, and run Email Marketing contacts, lists and campaigns. One API token; irreversible deletes install switched off.

HCBy HelpCode teamUpdated 12 min read Open-source on GitHub

No credit card · 7-day trial · Self-host alternative available

Mailtrap

Mailtrap

Mailtrap email platform: send transactional, bulk and batch emails, test them in Email Sandbox (messages, spam and HTML reports), manage sending domains, suppressions, templates, Email Marketing contacts, lists and campaigns, and read sending stats and email logs.

tools

53

Region

INTL

Category

Email

Authentication

Bearer Token

Required env vars

MAILTRAP_API_TOKEN
Install in one click on Cloud

7-day free trial · No credit card

  • 7-day free trial
    No credit card required
  • GDPR & SOC 2 ready
    EU data residency, audit logs
  • Open-source on GitHub
    Open source · AGPL-3.0
  • Works with ChatGPT, Claude, Gemini
    Any MCP-compatible client

Skip the install. Get this working in under 2 minutes.

Start a free trial on cloud.anythingmcp.com, add the Mailtrap in one click, then point your AI client (Claude, ChatGPT, Copilot or Cursor) at the generated MCP endpoint. No Docker, no git clone, zero engineering experience required.

Start free trial

AnythingMCP is listed in Claude's connector directory: add it to Claude in one click (opens in a new tab), then sign in and choose which MCP servers Claude may use.

Summary

Work with a Mailtrap account from any AI agent: send transactional, bulk and batch emails, test them in Email Sandbox with spam and HTML reports, manage sending domains, suppressions and templates, follow every sent message in the email logs, read sending stats, and run Email Marketing contacts, lists and campaigns. One API token; irreversible deletes install switched off.

Try asking

Example prompts for Mailtrap

Click any prompt to copy it. Paste into Claude, ChatGPT, Cursor, Gemini, Copilot or OpenClaw to run it against this connector.

Mailtrap · live via MCP
Share
Opus 4.7

Claude is AI and can make mistakes. Please double-check responses.

💡 No install? Use cloud.anythingmcp.com directly. Sign in, click Connectors → Mailtrap, paste your credentials, mint an MCP API key and you're done. No Docker, no git clone, no local server.

Mailtrap + Claude

Work with a Mailtrap account from any AI agent: send transactional, bulk and batch emails, test them in Email Sandbox with spam and HTML reports, manage sending domains, suppressions and templates, follow every sent message in the email logs, read sending stats, and run Email Marketing contacts, lists and campaigns. One API token; irreversible deletes install switched off.

Prerequisites

See the full setup instructions baked into the connector (visible in the in-app store when you select the connector). The required environment variables for this connector are:

MAILTRAP_API_TOKEN

Step 1 — Get credentials

Setting up takes about 3 minutes. You need a Mailtrap account.

  1. In Mailtrap open Settings, API Tokens (https://mailtrap.io/api-tokens) and create a token. Give it access to the sending domains (for sending, stats, logs and suppressions), the sandboxes or projects (for Email Sandbox) and, if you use it, Email Marketing. Changing suppressions needs admin access.
  2. Paste it into MAILTRAP_API_TOKEN. It is sent as Authorization: Bearer <token> and does not expire until you reset it.
  3. Install the connector and run mailtrap_list_accounts: it shows the account with your access level (1000 owner, 100 admin, 10 viewer) and confirms the token. A token belongs to one account and every call works on that account, so no account id is needed.
  4. Live sending needs a verified sending domain (mailtrap_list_sending_domains); Email Sandbox works without one.

Mailtrap serves its areas from different hosts and the connector picks the right one per tool: https://mailtrap.io for management and reports, https://send.api.mailtrap.io for transactional sending, https://bulk.api.mailtrap.io for the Bulk stream and https://sandbox.api.mailtrap.io for test sends into a sandbox.

Sending: mailtrap_send_email sends one transactional email to up to 1000 recipients, mailtrap_send_batch_emails up to 500 different emails in one call (at most 50 MB). Marketing and other bulk mail goes through the Bulk stream with mailtrap_send_bulk_email and mailtrap_send_bulk_batch_emails, which keeps promotional traffic apart from transactional mail. Content is text, html or both, or a stored template: template_uuid (the uuid from mailtrap_list_templates, not the numeric id) with template_variables, leaving subject, text, html and category out. from_email must be on a verified sending domain; to, cc and bcc are lists of {"email", "name"}; attachments are Base64 in content. Every send reaches real inboxes, so the AI shows you recipients, sender, subject and content and waits for your yes. A send answers message_ids, one per recipient. Batch calls answer 200 even when single messages fail: the AI checks success and errors of each entry in responses.

Email Sandbox: mailtrap_send_sandbox_email sends a test email that is caught in a sandbox and never delivered, the safe way to try a template or new content. The AI then reads the caught messages (mailtrap_list_sandbox_messages, mailtrap_get_sandbox_message), the body as plain text, preview HTML, HTML source or raw MIME, the headers, the attachments, the SpamAssassin report with score and matched rules, and the HTML check that shows which elements and CSS properties which email clients do not support. It also lists projects and sandboxes and creates sandboxes; SMTP credentials are left out of every answer.

Domains and deliverability: list and read sending domains with the DNS records to publish (SPF, DKIM, DMARC, return path) and their verification, add a domain, and email the DNS setup instructions to whoever manages DNS. Suppressed addresses (hard bounce, unsubscription, spam complaint, manual import) are listed with the message that caused them; mailtrap_create_suppression stops sending to an address. For a single email, mailtrap_list_email_logs filters by recipient, status, events, category and sent time, and mailtrap_get_email_log shows its delivery, open, click and bounce events with the provider response. mailtrap_get_sending_stats gives totals for a date range, mailtrap_get_sending_stats_grouped splits them by domain, category, mailbox provider or day, and mailtrap_get_billing_usage shows usage against the plan.

Templates: list, read, create and update templates. Variables use Handlebars, for example {{user_name}}; emails sent after an update use the new version.

Email Marketing: contacts with status, lists and fields (create, read and update by id or email; custom events such as purchase for automations and segments; imports of up to 50,000 contacts matched by email, followed with mailtrap_get_contact_import), contact lists and contact fields (the merge tags used as keys in fields). Campaigns: mailtrap_create_campaign always makes a draft, mailtrap_update_campaign changes a draft, mailtrap_schedule_campaign sets a time at most one month ahead, mailtrap_start_campaign sends now, mailtrap_cancel_campaign returns a scheduled campaign to draft, and mailtrap_get_campaign_stats shows the results. Scheduling and starting email the whole audience: the AI confirms the campaign, audience and time with you first. Add only contacts who agreed to receive email, and to stop mailing someone unsubscribe them (unsubscribed: true) instead of deleting them.

Switched off at install: mailtrap_delete_suppression (lets an address receive email again), mailtrap_clean_sandbox (deletes every message in a sandbox) and mailtrap_delete_contact. They cannot be undone, so a workspace admin turns them on when the team needs them.

Data formats: ids of domains, sandboxes, messages, templates, lists and campaigns are integers; contacts, suppressions and email log messages use UUIDs. Times are ISO 8601 in UTC. Stats rates are fractions (0.25 = 25%) and stats dates are YYYY-MM-DD.

Paging: contacts pass pagination.next_token as token until it is null, campaigns use token as a page number from pagination.next_token. Email logs pass next_page_cursor as search_after. Suppressions come 1000 per page, with the id of the last item as last_id. Sandbox messages come 30 per page, with page or the last message id as last_id.

Limits: 150 requests per 10 seconds per token; Contacts 200 per minute, Stats and Suppressions 10 per minute, listing email logs 60 per minute per account.

Common errors: 401 Incorrect API token means a wrong token or no access to that domain or sandbox. 403 is a missing permission: edit the token under Settings, API Tokens. 404 is an unknown id. 422 is invalid input with the reason in errors, for example a sender not on a verified domain or a campaign that is no longer a draft. 429 is the rate limit: wait and retry.

The connector does not delete sending domains, sandboxes, templates or campaigns and does not return the SMTP credentials of sandboxes.

Step 2 — Install the adapter

curl -fsSL https://raw.githubusercontent.com/HelpCode-ai/anythingmcp/main/docker-compose.quickstart.yml -o docker-compose.yml
printf 'JWT_SECRET=%s\nENCRYPTION_KEY=%s\n' "$(openssl rand -hex 32)" "$(openssl rand -hex 32)" > .env
docker compose up -d

Step 3 — Add the connector in Claude

Your server URL: in AnythingMCP, open MCP Servers → the server this connector is on, and copy its URL (https://cloud.anythingmcp.com/mcp/…). Use it wherever this guide shows YOUR_SERVER_ID.

Recommended path: works on claude.ai web without editing any config file.

  1. In Claude, open Customize → Connectors.
  2. Click +, then Add custom connector.
  3. Enter a name, e.g. Mailtrap, and the remote MCP server URL https://cloud.anythingmcp.com/mcp/YOUR_SERVER_ID, then click Add.
  4. Click Connect and sign in to AnythingMCP (OAuth) to allow access.

All tools below appear in your chat: start typing prompts.

Available tools

ToolWhat it does
mailtrap_list_accountsMailtrap accounts the API token can reach, with id, name and access_levels (1000 owner, 100 admin, 10 viewer)
mailtrap_get_billing_usageUsage of the current billing cycle: plan names and sent or stored message counts against their limits for Email Sending, Email Sandbox and…
mailtrap_send_emailSend one transactional email through the Email API (send.api.mailtrap.io): to up to 1000 recipients, with text and/or HTML, or from a…
mailtrap_send_batch_emailsSend up to 500 different transactional emails in one call (send.api.mailtrap.io/api/batch): shared fields in base, one entry per message in…
mailtrap_send_bulk_emailSend one marketing or bulk email through the Bulk stream (bulk.api.mailtrap.io), which keeps promotional traffic apart from transactional…
mailtrap_send_bulk_batch_emailsSend up to 500 different bulk (marketing) emails in one call through the Bulk stream (bulk.api.mailtrap.io/api/batch)
mailtrap_list_sending_domainsSending domains of the account with their id, DNS verification and compliance status and tracking settings
mailtrap_get_sending_domainOne sending domain with the DNS records to publish (SPF, DKIM, DMARC, return path) and whether each is verified, plus compliance status and…
mailtrap_create_sending_domainAdd a sending domain
mailtrap_send_domain_setup_instructionsEmail the DNS setup instructions of a sending domain to someone, e.g. the person who manages DNS
mailtrap_list_suppressionsAddresses Mailtrap no longer sends to (hard bounce, unsubscription, spam complaint, manual import), up to 1000 per call, with the message…
mailtrap_create_suppressionStop sending to an address on one domain and stream
mailtrap_delete_suppressionRemove a suppression so the address receives email again
mailtrap_get_sending_statsSending totals for a date range: delivery, bounce, open, click and spam counts and rates, optionally limited to domains, streams…
mailtrap_get_sending_stats_groupedThe same sending stats split by sending domain, category, recipient mailbox provider or day
mailtrap_list_email_logsSent messages of the account, newest first, with status, recipient, subject, category, opens and clicks
mailtrap_get_email_logOne sent message with its delivery events (delivery, open, click, bounce with the provider response), custom variables, template and a link…
mailtrap_list_sandbox_projectsEmail Sandbox projects with the sandboxes (test inboxes) in each
mailtrap_list_sandboxesAll sandboxes (test inboxes) with id, name, project, message and unread counts and the sandbox email address
mailtrap_get_sandboxOne sandbox: name, project, message counts, size limits, SMTP host and ports and its email address
mailtrap_list_sandbox_messagesMessages caught in a sandbox, newest first, 30 per page: id, subject, sender, recipient, sent time, size and read state (SMTP details and…
mailtrap_get_sandbox_messageOne sandbox message: sender, recipient, subject, size, SMTP details and blacklist report summary
mailtrap_get_sandbox_message_bodyThe body of a sandbox message: txt (plain text), html (sanitized for preview), htmlsource (the HTML as sent) or raw (the whole MIME message)
mailtrap_get_sandbox_message_headersThe mail headers of a sandbox message (From, To, Subject, Message-ID, List-Unsubscribe, ...)
mailtrap_get_sandbox_spam_reportSpamAssassin report of a sandbox message: total score, threshold and the rules that matched
mailtrap_get_sandbox_html_analysisHTML check of a sandbox message: which elements and CSS properties are unsupported by which email clients, with an overall support score
mailtrap_list_sandbox_attachmentsAttachments of a sandbox message with filename, content type, size and download path
mailtrap_send_sandbox_emailSend a test email into a sandbox (sandbox.api.mailtrap.io): it is caught there and never reaches the recipients, so it is safe for trying…
mailtrap_create_sandboxCreate a sandbox (test inbox) in a project; the answer carries its id and email address, SMTP credentials left out
mailtrap_clean_sandboxDelete every message in a sandbox
mailtrap_list_contactsEmail Marketing contacts, 25 per page by default (at most 50), with id, email, status, list ids and fields
mailtrap_get_contactOne contact by id or email: status, lists, fields and timestamps
mailtrap_create_contactAdd a contact, optionally with fields (by merge tag) and lists
mailtrap_update_contactChange a contact: email, fields, list membership or subscription status
mailtrap_delete_contactDelete a contact for good, e.g. on an erasure request
mailtrap_create_contact_eventRecord a custom event for a contact (e.g. purchase, trial_started) with parameters, for automations and segments
mailtrap_list_contact_listsContact lists with id and name; search filters by the start of the name
mailtrap_create_contact_listCreate an Email Marketing contact list; add contacts with list_ids or list_ids_included afterwards
mailtrap_list_contact_fieldsContact fields with id, name, data type and the merge tag used in contact fields and templates
mailtrap_import_contactsCreate or update up to 50,000 contacts in one asynchronous import, matched by email
mailtrap_get_contact_importStatus of a contact import (created, started, finished, failed) with the counts of created and updated contacts and those over the plan…
mailtrap_list_templatesEmail templates of the account with id, uuid (used to send), name, category and subject
mailtrap_get_templateOne email template with subject, HTML and text body (Handlebars variables such as {{user_name}})
mailtrap_create_templateCreate an email template
mailtrap_update_templateChange an email template; only the fields you pass change
mailtrap_list_campaignsEmail Marketing campaigns, newest first, with id, name, state and schedule
mailtrap_get_campaignOne campaign: state, sender, audience lists and segments, delivery mode, template and schedule
mailtrap_get_campaign_statsResults of a campaign: delivered, opened, clicked, bounced, spam and unsubscribed counts and rates, optionally for a date window
mailtrap_create_campaignCreate a campaign as a draft: sender, audience, subject and design
mailtrap_update_campaignChange a draft campaign; only the fields you pass change
mailtrap_schedule_campaignSchedule a draft campaign to go out at a set time, at most one month ahead
mailtrap_start_campaignStart sending a draft campaign now to its whole audience
mailtrap_cancel_campaignCancel a scheduled campaign before it goes out; it goes back to draft and can be edited again

Example prompts

  • "Did the order confirmation to [email protected] get delivered this morning? Show me its events."
  • "Send this new welcome template to our test sandbox and tell me its spam score and which email clients have trouble with the HTML."
  • "What were our delivery, bounce and spam rates last week, split by mailbox provider?"
  • "Which DNS records of our sending domain are still not verified?"
  • "Create a draft campaign for the Customers list with the November newsletter template and show me the audience before scheduling it."

FAQ

Does it work with Claude Code as well as Claude Desktop? Yes, point both at https://cloud.anythingmcp.com/mcp/YOUR_SERVER_ID.

Next steps

Was this guide helpful?

Your Mailtrap agent is one click away.

Install the connector, paste the key, prompt Claude. Free for 7 days, no credit card.

Related guides

Connectors

How to Connect Mailtrap to ChatGPT via MCP

Work with a Mailtrap account from any AI agent: send transactional, bulk and batch emails, test them in Email Sandbox with spam and HTML reports, manage sending domains, suppressions and templates, follow every sent message in the email logs, read sending stats, and run Email Marketing contacts, lists and campaigns. One API token; irreversible deletes install switched off.

Connectors

How to Connect Mailtrap to Cursor via MCP

Work with a Mailtrap account from any AI agent: send transactional, bulk and batch emails, test them in Email Sandbox with spam and HTML reports, manage sending domains, suppressions and templates, follow every sent message in the email logs, read sending stats, and run Email Marketing contacts, lists and campaigns. One API token; irreversible deletes install switched off.

Connectors

How to Connect Mailtrap to Gemini via MCP

Work with a Mailtrap account from any AI agent: send transactional, bulk and batch emails, test them in Email Sandbox with spam and HTML reports, manage sending domains, suppressions and templates, follow every sent message in the email logs, read sending stats, and run Email Marketing contacts, lists and campaigns. One API token; irreversible deletes install switched off.

Connectors

How to Connect Mailtrap to Meta Muse via MCP

Work with a Mailtrap account from any AI agent: send transactional, bulk and batch emails, test them in Email Sandbox with spam and HTML reports, manage sending domains, suppressions and templates, follow every sent message in the email logs, read sending stats, and run Email Marketing contacts, lists and campaigns. One API token; irreversible deletes install switched off.

Connectors

Mailtrap to MCP: Send Email, Test in Email Sandbox, Email Logs, Templates and Marketing Campaigns in any AI Agent

Work with a Mailtrap account from any AI agent: send transactional, bulk and batch emails, test them in Email Sandbox with spam and HTML reports, manage sending domains, suppressions and templates, follow every sent message in the email logs, read sending stats, and run Email Marketing contacts, lists and campaigns. One API token; irreversible deletes install switched off.

Connectors

How to Connect Mailtrap to Microsoft Copilot via MCP

Work with a Mailtrap account from any AI agent: send transactional, bulk and batch emails, test them in Email Sandbox with spam and HTML reports, manage sending domains, suppressions and templates, follow every sent message in the email logs, read sending stats, and run Email Marketing contacts, lists and campaigns. One API token; irreversible deletes install switched off.