> Documentation index: https://metorial.com/llms.txt. Every page is available as Markdown by adding .md to its URL.

# Set up Mailtrap in Metorial for Claude, ChatGPT and Cursor
URL: https://metorial.com/docs/integrations/mailtrap
Last updated: 2026-11-24

Share Mailtrap with your team in Claude, ChatGPT and Cursor through Metorial: API token sign-in, 15 tools (8 read-only).

---

To give your team Mailtrap in Claude, ChatGPT, Cursor and other AI clients, an admin shares the Mailtrap integration in a Metorial portal, and each person connects with an API token. Agents can send transactional and bulk emails, manage email templates, and test emails in a sandbox environment. The integration has 15 tools, 8 read-only and 7 write, plus 1 trigger.

**What you will learn**

- How an admin shares Mailtrap in a portal and how each person connects
- What Mailtrap asks for when you connect, and where to find it
- How to keep the 8 read-only tools and reject the other 7

**Before you start**

- A [portal](https://metorial.com/docs/platform/workforce/portals) with at least one access group
- An API token from Mailtrap for each person, or one for a shared connection
- For the CLI steps: the [Metorial CLI](https://metorial.com/docs/platform/cli), signed in to your portal

## Sign-in method

| Method | Type | What a person provides |
| --- | --- | --- |
| **API Token** | API token | `token` |

### API Token

To connect, a person enters:

- `token`: Mailtrap API token. Generate one in Settings → API Tokens in the Mailtrap dashboard.

### Setup settings

Setup also asks for:

- `accountId`: Your Mailtrap account ID. Found in the Mailtrap dashboard URL or account settings.

## Admin: share Mailtrap in a portal

### In the dashboard

1. **Open Shared Resources**

   Open **Workforce**, choose the portal, and select **Shared Resources** under **Access**.

2. **Share a new integration**

   Select **Share a Resource**, then **New Integration**, and choose Mailtrap. For how members connect, choose **Each person connects** so everyone enters their own API token, or **Shared connection** to enter one API token for everyone.

3. **Limit the tools**

   Under **Tool Filters**, set the write and destructive groups to **Reject** if agents should only read from Mailtrap.

4. **Choose who gets it**

   Add the access groups that should see Mailtrap. When a person asks for access from the portal, the request appears under **Access Requests**.

### With the CLI

The CLI cannot create the per-user Mailtrap integration. Once it exists, check which groups have it:

```bash
metorial-admin portals access list <portal-id> --type provider_template --search mailtrap
```

## Employee: connect Mailtrap

### In the portal

1. **Open Mailtrap in the catalog**

   Sign in to your portal and open Mailtrap. The status reads **Available**.

2. **Authenticate**

   Under **Quick setup**, select **Authenticate**. In the setup window, enter your API token (token).

3. **Confirm**

   The status changes to **Configured**. If it later reads **Needs reconnect**, select **Reconnect** and sign in again.

### With the CLI

```bash
metorial catalog search mailtrap
metorial setup <catalog-item-id>
```

`catalog search` prints the catalog item ID. 

### Add it to your AI client

`metorial install` adds your Mailtrap connection to a local MCP client such as Claude Code, Cursor or Codex. `metorial list` prints the integration ID and `metorial client list` the client identifiers.

```bash
metorial list mailtrap
metorial client list
metorial install <client-identifier> <integration-id>
```

For a client that takes a server URL, such as ChatGPT, `metorial install custom <integration-id>` creates an installation token and shows the endpoint details.

## Make it read-only

Open the integration's **Tool Filters** and set the write and destructive groups to **Reject**. Agents keep the 8 read-only tools, such as `get_email_log` and `list_accounts`, and lose the 7 write tools, such as `manage_contact` or `send_bulk_email`.

Employees see the result on the integration's page in the portal under **Tool access**. For the full walkthrough, see [Tool permissions](https://metorial.com/docs/platform/guides/tool-permissions).

## Check it worked

```bash
metorial list mailtrap
metorial tools <integration-id>
metorial call <integration-id> list_accounts -d '{}'
```

`metorial tools` lists the 15 tools, minus any you rejected. `list_accounts` takes no input. It lists all Mailtrap accounts accessible with the current API token.

To see every input a tool takes, run `metorial schema <integration-id> <tool-key>`.

## Tools

### Read-only tools (8)

- `get_email_log`: Get detailed information about a specific sent email by its message ID. Needs `messageId`.
- `list_sandbox_inboxes`: Discover accessible sandbox inbox IDs, names, project memberships, and message counts.
- `list_sandbox_projects`: List all sandbox projects and their inboxes.
- `list_sandbox_messages`: List emails captured in a Mailtrap sandbox inbox. Needs `inboxId`.
- `list_email_logs`: Search and retrieve individual email delivery logs.
- `list_accounts`: List all Mailtrap accounts accessible with the current API token.
- `list_contacts`: Search contacts by email substring, subscription status, or contact list.
- `get_email_stats`: Retrieve delivery statistics for your sent emails over a date range. Needs `startDate` and `endDate`.

### Write tools (7)

- `manage_contact`: Create, retrieve, update, or delete a contact in your Mailtrap account. Needs `action`.
- `manage_sending_domain`: List, create, retrieve, or delete sending domains. Needs `action`.
- `manage_suppressions`: List or remove email suppression entries. Needs `action`.
- `manage_contact_list`: Create, list, update, or delete contact lists. Needs `action`.
- `send_transactional_email`: Send a transactional email triggered by user actions such as password resets, welcome emails, or order confirmations. Needs `from`, `to` and `subject`.
- `send_bulk_email`: Send a bulk/promotional email using Mailtrap's dedicated bulk infrastructure. Needs `from`, `to` and `subject`.
- `get_sandbox_message`: Retrieve detailed information about a specific email in a sandbox inbox, including its HTML/text body, spam report, HTML analysis, and attachments. Needs `inboxId`, `messageId` and `action`.

## Triggers

Mailtrap has 1 trigger, which fire on events in Mailtrap:

- `email_event`: Receive real-time webhook notifications for email delivery events including delivery, open, click, unsubscribe, spam complaint, bounce, soft bounce, suspension, and reject.

## Next steps

- [Claude Code](https://metorial.com/docs/platform/clients/claude-code), [Cursor](https://metorial.com/docs/platform/clients/cursor), [Codex](https://metorial.com/docs/platform/clients/codex) and [ChatGPT](https://metorial.com/docs/platform/clients/chatgpt): connect each client to your portal and use Mailtrap there
- [Tool permissions](https://metorial.com/docs/platform/guides/tool-permissions): tool filters and what employees see
- [Mailtrap on metorial.com](https://metorial.com/integrations/mailtrap): the integration overview