Mautic MCP Server

Mautic MCP Server

Enables comprehensive integration with Mautic marketing automation platform, providing contact management, campaign automation, email operations, form management, analytics, and content management through natural language commands.

Category
访问服务器

README

Mautic MCP Server

A comprehensive Model Context Protocol (MCP) server that provides full integration with Mautic marketing automation platform.

GitHub Stars GitHub Issues GitHub License

🚀 Quick Start

# Clone and setup
git clone https://github.com/Cbrown35/mantic-MCP.git
cd mantic-MCP
npm install

# Configure your Mautic credentials
cp .env.example .env
# Edit .env with your Mautic API credentials

# Build and run
npm run build

Then add the server to your MCP configuration and start using natural language commands like:

  • "Search for all contacts with gmail in their email"
  • "Create a new contact named John Doe"
  • "List all email campaigns"

Features

This MCP server provides complete access to your Mautic instance with the following capabilities:

🔐 Authentication

  • OAuth2 authentication with automatic token refresh
  • Secure credential management through environment variables

👥 Contact Management

  • create_contact - Create new contacts with custom fields
  • update_contact - Update existing contact information
  • get_contact - Retrieve contact details by ID or email
  • search_contacts - Search contacts with filters and pagination
  • delete_contact - Remove contacts from Mautic
  • add_contact_to_segment - Add contacts to specific segments

📧 Campaign Management

  • list_campaigns - Get all campaigns with status and statistics
  • get_campaign - Get detailed campaign information
  • create_campaign - Create new campaigns
  • add_contact_to_campaign - Add contacts to campaigns
  • create_campaign_with_automation - Create campaigns with full event automation (🔥 NEW)
  • execute_campaign - Manually execute/trigger campaigns (🔥 NEW)
  • get_campaign_contacts - Get contacts in a campaign with their status (🔥 NEW)

✉️ Email Operations

  • send_email - Send emails to specific contacts
  • list_emails - Get all email templates and campaigns
  • get_email - Get detailed email information
  • create_email_template - Create new email templates
  • get_email_stats - Get email performance statistics

📝 Form Management

  • list_forms - Get all forms with submission counts
  • get_form - Get form details and fields
  • get_form_submissions - Get form submission data

🎯 Segment Management

  • list_segments - Get all contact segments
  • create_segment - Create new contact segments with filters
  • get_segment_contacts - Get contacts in a specific segment

📊 Analytics & Reporting

  • get_contact_activity - Get contact interaction history
  • get_email_stats - Get email performance statistics
  • list_reports - Get all reports (⭐ NEW)
  • create_report - Create custom reports (⭐ NEW)

📎 Content Management

  • list_assets - Get all assets (PDFs, images, documents) (⭐ NEW)
  • get_asset - Get asset details by ID (⭐ NEW)
  • create_asset - Create new assets (local or remote) (⭐ NEW)
  • list_pages - Get all landing pages (⭐ NEW)
  • create_page - Create new landing pages (⭐ NEW)
  • list_sms - Get all SMS templates (⭐ NEW)
  • create_sms - Create SMS templates (⭐ NEW)

🏢 Business Entities

  • list_companies - Get all companies (⭐ NEW)
  • create_company - Create new companies (⭐ NEW)
  • add_contact_to_company - Associate contacts with companies (⭐ NEW)
  • create_note - Add notes to contacts or companies (⭐ NEW)
  • get_contact_notes - Get all notes for a contact (⭐ NEW)
  • list_tags - Get all available tags (⭐ NEW)
  • create_tag - Create new tags (⭐ NEW)
  • add_contact_tags - Add tags to contacts (⭐ NEW)
  • list_categories - Get all categories (⭐ NEW)
  • create_category - Create new categories (⭐ NEW)

🎯 Advanced Features

  • add_contact_points - Add points to contacts (📈 NEW)
  • subtract_contact_points - Subtract points from contacts (📈 NEW)
  • list_stages - Get all lifecycle stages (📈 NEW)
  • change_contact_stage - Change contact's lifecycle stage (📈 NEW)
  • list_contact_fields - Get all contact custom fields (📈 NEW)
  • create_contact_field - Create new contact custom fields (📈 NEW)

🔧 Integration & Automation

  • list_webhooks - Get all webhooks (🔧 NEW)
  • create_webhook - Create new webhooks (🔧 NEW)
  • upload_file - Upload files to Mautic (🔧 NEW)

Installation

Prerequisites

  • Node.js (v16 or higher)
  • npm or yarn
  • Access to a Mautic instance with API credentials

