# Mailify MCP

> Mailify (Sarbacane) MCP Server manages professional email and SMS marketing campaigns right from your AI client. It lets your agent list all address books, pull performance stats for specific campaigns, and update contact details without you opening a browser. Use natural language to manage campaign oversight and subscriber data directly.

## Overview
- **Category:** marketing-automation
- **Price:** Free
- **Tags:** multi-channel-marketing, campaign-oversight, address-books, subscriber-data, sms-marketing

## Description

You manage your whole marketing stack from your AI client. The Mailify server lets your agent handle everything related to contact lists, campaigns, and performance metrics. You don't have to jump between tabs or manually copy data into spreadsheets; you just tell the AI what needs doing, and it runs the necessary API calls for you.

### Managing Contacts and Address Books
Your agent gives you total control over your subscriber base. Start by asking the system to list all available contact groups through `list_address_books` so you know exactly which address books you're working with. You can then retrieve deep details and metadata for any single group using `get_address_book_details`. Once you pick a book, it fetches every single contact inside that group via `list_book_contacts`. If you need to make changes, the system lets you modify existing records; you tell your agent which contact needs updating, and it uses `update_book_contact` to change details like emails or phone numbers. Need to clean up a list? It handles removing specified contacts from an address book with `delete_book_contact`. If you're bringing in new leads, simply ask the agent to use `add_contact_to_book` to add them directly to your existing contact group.

### Campaign Oversight and Setup Details
When it comes to campaigns, your agent gives you a clear view of everything. You can list every single email marketing campaign that’s been set up or run through Mailify by calling `list_email_campaigns`. If you need to check the initial setup or detailed metadata for a specific push, it uses `get_campaign_details` to pull all that info on one ID. This lets you confirm configuration settings before launching anything.

### Performance Tracking and Auditing
Checking how well your outreach performed is simple. You ask the agent for campaign stats using `get_campaign_performance`. It returns real-time metrics—opens, clicks, and bounce counts—for any running or completed campaign ID. This gives you immediate visibility into conversion rates and engagement levels without needing to open a dashboard. The system handles all of this by translating your natural language commands into direct actions on Mailify’s API.

## Tools

### add_contact_to_book
Adds a new contact record to an existing address book using provided list and contact details.

### get_campaign_performance
Retrieves real-time performance metrics (opens, clicks, bounces) associated with a running or completed campaign.

### list_email_campaigns
Lists all the email marketing campaigns that have been set up or run through Mailify.

### delete_book_contact
Removes a specified contact from the address book it belongs to.

### get_campaign_details
Fetches the configuration settings and detailed metadata for a single marketing campaign ID.

### get_address_book_details
Retrieves full details and metadata for one specific, identified contact list.

### list_book_contacts
Retrieves a list of every single contact currently stored within a specified address book.

### list_address_books
Lists all the unique contact groups and address books available in your account.

### update_book_contact
Modifies existing details (like email or phone) for a contact within an address book.

## Prompt Examples

**Prompt:** 
```
List all my current campaigns in Mailify.
```

**Response:** 
```
I've retrieved your campaigns. You have 5 active campaigns, including 'Product Launch Q3 (ID: cp123)', 'Monthly SMS Alert', and 'Newsletter Weekly'. Would you like to see performance stats for any of them?
```

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

**Response:** 
```
I've fetched the stats for campaign cp123. It currently has 1,250 opens (22.5%) and 145 clicks (2.6%). There were 5 bounce events recorded.
```

**Prompt:** 
```
Add 'new-lead@example.com' to address book ID 'bk987'.
```

**Response:** 
```
Successfully added new-lead@example.com to address book bk987. The contact ID is 'ct-abc-123' and they are now ready to receive your campaigns.
```

## Capabilities

### Audit Campaign Performance
You ask the agent for stats on a specific campaign ID, and it returns real-time metrics like opens, clicks, and bounce counts.

### Manage Contact Lists (Address Books)
The agent lets you list all existing contact groups and retrieve detailed information about any single group or its members.

### Modify Subscriber Data
You tell the AI to update, add, or delete a specific contact record within an address book. It handles the API call for you.

### List All Campaigns and Contacts
The agent can list every email campaign or every available address book in your system.

## Use Cases

