# Maileon MCP

> Maileon connects your AI client directly to your email marketing system. It lets you manage contacts, run campaigns, and analyze performance without opening a web portal. Your agent can list subscribers with `list_account_contacts`, trigger dispatches via `dispatch_email_mailing`, or pull detailed open/click statistics using `get_mailing_statistics`.

## Overview
- **Category:** marketing-automation
- **Price:** Free
- **Tags:** newsletter-dispatch, subscriber-profiles, campaign-reporting, contact-management, email-performance

## Description

Maileon connects your AI client straight into your email marketing system. You manage contacts, run campaigns, and check performance data without ever having to open a web portal or mess with complicated dashboards. Your agent handles the whole workflow—it's direct.

**Managing Contacts and Lists**

You can pull up every subscriber in your Maileon account using **`list_account_contacts`**, and you can narrow that list down by adding specific filters for status or metadata. If you need all the details on just one person, **`get_contact_by_email`** pulls up a complete profile based solely on their email address. When someone signs up, your agent uses **`create_new_contact`** to add or update that user record; this function even handles triggering the double opt-in process if Maileon requires it.

To keep things clean, you can permanently remove a specific person from your database using **`delete_account_contact`**. You'll also see a log of who quit subscribing by running **`list_unsubscription_events`**, keeping track of every contact that opted out. For general list health checks and understanding what mailings exist, **`list_email_mailings`** shows you all your campaigns, letting you filter them by status—whether they're still in draft mode or fully published.

**Running Campaigns and Sending Emails**

When it's time to hit send, you first check the general setup details of a campaign using **`get_mailing_details`**. Once you know the specifics, your agent triggers the actual dispatch with **`dispatch_email_mailing`**, but remember: this only sends the mail if the mailing has been marked as 'ready' inside Maileon. The whole process is controlled; you don't just hit a button and hope for the best.

**Analyzing Performance Metrics**

Figuring out if a campaign worked takes muscle, but your agent handles the numbers. **`get_mailing_statistics`** pulls detailed performance data—you get open rates, click counts, and bounce totals—all linked to a specific mailing ID. If you need to check the status or details of any given mailing setup, **`get_mailing_details`** gives you that metadata upfront.

## Tools

### list_account_contacts
Lists all contacts in your Maileon account; you can add filters to narrow the results.

### create_new_contact
Adds or updates a user record in Maileon, optionally triggering the double opt-in process.

### delete_account_contact
Permanently removes a specified contact from your account's database.

### dispatch_email_mailing
Sends an email campaign, but only if the mailing has been set to a 'ready' status in Maileon.

### get_contact_by_email
Pulls all stored details for one specific contact based on their email address.

### get_mailing_details
Retrieves general metadata about a particular campaign or mailing setup.

### get_mailing_statistics
Returns performance data (opens, clicks, bounces) for a specific mailings ID.

### list_email_mailings
Shows a list of all campaigns, letting you filter by status (e.g., draft or published).

### list_unsubscription_events
Retrieves a log of the most recent contacts that opted out of your mailing lists.

## Prompt Examples

**Prompt:** 
```
List all active mailings in my Maileon account.
```

**Response:** 
```
I've retrieved your mailings. You have 5 campaigns, including 'Summer Newsletter (ID: 12345)', 'Product Launch', and 'Welcome Sequence'. Which one would you like to see statistics for?
```

**Prompt:** 
```
Get the latest statistics for mailing ID '12345'.
```

**Response:** 
```
I've fetched the statistics for mailing 12345. Currently, it has a 25.4% open rate and a 3.2% click-through rate across 10,000 recipients.
```

**Prompt:** 
```
Add 'new-user@example.com' to my Maileon contacts.
```

**Response:** 
```
Successfully created the contact record for new-user@example.com. The new subscriber is now registered in your database.
```

## Capabilities

### List and filter subscriber records
Retrieves comprehensive lists of contacts, allowing filtering by status or metadata.

### Execute email campaigns
Triggers the sending process for a pre-built mailing list, provided the campaign is marked as ready.

### Analyze performance metrics
Pulls detailed statistics for any given mailing, including open rates, click counts, and bounce totals.

### Maintain contact list hygiene
Allows the removal of specific contacts or tracking recent opt-out activity to keep your data accurate.

### Manage new subscriber records
Creates or updates user profiles, triggering double opt-in processes if configured in Maileon.

## Use Cases

