Mailtrap MCP server

Enables sending transactional emails through Mailtrap with support for HTML/text content, multiple recipients, and email categorization using API token authentication.
Back to servers
Provider
Railsware Products Studio LLC
Release date
Apr 10, 2025
Language
TypeScript
Package
Stats
512 downloads
34 stars

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.

Installation Options

NPM Installation

You can install the MCP Mailtrap Server using NPX:

npx -y mcp-mailtrap

Configuration Setup

Claude Desktop or Cursor

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]"
      }
    }
  }
}
Configuration File Locations

For Claude Desktop:

  • Mac: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json

For Cursor:

  • Mac: ~/.cursor/mcp.json
  • Windows: %USERPROFILE%\.cursor\mcp.json

VS Code Configuration

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.

Using the MCP Mailtrap Server

Once configured, you can ask your AI assistant to send emails with natural language requests:

Available Email Functions

send-email

This tool sends transactional emails through Mailtrap.

Parameters:

  • to (required): Email address of the recipient
  • subject (required): Email subject line
  • from (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 addresses
  • bcc (optional): Array of BCC recipient email addresses
  • category (optional): Email category for tracking purposes

How to add this MCP server to Cursor

There 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.

Adding an MCP server to Cursor globally

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"
            ]
        }
    }
}

Adding an MCP server to a project

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.

How to use the MCP server

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.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later