Setup

  1. Clone the repository:

    git clone https://github.com/Cbrown35/mantic-MCP.git
    cd mantic-MCP
    
  2. Install dependencies:

    npm install
    
  3. Configure environment variables:

    cp .env.example .env
    

    Edit .env and fill in your Mautic API credentials:

    MAUTIC_BASE_URL=https://your-mautic-instance.com/api/
    MAUTIC_CLIENT_ID=your_client_id_here
    MAUTIC_CLIENT_SECRET=your_client_secret_here
    MAUTIC_TOKEN_ENDPOINT=https://your-mautic-instance.com/oauth/v2/token
    
  4. Build the server:

    npm run build
    
  5. Configure MCP settings: Add the server to your MCP configuration file:

    {
      "mcpServers": {
        "mautic-server": {
          "command": "node",
          "args": ["/path/to/mautic-server/build/index.js"],
          "env": {
            "MAUTIC_BASE_URL": "https://your-mautic-instance.com/api/",
            "MAUTIC_CLIENT_ID": "your_client_id",
            "MAUTIC_CLIENT_SECRET": "your_client_secret",
            "MAUTIC_TOKEN_ENDPOINT": "https://your-mautic-instance.com/oauth/v2/token"
          },
          "disabled": false,
          "autoApprove": []
        }
      }
    }
    

Configuration

Environment Variables

The server requires the following environment variables:

Variable Description Example
MAUTIC_BASE_URL Your Mautic API base URL https://your-mautic.com/api/
MAUTIC_CLIENT_ID OAuth2 Client ID 1_abc123...
MAUTIC_CLIENT_SECRET OAuth2 Client Secret secret123...
MAUTIC_TOKEN_ENDPOINT OAuth2 Token Endpoint https://your-mautic.com/oauth/v2/token

Obtaining Mautic API Credentials

  1. Log into your Mautic instance as an administrator
  2. Go to Settings → Configuration → API Settings
  3. Enable API access
  4. Go to Settings → API Credentials
  5. Create a new API credential with OAuth2 authorization
  6. Note down the Client ID and Client Secret

Usage Examples

Once the server is running, you can use it through MCP tool calls:

Create a Contact

Create a new contact with email "john@example.com", first name "John", and last name "Doe"

Search Contacts

Search for all contacts with "gmail" in their email address

Send Email

Send email template ID 5 to contact ID 123

Get Campaign Statistics

Get detailed information for campaign ID 10

List Forms

Show me all published forms with their submission counts

API Endpoints

The server connects to your Mautic instance at https://mailer.dzind.com/api/ and uses the following main endpoints:

  • /contacts - Contact management
  • /campaigns - Campaign operations
  • /emails - Email management
  • /forms - Form operations
  • /segments - Segment management

Error Handling

The server includes comprehensive error handling:

  • Automatic OAuth2 token refresh
  • Detailed error messages from Mautic API
  • Graceful handling of authentication failures
  • Retry logic for transient errors

Security

  • All credentials are stored as environment variables
  • OAuth2 tokens are automatically refreshed
  • No sensitive data is logged or exposed
  • Secure HTTPS communication with Mautic API

Development

To modify or extend the server:

  1. Edit the source code in src/index.ts
  2. Build the server: npm run build
  3. The server will automatically reload with your changes

🚀 Deployment

Production Deployment

  1. Clone and build:

    git clone https://github.com/Cbrown35/mantic-MCP.git
    cd mantic-MCP
    npm install
    npm run build
    
  2. Set up environment variables in your production environment

  3. Configure your MCP client to point to the built server

  4. Monitor logs for any authentication or API issues

Docker Deployment (Coming Soon)

Docker support is planned for easier deployment and scaling.

🤝 Contributing

We welcome contributions! Here's how to get started:

Development Setup

  1. Fork the repository on GitHub

  2. Clone your fork:

    git clone https://github.com/yourusername/mantic-MCP.git
    cd mantic-MCP
    
  3. Create a feature branch:

    git checkout -b feature/your-feature-name
    
  4. Install dependencies:

    npm install
    
  5. Make your changes and test thoroughly

  6. Build and test:

    npm run build
    # Test your changes with a real Mautic instance
    
  7. Commit and push:

    git add .
    git commit -m "Add your feature description"
    git push origin feature/your-feature-name
    
  8. Create a Pull Request on GitHub

Contribution Guidelines

  • Follow TypeScript best practices
  • Add comprehensive error handling
  • Update documentation for new features
  • Test with real Mautic instances when possible
  • Maintain backward compatibility

Reporting Issues

Found a bug or have a feature request? Please open an issue with:

  • Clear description of the problem or feature
  • Steps to reproduce (for bugs)
  • Your environment details (Node.js version, Mautic version, etc.)
  • Expected vs actual behavior

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🙏 Acknowledgments

  • Built with the Model Context Protocol SDK
  • Integrates with Mautic marketing automation platform
  • Inspired by the need for seamless marketing automation integration

Support

This server provides comprehensive integration with Mautic's REST API. For specific API documentation, refer to your Mautic instance's API documentation.

Getting Help

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选