### Need a quick report on last week's campaign performance.
A marketer needs to know if the 'Q3 Product Update' mailing was successful. They ask their agent to run `get_mailing_statistics` for that specific ID. The agent returns an immediate breakdown: 28% open rate and a 4.1% click-through, letting them report numbers instantly without navigating complex reporting sections.

### Onboarding a new client requires updating their record.
A sales rep closes a deal with 'newuser@example.com'. Instead of logging into Maileon and manually inputting the data, they tell their agent to run `create_new_contact`. The agent handles the creation—and potentially kicks off the double opt-in process automatically.

### Sending a critical, time-sensitive announcement.
The team needs to send an alert immediately. They use `list_email_mailings` first to verify the campaign is finished and marked 'Ready'. Once confirmed, they trigger the dispatch using `dispatch_email_mailing`. The agent handles the state check before sending.

### Cleaning up outdated or inactive user data.
The Ops team runs a list of all contacts with `list_account_contacts` and filters for users who haven't engaged in 12 months. They then use the agent to run `delete_account_contact` on those identified stale accounts, keeping the mailing list healthy.

## Benefits

- Get instant campaign status. Instead of logging into the Maileon dashboard to see if a mailing is 'Ready' or 'Draft', just ask your agent. You can use `list_email_mailings` to check all campaigns in seconds.
- Track performance without exporting data. When you need to know the open rate for Campaign X, run `get_mailing_statistics`. You get the percentage and total counts immediately, no CSV export needed.
- Maintain clean lists effortlessly. Use `list_unsubscription_events` to see exactly who opted out recently. This helps your team decide if a contact needs permanent removal using `delete_account_contact`.
- Automate data entry. When you sign up a new client, don't open the web form. Just ask your agent to run `create_new_contact`, and it handles adding or updating the record correctly.
- Streamline outreach preparation. Need a list of all active users? Use `list_account_contacts`. You can then filter that output within your chat to pull only those who haven't opened an email in 90 days.

## How It Works

The bottom line is you manage entire email workflows without ever leaving your chat window or IDE.

1. Subscribe to the server and enter your unique Maileon REST API Key.
2. Your AI client connects using the key, giving it direct access to your mailing data.
3. You issue a natural language command (e.g., 'What were the stats for Campaign 456?') and get an immediate, structured response.

## Frequently Asked Questions

**How do I check campaign status with list_email_mailings?**
You run `list_email_mailings`. This tool returns a list of all campaigns, and critically, it lets you filter the results by state (like 'draft' or 'ready'). You can see exactly which ones are live and which need work.

**What is the difference between listing contacts and getting one with get_contact_by_email?**
Use `list_account_contacts` when you need a broad overview or a filtered list of many people. Use `get_contact_by_email` when you know the email address and only want to pull all specific details for that single user.

**Can I send an email campaign if it's still in draft mode? (dispatch_email_mailing)**
No. The `dispatch_email_mailing` tool checks the mailing status first. It requires the campaign to be explicitly marked as 'ready' before it will attempt to send anything.

**How do I clean up my contact list using Maileon MCP Server?**
You combine tools. First, use `list_unsubscription_events` to see who left recently. Then, you can run `delete_account_contact` for those specific users if you want them permanently removed.

**If I run get_contact_by_email with an invalid email address, what should I expect?**
The API returns a specific error code indicating that no contact was found. This lets your agent handle the missing data gracefully rather than failing the entire process.

**When using create_new_contact, how do I ensure I only update existing profile details instead of adding a duplicate?**
You must pass the contact's unique identifier or email address in the payload. The tool checks for existence first; if it finds a match, it updates the record rather than creating a new one.

**Can I filter the results of list_account_contacts by specific fields like 'status' or 'last login date'?**
Yes, you can use optional parameters when calling list_account_contacts. This allows your agent to narrow down the search results immediately, saving processing time and keeping data relevant.

**What is the primary purpose of using list_unsubscription_events compared to just listing all contacts?**
This tool captures a chronological record of people opting out. It shows *when* someone unsubscribed, which helps track compliance and audit your mailing hygiene efforts.

**How do I find my Maileon API Key?**
Log in to your Maileon account and navigate to Settings > API to generate and copy your unique REST API Key.

**What is the difference between a Mailing and a Campaign?**
In Maileon terminology, a 'Mailing' refers to a specific email send-out, which is the standard entity managed via the campaigns tools in this server.

**Can I filter contacts by specific attributes?**
Yes, you can provide filtering strings in the `params` field of the `list_account_contacts` tool following the Maileon query syntax.