# Email MCP server

Connect an AI tool to your MailerSend account for live data access that makes task automation faster and more reliable.

[Try for free](/content/signup/index.html) [View documentation](https://developers.mailersend.com/mcp-server.html)

## Real-time AI power for developers

Turn any compatible AI tool into your very own smart email engine. Fetch information and perform everyday tasks based on real-time data, without the need to visit the app or make an API call.

###### Automate reporting and management

Cut down time spent creating reports and performing everyday email management tasks.

###### No-code actions

Create and send HTML emails and use your MailerSend email templates without coding a thing, using natural language prompts.

###### Your on-demand AI assistant

Ask your AI tool to analyze your deliverability, check task status, and optimize your workflows any time for instant results.

###### Easy account configuration

Skip the tedious configuration, like domain authentication or webhook creation, and let AI do the work for you.

## Email MCP in action

Wondering how exactly the MailerSend MCP server can make your life easier? Here’s a snapshot of what you can do.

- [**Send or schedule emails** \\
\\
Easily trigger HTML or plain text emails for an individual or group of recipients, or schedule emails such as maintenance notifications in just a few seconds.](/content/features/mcp/index.html)
- [**Troubleshoot sending issues** \\
\\
Take advantage of live account access to check for SPF/DKIM authentication issues, bounce rate, reputation score and more.](/content/features/mcp/index.html)
- [**Optimize your transactional emails** \\
\\
Get reports on low-performing emails based on unsubscribes, spam complaints, low open rate and more, and get suggestions for optimization.](/content/features/mcp/index.html)
- [**Set up common workflows** \\
\\
Use natural language prompts to instruct your AI tools to create workflows for new users, password resets, order confirmations and more.](/content/features/mcp/index.html)

## Connect the MailerSend MCP in seconds

Get the MailerSend MCP server URL

Connect your AI tool by adding the URL

Authorize the tool to access your MailerSend account and get started!

## SDKs that drop right into your code

Choose your language, check out our comprehensive documentation, and integrate our robust email API in minutes.

[Read our API docs](https://developers.mailersend.com/)

[cURL](/content/features/mcp/index.html) [Node.js](/content/features/mcp/index.html) [PHP](/content/features/mcp/index.html) [Laravel](/content/features/mcp/index.html) [Python](/content/features/mcp/index.html) [Ruby](/content/features/mcp/index.html) [Go](/content/features/mcp/index.html) [Java](/content/features/mcp/index.html)

```bash
curl -X POST \
https://api.mailersend.com/v1/email \
    -H 'Content-Type: application/json' \
    -H 'X-Requested-With: XMLHttpRequest' \
    -H 'Authorization: Bearer {place your token here without brackets}' \
    -d '{
        "from": {
            "email": "your@email.com"
        },
            "to": [\
        {\
            "email": "your@client.com"\
        }\
        ],
        "subject": "Hello from MailerSend!",
        "text": "Greetings from the team, you got this message through MailerSend.",
        "html": "Greetings from the team, you got this message through MailerSend."
    }'
```

```javascript
import { MailerSend, EmailParams, Sender, Recipient } from "mailersend";

const mailerSend = new MailerSend({
   api_key: "key",
});

const sentFrom = new Sender("you@yourdomain.com", "Your name");

const recipients = [\
  new Recipient("your@client.com", "Your Client")\
];

const emailParams = new EmailParams()
  .setFrom(sentFrom)
  .setTo(recipients)
  .setReplyTo(sentFrom)
  .setSubject("This is a Subject")
  .setHtml("This is the HTML content")
  .setText("This is the text content");

await mailerSend.email.send(emailParams);
```

```php
$mailersend = new MailerSend();

$recipients = [\
new Recipient('your@client.com', 'Your Client'),\
];

$emailParams = (new EmailParams())
->setFrom('your@email.com')
->setFromName('Your Name')
->setRecipients($recipients)
->setSubject('Subject')
->setHtml('Greetings from the team, you got this message through MailerSend.')
->setText('Greetings from the team, you got this message through MailerSend.');

$mailersend->email->send($emailParams);
```

```php
php artisan make:mail ExampleEmail

Mail::to('you@client.com')->send(new ExampleEmail());
```

```python
from mailersend import MailerSendClient, EmailBuilder

ms = MailerSendClient()

email = (EmailBuilder()
         .from_email("sender@domain.com", "Your Name")
         .to_many([{"email": "recipient@domain.com", "name": "Recipient"}])
         .subject("Hello from MailerSend!")
         .html("Hello World!")
         .text("Hello World!")
         .build())

response = ms.emails.send(email)
```

```ruby
require "mailersend-ruby"

# Intialize the email class
ms_email = Mailersend::Email.new

# Add parameters
ms_email.add_recipients("email" => "your@client.com", "name" => "Your Client")
ms_email.add_recipients("email" => "your@client.com", "name" => "Your Client")
ms_email.add_from("email" => "your@domain.com", "name" => "Your Name")
ms_email.add_subject("Hello!")
ms_email.add_text("Greetings from the team, you got this message through MailerSend.")
ms_email.add_html("Greetings from the team, you got this message through MailerSend.")

# Send the email
ms_email.send
```

```go
package main

import (
    "context"
    "os"
    "fmt"
    "time"

"github.com/mailersend/mailersend-go"
)

func main() {
	// Create an instance of the mailersend client
	ms := mailersend.NewMailersend(os.Getenv("MAILERSEND_API_KEY"))

ctx := context.Background()
	ctx, cancel := context.WithTimeout(ctx, 5*time.Second)
	defer cancel()

subject := "Subject"
	text := "This is the text content"
	html := "This is the HTML content"

from := mailersend.From{
		Name:  "Your Name",
		Email: "your@domain.com",
	}

recipients := []mailersend.Recipient{
		{
			Name:  "Your Client",
			Email: "your@client.com",
		},
	}

// Send in 5 minute
	sendAt := time.Now().Add(time.Minute * 5).Unix()

tags := []string{"foo", "bar"}

message := ms.Email.NewMessage()

message.SetFrom(from)
	message.SetRecipients(recipients)
	message.SetSubject(subject)
	message.SetHTML(html)
	message.SetText(text)
	message.SetTags(tags)
	message.SetSendAt(sendAt)
	message.SetInReplyTo("client-id")

res, _ := ms.Email.Send(ctx, message)

fmt.Printf(res.Header.Get("X-Message-Id"))

}
```

```javascript
import com.mailersend.sdk.Email;
import com.mailersend.sdk.MailerSend;
import com.mailersend.sdk.MailerSendResponse;
import com.mailersend.sdk.exceptions.MailerSendException;

public void sendEmail() {

Email email = new Email();

email.setFrom("name", "your email");
    email.addRecipient("name", "your@recipient.com");

// you can also add multiple recipients by calling addRecipient again
    email.addRecipient("name 2", "your@recipient2.com");

// there's also a recipient object you can use
    Recipient recipient = new Recipient("name", "your@recipient3.com");
    email.AddRecipient(recipient);

email.setSubject("Email subject");

email.setPlain("This is the text content");
    email.setHtml("This is the HTML content");

MailerSend ms = new MailerSend();

ms.setToken("Your API token");

try {
        MailerSendResponse response = ms.emails().send(email);
        System.out.println(response.messageId);
    } catch (MailerSendException e) {
        e.printStackTrace();
    }
}
```

## SMTP for legacy systems and preferred frameworks

Fast, secure, reliable [SMTP relay for developers](/content/features/smtp-relay/index.html) who need a solution for legacy systems or prefer to use an existing framework or module.

## Your tools connected with native integrations

Easily connect other web apps with MailerSend so they seamlessly work together to share information, automate workflows and enhance your customer experience.

Firebase](/content/integrations/firebase/index.html) React Email](/content/integrations/react-email-mailersend/index.html) Symfony](/content/integrations/symfony/index.html) Supabase](/content/integrations/supabase/index.html) Make](/content/integrations/mailersend-make-integration/index.html) NocoDB](/content/integrations/nocodb-mailersend-integration/index.html) WordPress](/content/integrations/official-smtp-plugin/index.html) [All integrations](/content/integrations/index.html)

