Augment Code
Augment Code is an AI coding assistant that runs as an extension on top of your existing editor including VS Code and JetBrains IDEs. It enhances the editors with an intelligent Agent that can understand your codebase, run tasks autonomously, and integrate external tools via Model Context Protocol (MCP).
With Mailtrap's MCP server connected to Augment Code, you can create and test email templates in sandbox. And the assistant can help you set up Mailtrap sending. All actions run directly from your editor using Augment Agent and simple prompts; no manual API calls, no switching context.
In this guide, you'll learn how to set up the integration and create a template in three steps.
Note: Mailtrap offers a free, 4000 email/month Email API and SMTP plan.
Prerequisites
Before you begin, make sure you have the following in place:
A Mailtrap account with at least one sending domain set up and verified. This ensures your from address is authorized for delivery. If you haven't done this yet, refer to the Mailtrap Sending Domains setup guide.
Node.js installed and up to date. The Mailtrap MCP server is distributed as a Node-based CLI (
mcp-mailtrap) and runs via npx.The latest version of Augment Code installed in your editor. MCP support is available in both the VS Code and JetBrains extensions. And we tested it on VS Code.
Step 1. Fetch Mailtrap API Credentials
To authenticate with Mailtrap, you need four values. You’ll need an API token and a verified From address, as well as account ID for templates and inbox ID, if you’d like to use Sandbox. Here's the flow:
Log into your Mailtrap account.
Click the Settings drop-down, select API Tokens, click Add Token, give it a name and make sure to tick the Admin permissions for email-sending.

Copy your API token – this is your
MAILTRAP_API_TOKENvalue.Your
DEFAULT_FROM_EMAILmust be an address on the same domain you verified in Sending Domains (e.g. hello@yourdomain.com).To have full MCP functionality, you’ll also need
MAILTRAP_ACCOUNT_IDto manage templates, andMAILTRAP_TEST_INBOX_IDfor Sandbox tests (see step 6 below to locate the variables).
Step 2. Add Mailtrap MCP to Augment Code
Mailtrap MCP is not in the Easy MCP catalog, so you'll configure it manually. Augment Code offers two ways to do this; use whichever suits your workflow.
Step 3. Create an email template with a prompt
With the MCP server configured, you're ready to send emails directly from Augment Agent.
Open the Augment panel in your editor and switch to the Agent tab.
Confirm that the Mailtrap MCP server appears as an active tool; you can check this in the Agent's tool list or MCP status area within the Settings panel.
In the Agent input field, type a natural-language prompt. For example:
"Create a new email template called 'Welcome Email' with subject 'Welcome to our platform!'"
Augment Agent will use the Mailtrap MCP server to execute the action and confirm the result in the conversation.
Check Mailtrap Templates
Go back to Mailtrap, click Templates under General, then click the Welcome Email template name to confirm the action and inspect the template.

Last updated
Was this helpful?




