# Mailtrap — how to use (mcp.ai)

Connect your Mailtrap account and use 49 tools for developer tools straight from your AI agent. Connect with your own API key. Email Delivery Platform for testing and sending transactional emails.

## Option A — via MCP (recommended)
Remote MCP endpoint (HTTP, streamable): `https://api.mcp.ai/p_mailtrap?ms=1787293380000`
Add it as a custom/remote MCP connector in your client (Claude, Cursor, VS Code…), then authenticate when prompted. Once connected, ask the agent to use the server's tools (e.g. `mailtrap_clean_inbox`).

## Option B — via direct REST API
Base URL: `https://api.mcp.ai/api/mailtrap`
Auth: `Authorization: Bearer sk_live_…` — create a workspace API key at https://mcp.ai/settings/api-keys
Discover endpoints: `GET https://api.mcp.ai/api/mailtrap/_endpoints`

### Endpoints
- `POST https://api.mcp.ai/api/mailtrap/clean/inbox` — Tool to clean an inbox in Mailtrap by deleting all messages. Use when you need to remove all emails from an inbox while keeping the inbox itself.
  - body: { inbox_id: integer, account_id: integer }
- `POST https://api.mcp.ai/api/mailtrap/create/contact` — Tool to create a new contact in Mailtrap. Use when you need to add a contact with an email address to a Mailtrap account. Optionally include custom fields and assign to contact lists.
  - body: { contact: object, account_id: integer }
- `POST https://api.mcp.ai/api/mailtrap/create/contact/event` — Tool to create a contact event in Mailtrap. Use when you need to track custom events associated with a contact for segmentation or automation triggers.
  - body: { name: string, params?: object, account_id: integer, contact_identifier: string }
- `POST https://api.mcp.ai/api/mailtrap/create/contact/export` — Tool to create a contact export job for a Mailtrap account. Use when you need to export contacts with filters. The export is processed asynchronously - the response includes a job ID and status. Check
  - body: { filters: object[], account_id: integer }
- `POST https://api.mcp.ai/api/mailtrap/create/contact/field` — Tool to create a custom contact field in Mailtrap. Use when you need to add new contact attributes for personalization and segmentation in email campaigns.
  - body: { name: string, data_type: string, merge_tag: string, account_id: integer }
- `POST https://api.mcp.ai/api/mailtrap/create/contact/list` — Tool to create a new contact list in Mailtrap. Use when you need to organize contacts into groups or segments. Each contact list has a unique ID and name that can be used to add contacts to it later.
  - body: { name: string, account_id: integer }
- `POST https://api.mcp.ai/api/mailtrap/create/email/template` — Tool to create a new email template in Mailtrap account. Use when you need to create a reusable email template with HTML/text content, subject, and category. The template can be used for sending promo
  - body: { account_id: integer, email_template: object }
- `POST https://api.mcp.ai/api/mailtrap/create/sending/domain` — Tool to create a new sending domain in Mailtrap. Use when you need to register a domain for sending transactional emails. After creation, DNS records must be configured before the domain can be used f
  - body: { account_id: integer, sending_domain: object }
- `POST https://api.mcp.ai/api/mailtrap/delete/contact` — Tool to delete a contact from a Mailtrap account. Use when you need to permanently remove a contact by their UUID or email address. The deletion is permanent and cannot be undone.
  - body: { account_id: integer, contact_identifier: string }
- `POST https://api.mcp.ai/api/mailtrap/delete/contact/field` — Tool to delete a contact field by its ID. Use when you need to remove a custom contact field from an account.
  - body: { field_id: integer, account_id: integer }
- `POST https://api.mcp.ai/api/mailtrap/delete/contact/list` — Tool to delete a contact list by its ID. Use when you need to remove a contact list from an account.
  - body: { list_id: integer, account_id: integer }
- `POST https://api.mcp.ai/api/mailtrap/delete/email/template` — Tool to delete an email template from a Mailtrap account. Use when you need to remove an existing email template.
  - body: { account_id: integer, email_template_id: integer }
- `POST https://api.mcp.ai/api/mailtrap/delete/project` — Tool to delete a project from Mailtrap. Use when you need to permanently remove a project and its associated resources. Returns the ID of the deleted project.
  - body: { account_id: integer, project_id: integer }
- `POST https://api.mcp.ai/api/mailtrap/delete/sending/domain` — Tool to delete a sending domain from a Mailtrap account. Use when you need to remove a domain permanently.
  - body: { account_id: integer, sending_domain_id: integer }
- `POST https://api.mcp.ai/api/mailtrap/get/billing/usage` — Tool to retrieve current billing cycle usage for an account. Use when you need to check billing information, usage limits, or consumption for Email Sandbox and Email Sending services.
  - body: { account_id: integer }
- `POST https://api.mcp.ai/api/mailtrap/get/contact` — Tool to retrieve a contact by UUID or email address from Mailtrap. Use when you need to fetch details of a specific contact including their subscription status, lists, and custom fields.
  - body: { account_id: integer, contact_identifier: string }
