How it works
When you add mcp-mailtrap to your Cursor config, the agent gains access to Mailtrap’s Email API, Email Sandbox, and template management. Describe what you need in plain language and the agent calls the right Mailtrap tool, shows you the parameters, and executes the call on confirmation without leaving your IDE.

Configuration
Step 1: Node.js — mcp-mailtrap runs as a Node.js CLI utility. Install it first.
Step 2: Open Cursor Settings → MCP and click Add new global MCP server.
Step 3: Paste the following into ~/.cursor/mcp.json:
{
"mcpServers": {
"mailtrap": {
"command": "npx",
"args": ["-y", "mcp-mailtrap"],
"env": {
"MAILTRAP_API_TOKEN": "your_mailtrap_api_token",
"DEFAULT_FROM_EMAIL": "your_sender@example.com",
"MAILTRAP_ACCOUNT_ID": "your_account_id",
"MAILTRAP_TEST_INBOX_ID": "your_test_inbox_id"
}
}
}
}
Step 4: Replace the placeholder values with your Mailtrap credentials (API token, verified sender address, account ID, and test inbox ID).
Step 5: Open the AI pane, switch to Agent mode, and confirm Mailtrap appears in the MCP tool list.
Note: DEFAULT_FROM_EMAIL must be an address on a domain you’ve verified in Mailtrap’s Sending Domains. MAILTRAP_ACCOUNT_ID is found under Settings → Account Settings; MAILTRAP_TEST_INBOX_ID is in your sandbox inbox URL.
For detailed guidance, consult the knowledge base article.
Use Cases
- Get your template content to check variable names
- Real-time Sandbox Debugging – send and preview messages from cursor directly
- Edit your templates and check how they look like in Sandbox
Supported Functionality
- Send transactional emails
- Manage email templates
- Use Email Sandbox for testing
- Track delivery statistics (opens, clicks, bounces)
- Manage sending streams