### Need to audit campaign success rates?
You suspect Campaign X underperformed last month. Instead of downloading raw data and manually calculating metrics, you tell your agent: 'Get performance stats for campaign ID cp123.' The agent runs `get_campaign_performance` and returns the opens, clicks, and bounce rate in seconds.

### Onboarding a large batch of new leads.
A sales team just gathered 50 new contacts. Instead of creating them one by one, you use the agent to run `add_contact_to_book` for all 50 records into the 'Active Leads' book, logging each successful addition.

### Checking a contact's current status.
You need to confirm if John Doe is still in the correct mailing list. You first run `list_address_books` to find the right group ID, then use `get_address_book_details` and `list_book_contacts` to verify his membership.

### Fixing outdated subscriber info.
You know a key contact's phone number changed. You ask the agent to 'Update the phone for Jane Smith in the main book.' The agent runs `update_book_contact`, ensuring the change is logged and applied immediately.

## Benefits

- Audit campaign performance instantly. Instead of navigating to separate analytics dashboards, ask the agent for `get_campaign_performance` and get metrics like opens and clicks right away.
- Keep your contact data clean without context switching. Use `add_contact_to_book`, `update_book_contact`, or `delete_book_contact` to manage records directly from your chat interface.
- Understand campaign setup details fast. `get_campaign_details` pulls all the configuration metadata for any given campaign ID, letting you audit its history instantly.
- See every list and campaign at a glance. Start with `list_address_books` or `list_email_campaigns` to quickly map out what marketing assets you have access to right now.
- Maintain data integrity across your audience. You can use `get_address_book_details` to verify the structure of a list before making mass changes.

## How It Works

The bottom line is: your AI client becomes the single interface for all your marketing operations, eliminating manual API interactions.

1. First, subscribe to the server and plug in your Mailify (Sarbacane) API Key.
2. Next, you tell your AI client what marketing task needs doing. For example: 'Show me campaign performance for ID X' or 'Add new contact Y to book Z.'
3. The agent translates that request into the necessary tool calls, executes them against Mailify, and gives you a plain-English summary of the results.

## Frequently Asked Questions

**How do I list all my campaigns using list_email_campaigns?**
You simply ask your agent to 'List all email campaigns.' The tool runs `list_email_campaigns` and gives you a full rundown of every campaign title and ID available in your account.

**What is the difference between list_address_books and get_address_book_details?**
`list_address_books` just shows you *what* address books exist (the titles). You must then use `get_address_book_details` to pull the actual contents, metadata, or full details of a specific book ID.

**Can I update contacts in bulk?**
You can't run a single 'bulk update' tool. However, you should use `list_book_contacts` to retrieve the contact IDs first, and then tell your agent to loop through that list using `update_book_contact` for each record.

**Does get_campaign_performance provide historical data?**
It provides real-time metrics. If you need older data, check the campaign's metadata first using `get_campaign_details` to see if the history is available or if you need to use a different reporting tool.

**What credentials are needed to run the 'add_contact_to_book' tool?**
You must provide a valid API Key and two specific identifiers: the Address Book ID and the contact data itself. The key authenticates your request, while the IDs tell your agent exactly which list to update.

**Does 'get_campaign_details' require a Campaign ID?**
Yes, the tool requires a specific Campaign ID. This ensures that when you ask for metadata, your agent fetches details only for one campaign, keeping the output focused and accurate.

**When using 'delete_book_contact', what information prevents deleting the wrong contact?**
You must supply both the Address Book ID and the unique Contact ID. Providing both pieces of data guarantees that your agent targets only the intended record, maintaining list integrity.

**Can I filter results when calling 'list_book_contacts'?**
Yes, you can pass specific filters to limit the returned contacts. Instead of getting every member in an address book, your agent narrows down the list based on criteria like status or segment.

**How do I find my Mailify API Key?**
Log in to your Mailify (Sarbacane) account, navigate to Extensions > API to generate and copy your unique API Key.

**Can I retrieve stats for an SMS campaign?**
Yes, the `get_campaign_performance` tool works for both email and SMS campaigns to retrieve relevant engagement metrics.

**What format is required for adding a contact?**
Use the `contact_json` parameter to provide a JSON object with at least the 'email' field. You can also include custom attribute fields defined in your list.