Augment Code

Augment Codearrow-up-right 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.

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 guidearrow-up-right.

  • Node.jsarrow-up-right installed and up to date. The Mailtrap MCP serverarrow-up-right 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_TOKEN value.

  • Your DEFAULT_FROM_EMAIL must be an address on the same domain you verified in Sending Domains (e.g. [email protected]envelope).

  • To have full MCP functionality, you’ll also need MAILTRAP_ACCOUNT_ID to manage templates, and MAILTRAP_TEST_INBOX_ID for Sandbox tests (see step 6 below to locate the variables).

circle-info

Replace the placeholder values in your MCP configuration (whether added via GUI or JSON) with the credentials on your account.

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.

chevron-rightOption A: Settings Panel (GUI)hashtag
  • Open the Augment panel in your editor.

  • Click the options menu (gear icon) in the upper-right corner of the panel and select Settings.

  • In the Settings panel, scroll to the MCP section.

  • Click the + button next to the MCP header to add a new server.​

  • Fill in the fields as follows:

    • Name: mailtrap

    • Command & Args: npx -y mcp-mailtrap

  • In the Environment Variables section, click ‘+ Variable’, and add the following entries:

    • MAILTRAP_API_TOKEN → (your Mailtrap API token — see Step 2)

    • DEFAULT_FROM_EMAIL → (your verified sending domain address, e.g. [email protected]envelope)

    • MAILTRAP_ACCOUNT_ID → (click Settings, then Account Settings to reveal the ID)

    • MAILTRAP_TEST_INBOX_ID → (find the ID in the inbox URL- for example: https://mailtrap.io/your_inbox_ID/messages)

  • Click ‘Add’ to confirm.

chevron-rightOption B: Import from JSONhashtag
  • Open the Augment panel and navigate to Settings via the gear icon.

  • In the MCP section, click Import from JSON.

  • Paste the following configuration and click Save:

​Make sure to replace the placeholders with your variables prior to importing. If you've already saved the configuration with the placeholders, go back to SettingsMCP, click the more menu (...) next to the mailtrap server, and edit the environment variable values.

circle-info

If Augment Code doesn't immediately reflect the new server, try reloading your editor.

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?