Skip to main content
Glama

Mailtrap Email Sending

by railsware

TypeScript

MCP Mailtrap Server

An MCP server that provides tools for sending transactional emails and managing email templates via Mailtrap

Prerequisites

Before using this MCP server, you need to:

  1. Create a Mailtrap account
  2. Verify your domain
  3. Get your API token from Mailtrap API settings
  4. Get your Account ID from Mailtrap account management

Quick Install

Setup

Claude Desktop or Cursor

Add the following configuration:

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

If you are using asdf for managing Node.js you must use absolute path to executable (example for Mac)

{ "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": "your_sender@example.com", "MAILTRAP_ACCOUNT_ID": "your_account_id" } } } }
Claude Desktop config file location

Mac: ~/Library/Application Support/Claude/claude_desktop_config.json

Windows: %APPDATA%\Claude\claude_desktop_config.json

Cursor config file location

Mac: ~/.cursor/mcp.json

Windows: %USERPROFILE%\.cursor\mcp.json

VS Code

Manually changing config

Run in Command Palette: Preferences: Open User Settings (JSON)

Then, in the settings file, add the following configuration:

{ "mcp": { "servers": { "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" } } } } }

Tip

Don't forget to restart your MCP server after changing the "env" section.

Usage

Once configured, you can ask agent to send emails and manage templates, for example:

Email Operations:

Template Operations:

  • "List all email templates in my Mailtrap account"
  • "Create a new email template called 'Welcome Email' with subject 'Welcome to our platform!'"
  • "Update the template with ID 12345 to change the subject to 'Updated Welcome Message'"
  • "Delete the template with ID 67890"

Available Tools

send-email

Sends a transactional email through Mailtrap.

Parameters:

  • to (required): Email address of the recipient
  • subject (required): Email subject line
  • from (optional): Email address of the sender, if not provided "DEFAULT_FROM_EMAIL" will be used
  • text (optional): Email body text, 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 (required): Email category for tracking and analytics

create-template

Creates a new email template in your Mailtrap account.

Parameters:

  • name (required): Name of the template
  • subject (required): Email subject line
  • html (or text is required): HTML content of the template
  • text (or html is required): Plain text version of the template
  • category (optional): Template category (defaults to "General")

list-templates

Lists all email templates in your Mailtrap account.

Parameters:

  • No parameters required

update-template

Updates an existing email template.

Parameters:

  • template_id (required): ID of the template to update
  • name (optional): New name for the template
  • subject (optional): New email subject line
  • html (optional): New HTML content of the template
  • text (optional): New plain text version of the template
  • category (optional): New category for the template

Note

At least one updatable field (name, subject, html, text, or category) must be provided when calling update-template to perform an update.

delete-template

Deletes an existing email template.

Parameters:

  • template_id (required): ID of the template to delete

Development

  1. Clone the repository:
git clone https://github.com/railsware/mailtrap-mcp.git cd mailtrap-mcp
  1. Install dependencies:
npm install

Configuration with Claude Desktop or Cursor

Tip

See the location of the config file in the Setup section.

Add the following configuration:

{ "mcpServers": { "mailtrap": { "command": "node", "args": ["/path/to/mailtrap-mcp/dist/index.js"], "env": { "MAILTRAP_API_TOKEN": "your_mailtrap_api_token", "DEFAULT_FROM_EMAIL": "your_sender@example.com", "MAILTRAP_ACCOUNT_ID": "your_account_id" } } } }

If you are using asdf for managing Node.js you should use absolute path to executable:

(example for Mac)

{ "mcpServers": { "mailtrap": { "command": "/Users/<username>/.asdf/shims/node", "args": ["/path/to/mailtrap-mcp/dist/index.js"], "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": "your_sender@example.com", "MAILTRAP_ACCOUNT_ID": "your_account_id" } } } }

VS Code

Tip

See the location of the config file in the Setup section.

{ "mcp": { "servers": { "mailtrap": { "command": "node", "args": ["/path/to/mailtrap-mcp/dist/index.js"], "env": { "MAILTRAP_API_TOKEN": "your_mailtrap_api_token", "DEFAULT_FROM_EMAIL": "your_sender@example.com", "MAILTRAP_ACCOUNT_ID": "your_account_id" } } } } }

Testing

You can test the server using the MCP Inspector:

npm run dev

Contributing

Bug reports and pull requests are welcome on GitHub. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.

License

The package is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in the Mailtrap project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.

Deploy Server
A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

Mailtrap Email Platform と統合し、API 経由でトランザクション メールを送信できるようにします。

  1. 設定
    1. クロードデスクトップまたはカーソル
    2. VSコード
  2. 使用法
    1. 利用可能なツール
      1. メールを送信
    2. 発達
      1. Claude DesktopまたはCursorを使用した構成
      2. VSコード
    3. テスト
      1. 貢献
        1. ライセンス
          1. 行動規範

            Related MCP Servers

            • A
              security
              F
              license
              A
              quality
              Provides an interface to manage email marketing, contact lists, dynamic templates, and email analytics via SendGrid's API.
              Last updated -
              18
            • A
              security
              A
              license
              A
              quality
              Provides IMAP and SMTP capabilities, enabling developers to manage email services with seamless integration and automated workflows.
              Last updated -
              4
              73
              BSD 3-Clause
              • Apple
              • Linux
            • A
              security
              F
              license
              A
              quality
              Enables sending emails via SMTP with template management, supporting multiple SMTP configurations, template creation with variable substitution, and bulk email sending with rate limiting.
              Last updated -
              11
              6
            • -
              security
              A
              license
              -
              quality
              A server that provides integration with PayPal's APIs, enabling seamless interaction with payment processing, invoicing, subscription management, and business operations through a standardized interface.
              Last updated -
              MIT License

            View all related MCP servers

            MCP directory API

            We provide all the information about MCP servers via our MCP API.

            curl -X GET 'https://glama.ai/api/mcp/v1/servers/railsware/mailtrap-mcp'

            If you have feedback or need assistance with the MCP directory API, please join our Discord server