# Mailjet MCP

> Mailjet MCP Server connects your AI client directly to the Mailjet API. Send transactional emails and run full email marketing campaigns without leaving chat. You can instantly build contact records, add users to specific lists, manage entire subscriber databases, or pull performance metrics for any campaign you ran.

## Overview
- **Category:** developer-tools
- **Price:** Free
- **Tags:** transactional-email, marketing-campaigns, email-tracking, subscriber-lists, api-delivery

## Description

Look, this Mailjet MCP Server hooks your AI client straight into the Mailjet API. You don't gotta write complex API calls or touch a dashboard; you just talk to your agent in chat, and it handles all the heavy lifting for running full email campaigns and managing every contact record.

**Sending Emails:** Your agent can send fully structured emails using the `send_transactional_email` tool. This supports sending single messages or batch sends, letting you include complex HTML bodies and attachments. It’s perfect for stuff like password resets, receipts, or boarding passes where the content needs to look professional.

**Managing Contacts:** You can build out your address book with two main actions. First, use `create_new_contact` to make a brand new user record in your database; you just need an email address to get started. Second, if you need to check who you got, the `list_all_contacts` tool pulls every single contact stored in your Mailjet account for review.

**Segmenting Audiences:** Controlling who gets what is key. The server lets your agent list all available segments using `list_subscriber_lists`. Once you know which lists exist, you can use the `add_contact_to_list` tool to move an existing contact into a specific segment using their required IDs.

**Campaign Oversight:** You keep track of everything with the campaign tools. The agent uses `list_marketing_campaigns` to give you a master list of every marketing push that's gone out. Need details on one specific run? You can fetch all the configuration and metadata for any selected marketing effort using `get_campaign_details`. For performance, use `get_campaign_performance` to pull concrete metrics—opens, clicks, and bounces—for a given campaign ID.

This whole setup means your agent handles sending transactional emails with `send_transactional_email`, creating new records via `create_new_contact`, listing every existing contact through `list_all_contacts`, managing segmentation by first calling `list_subscriber_lists` then using `add_contact_to_list`, and finally, running a full audit of campaigns by using `list_marketing_campaigns`, checking the specific details with `get_campaign_details`, or seeing the cold hard numbers on opens and bounces with `get_campaign_performance`. You're set.

## Tools

### add_contact_to_list
Adds an existing contact to a specific subscriber list using the required list and contact IDs.

### create_new_contact
Creates a brand new contact record in your Mailjet database, requiring at minimum an email address.

### get_campaign_details
Retrieves specific configuration and metadata for one selected marketing campaign.

### get_campaign_performance
Fetches performance metrics (opens, clicks, bounces) for a given campaign ID.

### list_all_contacts
Retrieves and displays every contact record currently stored in your Mailjet account.

### list_marketing_campaigns
Provides a list of all marketing campaigns that have been created within the account.

### list_subscriber_lists
Lists every available contact segment or mailing list defined in your Mailjet setup.

### send_transactional_email
Sends a fully structured email using the Mailjet Send API, accepting a detailed JSON body for content and recipients.

## Prompt Examples

**Prompt:** 
```
Send a transactional email to 'passenger@example.com' with subject 'Boarding Pass'.
```

**Response:** 
```
I've sent the email. The message has been queued by Mailjet. You can track the delivery status using the campaign tools.
```

**Prompt:** 
```
List all active contact lists in my Mailjet account.
```

**Response:** 
```
I've retrieved your contact lists. You have 3 active lists: 'Newsletter Subscribers', 'Product Updates', and 'Transactional Users'.
```

**Prompt:** 
```
Show performance stats for campaign ID '12345'.
```

**Response:** 
```
I've fetched the statistics. For campaign 12345, you have an open rate of 22.5% and a click rate of 3.2% across 5,000 recipients.
```

## Capabilities

### Send transactional emails
The AI client sends single or batch emails using the Mailjet Send API, supporting complex HTML and attachments.

### Create and read contacts
You can add new contact records to your database or list every existing contact in the account.

### Manage subscriber segmentation
The agent adds, removes, or verifies contacts against specific predefined lists (segments).

### List and audit campaigns
You can list all past marketing campaigns and retrieve detailed performance reports for any of them.

## Use Cases

