# Mautic MCP

> Mautic MCP Server connects your Mautic marketing automation instance to any AI client. It gives your agent full control over complex workflows—from managing contacts and segmenting audiences to listing campaigns and retrieving detailed company records. You can create new leads, track campaign performance, or update contact profiles entirely through natural conversation with zero manual clicking.

## Overview
- **Category:** business-intelligence
- **Price:** Free
- **Tags:** marketing-automation, email-marketing, lead-management, audience-segmentation, campaign-tracking, contact-management

## Description

Listen, forget those clunky dashboards where you gotta click a dozen buttons just to run a simple campaign. This Mautic MCP Server hooks your Mautic marketing automation straight up to your AI client, giving it full control over the whole damn workflow. Your agent doesn't just read data; it acts on it.

**Managing Contacts and Leads**
When you need to find someone, your agent gets the job done fast. If you know a person’s unique ID, it pulls their entire profile using `get_contact`. You can also search for multiple leads across Mautic by running `list_contacts`, letting you narrow down results with any query you throw at it. Need to start fresh? Your agent generates and saves brand new contact records straight into the system via `create_contact`. Once a lead exists, you'll use `list_segments` to see every audience group available—it lists all defined segments. Then, if you want to target specific people for a campaign, it adds those contacts to existing groups using `add_contact_to_segment`.

**Tracking Companies and Campaigns**
Managing accounts is just as simple. If you need an overview of every company account managed in Mautic, your agent runs `list_companies`. Better yet, if you know a specific company's ID, it fetches the full record and all associated data using `get_company`. For campaigns, you can get a rundown of every active campaign configured by calling `list_campaigns`. If you need deep specs on just one campaign—say, its metrics or setup details—you use `get_campaign` and provide its unique ID.

**Handling Email Templates**
It's not enough to run a campaign; you gotta make sure the email looks right. To see every email template available for marketing outreach, your agent runs `list_emails`. If you need the full structure and content of one specific template, it grabs those details using `get_email` by its ID.

**Putting It All Together**
It’s all about flow. You can list out every piece of data—all campaigns (`list_campaigns`), all segments (`list_segments`), or even just a quick look at available email templates (`list_emails`). The server gives your agent the specific tools it needs to build complex marketing operations through simple conversation with zero manual clicking. It’s like having a dedicated, hyper-efficient ops specialist right in your chat window.

## Tools

### add_contact_to_segment
Adds an existing contact record to a specified audience segment in Mautic.

### create_contact
Generates and saves a brand new contact profile within the Mautic system.

### get_campaign
Retrieves all details for one specific marketing campaign, given its unique ID number.

### get_company
Fetches the full record and associated data for a company account by providing its ID.

### get_contact
Retrieves the complete profile of a single contact using their unique identifier.

### get_email
Gets the full structure and content details for an email template by its ID.

### list_campaigns
Returns a list of all active marketing campaigns configured in your Mautic instance.

### list_companies
Provides an overview and listing of all company accounts managed by the system.

### list_contacts
Lists or searches contacts across Mautic, allowing you to narrow results using a specific search query.

### list_emails
Provides a list of all available email templates that can be used for marketing campaigns.

### list_segments
Lists every defined audience segment, allowing you to see which groups exist for targeted outreach.

## Prompt Examples

**Prompt:** 
```
Find contact info for john.doe@example.com in Mautic.
```

**Response:** 
```
Searching Mautic... I found John Doe (ID: 1234). He is currently in the 'Active Leads' segment.
```

**Prompt:** 
```
List all active marketing campaigns.
```

**Response:** 
```
Retrieving campaigns... You have 3 active campaigns: 'Summer Promo', 'Onboarding', and 'Re-engagement'.
```

**Prompt:** 
```
Add contact ID 1234 to segment ID 5.
```

**Response:** 
```
Action complete. Contact 1234 has been successfully added to segment 5 ('High Value Customers').
```

## Capabilities

### Create New Leads
Your agent generates new contact records in Mautic using the `create_contact` tool.

### Find Specific Contacts
The agent retrieves a complete profile for one person by ID, or finds multiple leads with an optional search query (`get_contact`, `list_contacts`).

### Update Audience Segments
You can add specific contacts to existing segments using the `add_contact_to_segment` tool for targeted marketing.

### List and Inspect Campaigns
The agent fetches lists of all campaigns (`list_campaigns`) or retrieves deep details on a single campaign by ID (`get_campaign`).

### Manage Company Records
You can list all associated company accounts (`list_companies`) and pull detailed data for one specific account (`get_company`).