## What MailerSenders have to say

[High Performer\\
Small Business\\
\\
Spring 2025](https://www.g2.com/products/mailersend/reviews) [High\\
\\
Performer\\
Spring 2025](https://www.g2.com/products/mailersend/reviews) [High Performer\\
Europe\\
\\
Winter 2025](https://www.g2.com/products/mailersend/reviews)

MailerSend is extremely easy to use and super fast to set up. I was able to send the first email via the API in minutes. With the predefined templates and drag and drop editor, you're able to get started really quickly.

Tobias R.[IT company owner](https://www.capterra.com/p/214665/MailerSend/reviews/3343238/)

Super easy-to-use API for devs and user-friendly mail templating for designers. I love the fact that we can define data from the dashboard and simply call it with the API from the backend to easily send emails. Devs don't need to do design work and designers don't need to code. It's awesome!

Raphael A.[CTO](https://www.g2.com/products/mailersend/reviews/mailersend-review-4626260)

Very good tool, it took me just one day to get it working on production. The interface is clean with everything exactly where expected. It works fantastically—emails are delivered immediately and as configured (conditional statements saved my life, no need to create lots of templates). The API documentation is also fantastic, plus the support team is really fast! 10 out of 10.

Roger S.[-](https://www.trustpilot.com/reviews/676803b747bde93ffc19e5ac)

## Try it now for free

Sign up now to try out the MCP and start sending in seconds. Subscribe to a Free plan and get 500 emails/month.

[Try for free](/content/signup/index.html)

## Explore all features

All the latest features designed to help you collaborate on transactional emails and work smarter.

\\
Analytics\\
\\
\\
\\
Access a wide range of key metrics in MailerSend’s email analytics dashboard to track deliverability and engagement and improve overall email performance.](/content/features/email-analytics/index.html)

\\
Dynamic templates\\
\\
\\
\\
Populate email templates with real-time data to create personalized content for each user.](/content/features/dynamic-email-templates/index.html)  \\
User management\\
\\
\\
\\
Invite team members and manage user permissions for easy collaboration.](/content/features/user-management/index.html)

\\
Drag & drop builder\\
\\
\\
\\
Build professional transactional emails with our drag & drop editor—no coding needed.](/content/features/email-template-builder/index.html)  \\
Email verification\\
\\
\\
\\
Identify and remove invalid email addresses to lower your bounce rate and land in more inboxes.](/content/features/email-verification-tool/index.html)  \\
Inbound routing\\
\\
\\
\\
Automate inbound mail by forwarding incoming messages directly to your app or CRM to streamline workflows and improve customer support.](/content/features/inbound-emails/index.html) [And much more to deliver, every single time\\
\\

## FAQs

[**What is the MailerSend MCP?**](/content/features/mcp/index.html)

MCP stands for Model Context Protocols. It provides a standard set of rules so that AI tools can connect and communicate with other services, like MailerSend, and enhance functionality.

MailerSend’s MCP takes away the need for custom integration in order to connect your account to a compatible AI tool, allowing you to do so with just a few clicks. It then gives the AI tool access to your MailerSend account for real-time access to your data and settings so that you can perform tasks and fetch data based on the most accurate and up-to-date information. Learn [how to connect the MailerSend MCP](/content/help/how-to-connect-mailersends-mcp/index.html).

[**What is the difference between the MCP, API, and SMTP?**](/content/features/mcp/index.html)

The API and SMTP are two ways to send emails programmatically: [SMTP](/content/features/smtp-relay/index.html) is the traditional protocol for email sending that uses SMTP credentials, and the email API is a developer-friendly alternative that provides more advanced features and flexibility. The MCP server simply connects your MailerSend account to an AI tool so that it can fetch data and perform actions, without writing the API calls yourself.

[**How does the MCP handle domain authentication?**](/content/features/mcp/index.html)

The MCP has access to tools that allow you to add and verify domains, manage their settings, fetch their data and more. Combined with MailerSend automatic domain authentication feature, this means you can ask the AI tool to do these for you, without the need for manual intervention.

[**What AI clients are currently supported?**](/content/features/mcp/index.html)

Currently, Claude, Cursor, VSCode, Gemini CLI, and ChatGPT support MCPs. We expect more tools to add MCP support soon.

[**How does the MCP ensure my data is secure?**](/content/features/mcp/index.html)

MailerSend does not send any of your data to an AI tool. When you connect your AI tool/LLM/IDE to the MailerSend MCP server, you grant the tool permission to access and manage your data. This is done only when you instruct the AI tool to do so, meaning that you are in full control. The connection simply allows your chosen AI tool to communicate with your MailerSend account when you give it a command.

[**How do I troubleshoot issues when using the MCP?**](/content/features/mcp/index.html)

When you connect your account, the AI tool has access to a wide range of data that can help you troubleshoot issues. Simply use natural language prompts to fetch this data, ask the tool to analyze and give feedback, and optimize your sendings. Check out our docs to see more [troubleshooting examples and use cases using the MCP](https://developers.mailersend.com/mcp-server-examples.html#troubleshooting-email-delivery).

[**Can I use the MCP to generate code for my projects?**](/content/features/mcp/index.html)

Yes, the MCP has access to the MailerSend API so you can generate accurate code with it.
