The MCP Mailtrap Server is a tool that enables sending transactional emails via Mailtrap directly from your AI assistant. It integrates with Claude, VS Code, and Cursor, allowing you to easily compose and send emails without leaving your development environment.
You can install the MCP Mailtrap Server using NPX:
npx -y mcp-mailtrap
Add the following configuration to your settings file:
{
"mcpServers": {
"mailtrap": {
"command": "npx",
"args": ["-y", "mcp-mailtrap"],
"env": {
"MAILTRAP_API_TOKEN": "your_mailtrap_api_token",
"DEFAULT_FROM_EMAIL": "[email protected]"
}
}
}
}
If you're using asdf
for Node.js management, use absolute paths:
{
"mcpServers": {
"mailtrap": {
"command": "/Users/<username>/.asdf/shims/npx",
"args": ["-y", "mcp-mailtrap"],
"env": {
"PATH": "/Users/<username>/.asdf/shims:/usr/bin:/bin",
"ASDF_DIR": "/opt/homebrew/opt/asdf/libexec",
"ASDF_DATA_DIR": "/Users/<username>/.asdf",
"ASDF_NODEJS_VERSION": "20.6.1",
"MAILTRAP_API_TOKEN": "your_mailtrap_api_token",
"DEFAULT_FROM_EMAIL": "[email protected]"
}
}
}
}
For Claude Desktop:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
For Cursor:
~/.cursor/mcp.json
%USERPROFILE%\.cursor\mcp.json
Open User Settings (JSON) from the Command Palette and add:
{
"mcp": {
"servers": {
"mailtrap": {
"command": "npx",
"args": ["-y", "mcp-mailtrap"],
"env": {
"MAILTRAP_API_TOKEN": "your_mailtrap_api_token",
"DEFAULT_FROM_EMAIL": "[email protected]"
}
}
}
}
}
Remember to restart your MCP server after changing the environment variables.
Once configured, you can ask your AI assistant to send emails with natural language requests:
This tool sends transactional emails through Mailtrap.
Parameters:
to
(required): Email address of the recipientsubject
(required): Email subject linefrom
(optional): Sender's email address (uses DEFAULT_FROM_EMAIL if not specified)text
(optional): Plain text email body (required if html is empty)html
(optional): HTML version of the email body (required if text is empty)cc
(optional): Array of CC recipient email addressesbcc
(optional): Array of BCC recipient email addressescategory
(optional): Email category for tracking purposesThere are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.