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.
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.
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 + Cursor
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.
- 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.
- Paste it into
MAILTRAP_API_TOKEN. It is sent asAuthorization: Bearer <token>and does not expire until you reset it. - 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. - 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 Cursor
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 showsYOUR_SERVER_ID.
Cursor reads MCP servers from ~/.cursor/mcp.json. Add this entry:
{
"mcpServers": {
"anythingmcp": {
"url": "https://cloud.anythingmcp.com/mcp/YOUR_SERVER_ID",
"headers": { "X-API-Key": "YOUR_MCP_API_KEY" }
}
}
}
- Create an MCP API key in AnythingMCP under MCP Servers → your server → API keys, and paste it in place of
YOUR_MCP_API_KEY. - Save the file and restart Cursor.
- Open Cursor → Settings → MCP and check that
anythingmcpis listed and connected. - Start chatting: the agent can now call the
Mailtraptools.
Available tools
| Tool | What it does |
|---|---|
mailtrap_list_accounts | Mailtrap accounts the API token can reach, with id, name and access_levels (1000 owner, 100 admin, 10 viewer) |
mailtrap_get_billing_usage | Usage of the current billing cycle: plan names and sent or stored message counts against their limits for Email Sending, Email Sandbox and… |
mailtrap_send_email | Send 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_emails | Send 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_email | Send one marketing or bulk email through the Bulk stream (bulk.api.mailtrap.io), which keeps promotional traffic apart from transactional… |
mailtrap_send_bulk_batch_emails | Send up to 500 different bulk (marketing) emails in one call through the Bulk stream (bulk.api.mailtrap.io/api/batch) |
mailtrap_list_sending_domains | Sending domains of the account with their id, DNS verification and compliance status and tracking settings |
mailtrap_get_sending_domain | One 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_domain | Add a sending domain |
mailtrap_send_domain_setup_instructions | Email the DNS setup instructions of a sending domain to someone, e.g. the person who manages DNS |
mailtrap_list_suppressions | Addresses Mailtrap no longer sends to (hard bounce, unsubscription, spam complaint, manual import), up to 1000 per call, with the message… |
mailtrap_create_suppression | Stop sending to an address on one domain and stream |
mailtrap_delete_suppression | Remove a suppression so the address receives email again |
mailtrap_get_sending_stats | Sending totals for a date range: delivery, bounce, open, click and spam counts and rates, optionally limited to domains, streams… |
mailtrap_get_sending_stats_grouped | The same sending stats split by sending domain, category, recipient mailbox provider or day |
mailtrap_list_email_logs | Sent messages of the account, newest first, with status, recipient, subject, category, opens and clicks |
mailtrap_get_email_log | One sent message with its delivery events (delivery, open, click, bounce with the provider response), custom variables, template and a link… |
mailtrap_list_sandbox_projects | Email Sandbox projects with the sandboxes (test inboxes) in each |
mailtrap_list_sandboxes | All sandboxes (test inboxes) with id, name, project, message and unread counts and the sandbox email address |
mailtrap_get_sandbox | One sandbox: name, project, message counts, size limits, SMTP host and ports and its email address |
mailtrap_list_sandbox_messages | Messages 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_message | One sandbox message: sender, recipient, subject, size, SMTP details and blacklist report summary |
mailtrap_get_sandbox_message_body | The 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_headers | The mail headers of a sandbox message (From, To, Subject, Message-ID, List-Unsubscribe, ...) |
mailtrap_get_sandbox_spam_report | SpamAssassin report of a sandbox message: total score, threshold and the rules that matched |
mailtrap_get_sandbox_html_analysis | HTML check of a sandbox message: which elements and CSS properties are unsupported by which email clients, with an overall support score |
mailtrap_list_sandbox_attachments | Attachments of a sandbox message with filename, content type, size and download path |
mailtrap_send_sandbox_email | Send 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_sandbox | Create a sandbox (test inbox) in a project; the answer carries its id and email address, SMTP credentials left out |
mailtrap_clean_sandbox | Delete every message in a sandbox |
mailtrap_list_contacts | Email Marketing contacts, 25 per page by default (at most 50), with id, email, status, list ids and fields |
mailtrap_get_contact | One contact by id or email: status, lists, fields and timestamps |
mailtrap_create_contact | Add a contact, optionally with fields (by merge tag) and lists |
mailtrap_update_contact | Change a contact: email, fields, list membership or subscription status |
mailtrap_delete_contact | Delete a contact for good, e.g. on an erasure request |
mailtrap_create_contact_event | Record a custom event for a contact (e.g. purchase, trial_started) with parameters, for automations and segments |
mailtrap_list_contact_lists | Contact lists with id and name; search filters by the start of the name |
mailtrap_create_contact_list | Create an Email Marketing contact list; add contacts with list_ids or list_ids_included afterwards |
mailtrap_list_contact_fields | Contact fields with id, name, data type and the merge tag used in contact fields and templates |
mailtrap_import_contacts | Create or update up to 50,000 contacts in one asynchronous import, matched by email |
mailtrap_get_contact_import | Status of a contact import (created, started, finished, failed) with the counts of created and updated contacts and those over the plan… |
mailtrap_list_templates | Email templates of the account with id, uuid (used to send), name, category and subject |
mailtrap_get_template | One email template with subject, HTML and text body (Handlebars variables such as {{user_name}}) |
mailtrap_create_template | Create an email template |
mailtrap_update_template | Change an email template; only the fields you pass change |
mailtrap_list_campaigns | Email Marketing campaigns, newest first, with id, name, state and schedule |
mailtrap_get_campaign | One campaign: state, sender, audience lists and segments, delivery mode, template and schedule |
mailtrap_get_campaign_stats | Results of a campaign: delivered, opened, clicked, bounced, spam and unsubscribed counts and rates, optionally for a date window |
mailtrap_create_campaign | Create a campaign as a draft: sender, audience, subject and design |
mailtrap_update_campaign | Change a draft campaign; only the fields you pass change |
mailtrap_schedule_campaign | Schedule a draft campaign to go out at a set time, at most one month ahead |
mailtrap_start_campaign | Start sending a draft campaign now to its whole audience |
mailtrap_cancel_campaign | Cancel 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 Cursor support custom MCP servers on the free tier? Yes, MCP is available on Hobby, Pro and Business plans.
Next steps
- Connector landing page
- Connect to Claude
- Connect to ChatGPT
- Connect to Gemini
- Connect to Meta Muse
- Connect to Microsoft Copilot
Was this guide helpful?