Windsurf
Windsurf is an AI coding assistant for developers and enterprises that understands your entire codebase and can plan, execute, and iterate on complex multi-file tasks autonomously.
In this guide, you’ll learn how to integrate it with the Mailtrap MCP, which allows you to, amongst other things, perform the following actions:
Prerequisites
Before you start, make sure to:
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.
Step 1. Add Mailtrap MCP config to Windsurf
Open Windsurf, then navigate to Settings → Windsurf Settings.

Under Cascade, you will see the Open MCP Marketplace button. Click on it, and you’ll be taken to the MCP Marketplace page.

On the MCP Marketplace page, click on the Cogwheel button, which will open the mcp.config.json file.

Then, in the mcp.config.json file, copy/paste the following code snippet:
Step 2. Insert Mailtrap credentials
Next, all you need to do is replace the following values in the mcp_config.json file:
MAILTRAP_API_TOKEN– Required for all functionality, used to authenticate API requests, which you can copy/paste from the credentials tab.DEFAULT_FROM_EMAIL– Required for email sending. Make sure the email’s domain matches your own domain from the Sending Domains tab in Mailtrap.
You can find these credentials in your Mailtrap account by navigating to Sending Domains → Integration → API.

MAILTRAP_ACCOUNT_ID– This is required for template management purposes. You can find the account ID under Settings → Account Settings.

MAILTRAP_TEST_INBOX_ID– If you need sandbox email functionality, you can find this ID in your Sandbox.

Once you insert your Mailtrap credentials, hit save, and you should see the Mailtrap MCP on the MCP Marketplace page.

If you click on the newly-installed Mailtrap MCP, you’ll see the list of available tools it comes with.

Windsurf + Mailtrap MCP server use cases
Connect Mailtrap to your project
To integrate Mailtrap without manual coding, simply prompt the Windsurf AI to connect Mailtrap to your project with a prompt like this one:
Integrate Mailtrap into my project so that it can send emails through the Mailtrap email API. Additionally, safely store the Mailtrap credentials from the MCP configuration into an .env file
Windsurf AI will then go through the Mailtrap documentation, integrate the email API, and safely store your credentials in a .env file. Then, you can proceed to test the configuration. For instance, here’s our contact form email in our Gmail inbox we used as our to address:

And here is the same email in the Mailtrap Email Logs:

Sandbox operations during debugging
Reviewing code for sending emails or emails themselves in a staging environment using Sandbox?
With Windsurf connected to Mailtrap MCP, you can complete the following actions by prompting the agent:
Verify what the code actually does without switching to the Mailtrap UI and back to the IDE
Inspect basic message metadata
Use the returned message ID to request full message details (content, headers, etc.), and more.

Template validation
If you want to edit your email templates without switching to the Mailtrap UI, you can prompt the Windsurf AI to list them and fetch a specific template ID:

Then, if you’re not satisfied with a subject line or two, you can also change them with a simple prompt, just like so:

Sending emails to your teammate
Done revising your emails in Sandbox? If so, you can ask the Windsurf AI to send them to a teammate for a quick review:

Last updated
Was this helpful?

