Mailtrap MCP server
49 operations0 webhooks
Email testing and delivery platform for safe staging inboxes and transactional sending.
Try Mailtrap with your agent
Connect Mailtrap, then paste this into Claude, ChatGPT or Cursor. For ideas from other apps, see the use cases.
Using Corsair, show me what you can do in Mailtrap on my account, then run one read-only example and show me the result.
Mailtrap tools and triggers
Tools are what your agent can do in Mailtrap through Corsair's MCP server. Triggers are the Mailtrap events a routine can start from.
Contacts
- CreateWrite
Create a contact
contacts.create
- Create EventWrite
Record a custom event against a contact
contacts.createEvent
- Create ExportWrite
Start an async export of contacts matching a filter
contacts.createExport
- DeleteDestructive
Permanently delete a contact
contacts.delete
- GetRead-only
Get a contact by id or email
contacts.get
- Get ExportRead-only
Get the status/download URL of a contact export job
contacts.getExport
- Get ImportRead-only
Get the status of a contact import job
contacts.getImport
- ImportWrite
Bulk-import contacts, upserting by email
contacts.import
- UpdateWrite
Update a contact by id or email
contacts.update
Inboxes
- CleanDestructive
Delete every message in a sandbox inbox
inboxes.clean
- GetRead-only
Get an inbox's attributes, including its SMTP credentials
inboxes.get
- ListRead-only
List sandbox inboxes
inboxes.list
- Mark As ReadWrite
Mark every message in a sandbox inbox as read
inboxes.markAsRead
- Reset CredentialsDestructive
Reset an inbox's SMTP credentials, invalidating the previous ones
inboxes.resetCredentials
- UpdateWrite
Update an inbox's name and/or email username
inboxes.update
Contact Fields
- CreateWrite
Create a custom contact field
contactFields.create
- DeleteDestructive
Permanently delete a custom contact field, dropping its stored values off every contact
contactFields.delete
- GetRead-only
Get a custom contact field by id
contactFields.get
- ListRead-only
List custom contact fields
contactFields.list
- UpdateWrite
Update a custom contact field
contactFields.update
Contact Lists
- CreateWrite
Create a contact list
contactLists.create
- DeleteDestructive
Permanently delete a contact list
contactLists.delete
- GetRead-only
Get a contact list by id
contactLists.get
- ListRead-only
List contact lists
contactLists.list
- UpdateWrite
Rename a contact list
contactLists.update
Email Templates
- CreateWrite
Create an email template
emailTemplates.create
- DeleteDestructive
Permanently delete an email template
emailTemplates.delete
- GetRead-only
Get an email template by id
emailTemplates.get
- ListRead-only
List email templates
emailTemplates.list
- UpdateWrite
Update an email template
emailTemplates.update
Stats
- By CategoriesRead-only
Get sending stats broken down by category
stats.byCategories
- By DateRead-only
Get sending stats broken down by day
stats.byDate
- By DomainsRead-only
Get sending stats broken down by sending domain
stats.byDomains
- By EspRead-only
Get sending stats broken down by recipient email service provider
stats.byEsp
- GetRead-only
Get aggregated sending stats for a date range
stats.get
Projects
- DeleteDestructive
Permanently delete a project and every inbox in it
projects.delete
- GetRead-only
Get a project and its inboxes by id
projects.get
- ListRead-only
List projects and their sandbox inboxes
projects.list
- UpdateWrite
Rename a project
projects.update
Sending Domains
- CreateWrite
Register a sending domain for DNS verification
sendingDomains.create
- DeleteDestructive
Permanently remove a sending domain
sendingDomains.delete
- GetRead-only
Get a sending domain by id, including its DNS records
sendingDomains.get
- ListRead-only
List sending domains
sendingDomains.list
Account
- Get Billing UsageRead-only
Get billing usage against the account's testing/sending/marketing plan limits
account.getBillingUsage
- Get Permission ResourcesRead-only
Get every resource (inboxes, projects, domains, billing, account) the token has admin access to, nested by hierarchy
account.getPermissionResources
- List AccountsRead-only
List Mailtrap accounts the token can access
account.listAccounts
Messages
- Get HtmlRead-only
Get the formatted HTML body of a message
messages.getHtml
- ListRead-only
List messages in a sandbox inbox
messages.list
Suppressions
- ListRead-only
List (and optionally search) suppressed email addresses
suppressions.list
Connect Mailtrap to Claude, ChatGPT or Cursor
- 1
Connect Mailtrap in Corsair
Add your Mailtrap API key once in Corsair. Corsair stores the credential encrypted and makes the Mailtrap API calls for your agent, so it never goes into a prompt or a config file. Connect Mailtrap
If your link lets the agent add apps, you can skip this: it gives you a sign-in link the first time it needs Mailtrap. On a ChatGPT personal plan, connect Mailtrap here first.
- 2
Add Corsair's MCP server to your agent
Every client uses the same address:
https://mcp.corsair.dev/mcpOpen Plugins → Add → Add custom connector, name it Corsair, paste the address, select Continue, then Add.Install Corsair from ChatGPT's plugin directory, connect it and sign in. A custom MCP server with the address works too, but personal plans get its read tools only.Add to Cursor / Grok BuildOr add this to~/.cursor/mcp.json. It opens Corsair to sign in the first time it connects.{ "mcpServers": { "corsair": { "url": "https://mcp.corsair.dev/mcp" } } }Run this, then run/mcpin Claude Code to sign in.claude mcp add --transport http corsair https://mcp.corsair.dev/mcpCodex, Antigravity, Gemini CLI, VS Code, Zed and other clients with OAuth sign-in work the same way. Clients without it, such as GitHub Copilot's coding agent, use a link's own address and an API key. Setup for every client
- 3
Sign in and choose what needs your approval
Your client opens Corsair to sign in. Pick a link: the apps your agent can use and a mode that decides what it may do without asking. In the default Cautious mode, Mailtrap's read and write operations run right away and its 8 destructive operations wait for your approval. Strict mode asks before every write and refuses destructive operations, and Read mode allows reads only.
FAQ
Install corsair and @corsair-dev/mailtrap, add the Mailtrap plugin, and connect with an API key. Then call methods like corsair.mailtrap.api.account.getBillingUsage() from your app. Corsair syncs data per tenant.
Yes. Mailtrap requires an API key from your Mailtrap account or developer dashboard. Create credentials with access that matches what you automate, then paste them into Corsair or connect through managed auth in Hub.
Yes. One Corsair client can hit Mailtrap, GitHub, Notion, Stripe, and the rest. Trigger Mailtrap from a webhook, push updates to Slack, or chain actions across plugins. Same tenant context across integrations, plain TypeScript.
Teams use Corsair for email testing and delivery platform for safe staging inboxes and transactional sending. Common builds include sync jobs, admin tooling, and agents that call Mailtrap APIs from your backend. Local DB entities let you query synced Mailtrap records without hitting the API on every read.
The SDK is open source. Self-host and you pay Corsair nothing for the integration layer. Hub bills for hosted auth and execution, not per Mailtrap API call. Hub has a generous free tier. For hobby projects you can probably run the whole thing on free. Paid plans start to matter with more tenants or heavier traffic.
We maintain @corsair-dev/mailtrap in the open repo. When Mailtrap ships API changes, upgrade the package. Your call sites stay typed. You should not need to rewrite the integration layer each time.
No. Corsair does not read your Mailtrap data or hold individual access credentials. Credentials stay in your database. API calls run on your instance. We do not store Mailtrap data on your behalf.
Yes. Add https://mcp.corsair.dev/mcp as a custom connector or MCP server in Claude, ChatGPT, Cursor, VS Code, Claude Code, Codex or any client that supports remote MCP servers with OAuth sign-in, then sign in to Corsair. On ChatGPT personal plans, custom servers currently get read tools only.
Yes. Put Mailtrap on a link in Strict mode and every write waits for your approval, while destructive actions are refused. The default Cautious mode asks only before the 8 destructive Mailtrap operations. You can change a link's mode at hub.corsair.dev/me.