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:

1

Add Mailtrap MCP to Windsurf

To add the Mailtrap MCP server to Windsurf:

  1. Open Windsurf

  2. Navigate to Settings → Windsurf Settings

  1. On the Windsurf Settings page, click the Manage MCPs button

This will open the mcp.config.json file. Add the following code snippet:

mcp.config.json
{
  "mcpServers": {
    "mailtrap": {
      "command": "npx",
      "args": ["-y", "mcp-mailtrap"],
      "env": {
        "MAILTRAP_API_TOKEN": "your_mailtrap_api_token",
        "DEFAULT_FROM_EMAIL": "[email protected]"
      }
    }
  }
}
2

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.

Although you shouldn't face any issues, reload Windsurf to ensure everything is set up correctly.

3

Send emails with a prompt

To send an email:

  1. Open the Cascade sidebar in the upper-right corner

  2. Make sure the Mailtrap MCP server is enabled under Customizations

  1. 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?