- `POST https://api.mcp.ai/api/mailtrap/get/contact/export` — Tool to retrieve the status of a contact export. Use when you need to check the progress of an export or download the exported contacts file.
  - body: { export_id: integer, account_id: integer }
- `POST https://api.mcp.ai/api/mailtrap/get/contact/field` — Tool to retrieve contact field details by field ID. Use when you need to get information about a specific custom field in your contacts.
  - body: { field_id: integer, account_id: integer }
- `POST https://api.mcp.ai/api/mailtrap/get/contact/import` — Tool to retrieve the status of a contact import operation. Use when you need to check the progress or completion status of a contact import. Use after initiating a contact import to monitor its status
  - body: { import_id: integer, account_id: integer }
- `POST https://api.mcp.ai/api/mailtrap/get/contact/list` — Tool to retrieve a specific contact list by its ID. Use when you need to fetch details about a contact list in a Mailtrap account.
  - body: { list_id: integer, account_id: integer }
- `POST https://api.mcp.ai/api/mailtrap/get/email/template` — Tool to retrieve details of a specific email template by ID. Use when you need to fetch template content, metadata, or configuration for an existing email template.
  - body: { account_id: integer, email_template_id: integer }
- `POST https://api.mcp.ai/api/mailtrap/get/inbox` — Tool to retrieve inbox attributes from Mailtrap. Use when you need to get details about a specific inbox including its configuration, statistics, and permissions.
  - body: { inbox_id: integer, account_id: integer }
- `POST https://api.mcp.ai/api/mailtrap/get/message/html` — Tool to retrieve the HTML body of a message from Mailtrap. Use when you need to get the formatted HTML content of a specific email message.
  - body: { inbox_id: integer, account_id: integer, message_id: integer }
- `POST https://api.mcp.ai/api/mailtrap/get/permission/resources` — Tool to retrieve all resources in account for permission management. Use when you need to see the hierarchical structure of projects, inboxes, and other resources with their access levels for the curr
  - body: { account_id: integer }
- `POST https://api.mcp.ai/api/mailtrap/get/project` — Tool to retrieve project details from Mailtrap by project ID. Use when you need to get information about a specific project including its inboxes, permissions, and share links.
  - body: { account_id: integer, project_id: integer }
- `POST https://api.mcp.ai/api/mailtrap/get/sending/domain` — Tool to retrieve sending domain details from Mailtrap. Use when you need to check domain configuration, DNS verification status, or tracking settings.
  - body: { account_id: integer, sending_domain_id: integer }
- `POST https://api.mcp.ai/api/mailtrap/get/sending/stats` — Tool to retrieve email sending statistics from Mailtrap for a specific account. Use when you need metrics like delivery rate, bounce rate, open rate, click rate, and spam rate for a date range.
  - body: { end_date: string, account_id: integer, categories?: string[], start_date: string, sending_streams?: string[], sending_domain_ids?: integer[], email_service_providers?: string[] }
- `POST https://api.mcp.ai/api/mailtrap/get/sending/stats/by/categories` — Tool to retrieve email sending statistics grouped by categories. Use when you need to analyze email performance metrics (delivery, bounce, open, click, spam rates) segmented by email categories within
  - body: { end_date: string, account_id: integer, categories?: string[], start_date: string, sending_streams?: string[], sending_domain_ids?: integer[], email_service_providers?: string[] }
- `POST https://api.mcp.ai/api/mailtrap/get/sending/stats/by/date` — Tool to retrieve email sending statistics aggregated by date. Use when you need to analyze email delivery performance, bounce rates, open rates, click rates, and spam rates for a specific date range.
  - body: { end_date: string, account_id: integer, categories?: string[], start_date: string, sending_streams?: string[], sending_domain_ids?: integer[], email_service_providers?: string[] }
- `POST https://api.mcp.ai/api/mailtrap/get/sending/stats/by/domains` — Tool to retrieve sending statistics grouped by domains for a Mailtrap account. Use when you need email delivery, bounce, open, click, and spam metrics broken down by sending domain for a specific date
  - body: { end_date: string, account_id: integer, categories?: string[], start_date: string, sending_streams?: string[], sending_domain_ids?: integer[], email_service_providers?: string[] }
- `POST https://api.mcp.ai/api/mailtrap/get/sending/stats/by/esp` — Tool to retrieve email sending statistics grouped by email service providers (ESPs) for a specified date range. Returns delivery, bounce, open, click, and spam metrics for each ESP. Use when you need 
  - body: { end_date: string, account_id: integer, categories?: string[], start_date: string, sending_streams?: string[], sending_domain_ids?: integer[], email_service_providers?: string[] }