## Use Cases

### The Quarterly Data Cleanup
A marketing manager needs to ensure all 'High Value' prospects are in the correct list. They tell their agent, 'Find all contacts who haven't logged in this quarter and add them to the Retention Segment.' The agent runs `list_contacts` with date filters, then executes multiple calls to `add_contact_to_segment`. Done.

### Onboarding a New Client
A sales team member finds a new company. Instead of going through the manual intake form, they tell their agent: 'Create contact for Acme Corp (ID 901) and link them to our Premium account.' The agent handles `get_company` details for verification, followed by `create_contact`. This saves five minutes of clicks.

### Troubleshooting a Campaign Flop
A team member suspects a campaign failed because the email template was wrong. They ask their agent to 'Show me details on the Summer Promo campaign and verify its associated email template.' The agent calls `get_campaign` then uses `get_email`, giving the full context immediately.

### Identifying New Target Audiences
A content specialist wants to write a specialized newsletter. They ask, 'List all segments that contain more than 50 contacts and list their names.' The agent runs `list_segments`, providing the full scope of available targeting lists for inspiration.

## Benefits

- Stop juggling tabs. Instead of opening the Contacts view to find a lead's ID and then switching to the Segments tab to add them, your agent handles it in one prompt using `add_contact_to_segment` and `list_segments`. The whole process is conversationally direct.
- Need an audit? You can list all campaigns (`list_campaigns`) and instantly get details on a specific company's association with that campaign by calling `get_company` and cross-referencing the data. It’s instant visibility into your funnel structure.
- Building new lists is fast. Instead of manually running search queries and exporting CSVs, you can ask your agent to run `list_contacts` with specific criteria, getting the list right back without leaving the chat window.
- Streamline lead intake. When a sales rep finds a great prospect, they just tell the agent their details; it runs `create_contact`, then uses `add_contact_to_segment` to get them into the nurture sequence immediately. Zero friction.
- Reviewing marketing assets is simple. Want to know what templates you have? Run `list_emails`. Need to check if a specific email template works with a certain campaign? Use `get_email` alongside `get_campaign` for context.

## How It Works

The bottom line is: Your AI client acts as a secure, conversational layer between your natural language requests and Mautic's underlying APIs.

1. First, you subscribe to the Mautic server on Vinkius and provide your Mautic Base URL, username, and API secret.
2. Then, you tell your AI client what you need (e.g., 'Find all contacts in Segment X who haven't opened an email').
3. The agent uses the available tools—like `list_contacts` or `get_contact`—to execute the necessary API calls and returns the structured data to you.

## Frequently Asked Questions

**How do I find all existing segments using list_segments?**
You simply ask your agent to run `list_segments`. It returns a comprehensive list of every segment defined in your Mautic instance, letting you see exactly where leads are grouped.

**Can I create contacts with the create_contact tool?**
Yes. You tell your agent the required fields (name, email, company ID), and it executes `create_contact`, instantly adding the new lead record to Mautic.

**What is the difference between list_contacts and get_contact?**
`list_contacts` shows you a broad overview or lets you search for multiple contacts. `get_contact` requires one specific ID and returns only that single, detailed profile.

**How do I check if a contact is in the right segment?**
You can use `get_contact` to retrieve the full profile, which will show all associated segments. If you need to move them, use `add_contact_to_segment`.

**Do I need list_companies before using get_company?**
No. `get_company` only needs the company ID number to function. However, if you don't know the ID, run `list_companies` first to find it.

**What credentials do I need to use the `get_contact` tool?**
You'll need a valid Mautic API key or secret credential pair. The agent uses these stored keys to authenticate every request, so ensure your connection parameters are current before running any contact queries.

**If I run `list_contacts` with millions of records, will there be rate limits?**
Yes, high-volume requests can hit API caps. To process huge lists, you'll need to structure your calls in smaller batches and implement backoff logic when calling list functions.

**How do I ensure the data from `get_company` is ready for `add_contact_to_segment`?**
You must pass both IDs: the company ID retrieved by `get_company`, and the contact ID. The agent combines these inputs to execute the segment addition successfully.

**How do I enable the Mautic API?**
Go to Mautic Settings > Configuration > API Settings and set 'API Enabled?' to 'Yes'. Also enable 'HTTP Basic Auth' for this integration.

**Can I search for contacts by email?**
Yes! Use the `list_contacts` tool and provide the email address in the search parameter.

**Is my Mautic data secure?**
Absolutely. Your credentials are encrypted at rest and injected securely at runtime.