### The Welcome Sequence Trigger
A user signs up via a landing page. Instead of manually exporting their email and adding them to the 'New Leads' list, the agent first runs `create_new_contact` with their data. Then, it immediately calls `add_contact_to_list` to place them in the correct segment, ensuring they get the welcome email sequence.

### Post-Sale Follow-Up
A customer makes a purchase and needs a receipt. Instead of logging into Mailjet's sending interface, you tell your agent to 'Send a receipt for order #XYZ'. The agent uses `send_transactional_email` and handles the entire JSON payload, delivering the email instantly.

### Campaign Review
The CMO asks about last quarter's results. Instead of navigating complex reports, the agent runs `get_campaign_performance` for Campaign ID 'Q3-2024'. You get a summary showing open rates and click metrics right in your chat.

### Data Cleanup
You need to check if any old, dormant contacts are still on the main list. The agent runs `list_all_contacts` first, then allows you to filter or audit their status before deciding who needs to be removed.

## Benefits

- **Instant Performance Checks:** Need to know if a last week's campaign was successful? Use `get_campaign_performance` to pull open rates and click counts immediately. You skip the dashboard navigation and get straight to the numbers.
- **Automated Contact Flow:** Don't manually update lists. When a new user signs up, your agent runs `create_new_contact`, followed by `add_contact_to_list`. The contact is instantly in place and segmented.
- **Single-Shot Email Delivery:** For things like receipts or password resets, use `send_transactional_email`. It handles the full API payload (HTML, attachments) so you don't have to worry about code structure.
- **Full Audience Visibility:** Want to know who exists in your system? Run `list_all_contacts` and get a complete dump. Need to see which lists exist? `list_subscriber_lists` shows it all.
- **Audit Trail Access:** Before launching a big campaign, use `list_marketing_campaigns`. This lets you check historical campaigns and get details using `get_campaign_details`, giving you confidence in your setup.

## How It Works

The bottom line is that your agent handles authentication and execution using the native Mailjet APIs behind the scenes. No code needed on your end.

1. Subscribe to the server, then provide your Mailjet API Public Key and Secret Key.
2. Direct your AI agent to perform a task (e.g., 'Send an email for order #456').
3. The client calls the necessary tool (`send_transactional_email`), executes the action via the Mailjet API, and reports the outcome back to you.

## Frequently Asked Questions

**How do I use the send_transactional_email tool?**
You ask your agent to send an email, specifying the recipient(s) and content details in plain language. The agent then formats this into a JSON body that matches the Mailjet v3.1 Send API structure for you.

**Can I use list_all_contacts to find emails?**
Yes, `list_all_contacts` retrieves every contact record available in your account. You can then ask the agent to filter that data by criteria like last login date or specific attributes.

**How do I check campaign performance using get_campaign_performance?**
You tell the agent which campaign ID you want stats for. The tool calls the API and returns key metrics—open rate, click rate, etc.—without you having to navigate to a separate report page.

**What's the difference between list_all_contacts and list_subscriber_lists?**
The first (`list_all_contacts`) shows people (the records). The second (`list_subscriber_lists`) shows buckets or segments—it tells you what groups exist for those people.

**How do I authenticate my account when setting up the Mailjet MCP Server?**
You must enter your API Public Key and Secret Key. These credentials authorize your agent to send emails and manage data on your behalf.

**What information does the create_new_contact tool require?**
It requires at least an email address. You can use this tool to add a new contact record directly into the Mailjet database.

**How do I find all available list IDs before using add_contact_to_list?**
First, run list_subscriber_lists. This command retrieves every existing contact list ID in your account, ensuring you target the correct segment.

**What is the difference between get_campaign_performance and get_campaign_details?**
Performance gives you metrics like open/click rates. Details provide configuration data and status information for a specific campaign.

**Which version of the Mailjet API does this server use?**
This server uses Mailjet REST API v3 for resource management (contacts, lists, campaigns) and the modern v3.1 Send API for reliable email delivery.

**Can I send bulk emails using the agent?**
Yes, the `send_transactional_email` tool supports the full v3.1 structure, allowing you to include multiple message objects in a single call.

**How do I find my API Key and Secret?**
Log in to your Mailjet account and navigate to Account Settings > API Key Management to find or generate your credentials.