- `POST https://api.mcp.ai/api/mailtrap/import/contacts` — Tool to import contacts in bulk to Mailtrap. Use when you need to add or update multiple contacts at once. The import operation is asynchronous and returns a job ID that can be used to check the statu
  - body: { contacts: object[], account_id: integer }
- `POST https://api.mcp.ai/api/mailtrap/list/accounts` — Tool to list all Mailtrap accounts you have access to. Use when you need to retrieve account information or get account IDs for other operations. Returns account ID, name, and access levels (1000=owne
- `POST https://api.mcp.ai/api/mailtrap/list/contact/fields` — Tool to get all contact fields for a Mailtrap account. Use when you need to retrieve custom field definitions for contacts.
  - body: { account_id: integer }
- `POST https://api.mcp.ai/api/mailtrap/list/contact/lists` — Tool to retrieve all contact lists for a Mailtrap account. Use when you need to view available contact lists or obtain contact list IDs for other operations.
  - body: { account_id: integer }
- `POST https://api.mcp.ai/api/mailtrap/list/email/templates` — Tool to retrieve all email templates for a Mailtrap account. Use when you need to list available templates, browse template configurations, or find a specific template by name or attributes.
  - body: { account_id: integer }
- `POST https://api.mcp.ai/api/mailtrap/list/inboxes` — Tool to get a list of inboxes for a Mailtrap account. Use when you need to retrieve all inboxes associated with an account ID. Returns the list of inboxes with their configuration, permissions, and st
  - body: { account_id: integer }
- `POST https://api.mcp.ai/api/mailtrap/list/messages` — Tool to get messages from a Mailtrap inbox. Use when you need to retrieve emails from a specific inbox, with support for search filtering and pagination. Returns up to 30 messages per request.
  - body: { page?: integer, search?: string, last_id?: integer, inbox_id: integer, account_id: integer }
- `POST https://api.mcp.ai/api/mailtrap/list/projects` — Tool to get a list of projects for a Mailtrap account. Use when you need to retrieve all projects and their associated inboxes for a specific account. Returns project attributes, permissions, and nest
  - body: { account_id: integer }
- `POST https://api.mcp.ai/api/mailtrap/list/sending/domains` — Tool to list all sending domains for a Mailtrap account. Use when you need to retrieve configured domains for email sending.
  - body: { account_id: integer }
- `POST https://api.mcp.ai/api/mailtrap/list/suppressions` — Tool to list suppressed email addresses for a Mailtrap account. Use when you need to view which emails are blocked from receiving messages due to bounces, complaints, unsubscribes, or manual suppressi
  - body: { email?: string, end_time?: string, account_id: integer, start_time?: string }
- `POST https://api.mcp.ai/api/mailtrap/mark/inbox/as/read` — Tool to mark all messages in a Mailtrap inbox as read. Use when you need to mark all unread messages as read in a specific inbox.
  - body: { inbox_id: integer, account_id: integer }
- `POST https://api.mcp.ai/api/mailtrap/reset/inbox/credentials` — Tool to reset SMTP credentials for a Mailtrap inbox. Use when you need to regenerate the username and password for inbox access.
  - body: { inbox_id: integer, account_id: integer }
- `POST https://api.mcp.ai/api/mailtrap/update/contact` — Tool to update an existing contact in Mailtrap. Use when you need to modify contact details such as email, custom fields, list memberships, or subscription status. If the contact doesn't exist, it wil
  - body: { contact: object, account_id: integer, contact_identifier: string }
- `POST https://api.mcp.ai/api/mailtrap/update/contact/field` — Tool to update a contact field in Mailtrap. Use when you need to modify the name or merge tag of an existing contact field.
  - body: { name?: string, field_id: integer, merge_tag?: string, account_id: integer }
- `POST https://api.mcp.ai/api/mailtrap/update/contact/list` — Tool to update a contact list's name in Mailtrap. Use when you need to rename an existing contact list.
  - body: { name: string, list_id: integer, account_id: integer }
- `POST https://api.mcp.ai/api/mailtrap/update/email/template` — Tool to update an existing email template in Mailtrap account. Use when you need to modify template properties such as name, subject, category, HTML body, or plain text body. All fields in the email_t
  - body: { account_id: integer, email_template: object, email_template_id: integer }
- `POST https://api.mcp.ai/api/mailtrap/update/inbox` — Tool to update an inbox's settings in Mailtrap. Use when you need to change the inbox name or email username.
  - body: { inbox: object, inbox_id: integer, account_id: integer }
- `POST https://api.mcp.ai/api/mailtrap/update/project` — Tool to update a project's name in Mailtrap. Use when you need to rename an existing project.
  - body: { project: object, account_id: integer, project_id: integer }

## Example prompts
- "What can I do in Mailtrap?"
- "Show me a summary of my Mailtrap account"

## More
- Page: https://mcp.ai/mailtrap
- Agent spec (llms.txt): https://mcp.ai/mailtrap/llms.txt
- Postman collection: https://mcp.ai/mailtrap/postman.json
