Windsurf
With the Windsurf Mailtrap integration, you can send emails directly from Windsurf using the Cascade AI assistant and simple prompts.
Mailtrap is an email-sending solution for developer and product teams focused on fast delivery and high inboxing rates for transactional and promo emails. It provides a highly customizable API and 24/7 technical support.
In this guide, you'll set up the integration and send emails in three steps.
Prerequisites
Before you start, ensure the following:
Set up your sending domain — this takes approximately 5 minutes
Install the latest Node.js version since Mailtrap MCP is implemented as a Node.js command line utility
Install or update Windsurf to the latest version
Add Mailtrap MCP to Windsurf
To add the Mailtrap MCP server to Windsurf:
Open Windsurf
Navigate to Settings → Windsurf Settings

On the Windsurf Settings page, click the Manage MCPs button

This will open the mcp.config.json file. Add the following code snippet:
{
"mcpServers": {
"mailtrap": {
"command": "npx",
"args": ["-y", "mcp-mailtrap"],
"env": {
"MAILTRAP_API_TOKEN": "your_mailtrap_api_token",
"DEFAULT_FROM_EMAIL": "[email protected]"
}
}
}
}Add Mailtrap API credentials
Replace the following values in your mcp.config.json file:
MAILTRAP_API_TOKEN — Authentication token for API requests. You can copy this from the Credentials tab in your Mailtrap account
DEFAULT_FROM_EMAIL — Must match your verified domain in Mailtrap's Sending Domains tab
Find these credentials in your Mailtrap account by navigating to Sending Domains → Integration → API.

Send emails with a prompt
To send an email:
Open the Cascade sidebar in the upper-right corner
Make sure the Mailtrap MCP server is enabled under Customizations

Use this prompt (or create your own):
Send an email to [email protected] with the subject 'Hi John!' and a message that wishes John a great day.Cascade will process your request and confirm the email was sent:

Verify in Gmail
The email will arrive in your inbox:

Check Mailtrap Email Logs
You can also verify the email in the Email Logs tab of your Mailtrap dashboard:

Last updated
Was this helpful?

