mautic-mcp

mautic-mcp

A lightweight MCP server that connects Claude AI to Mautic marketing automation, enabling contact management, email sending, campaign operations, and analytics via natural language.

Category
访问服务器

README

Mautic MCP Server

A lightweight Model Context Protocol (MCP) server that connects Claude AI to your Mautic marketing automation platform. Once connected, you can manage contacts, send emails, run campaigns, and pull analytics — all through natural language in Claude.

Built and open-sourced by Discret AI.


What This Enables

Claude ↔ MCP Server (Node.js) ↔ Mautic REST API

You talk to Claude. Claude calls your Mautic instance. Examples of what you can say:

"Get all contacts tagged solar-dealer" "Send email ID 12 to all contacts in segment 5" "Create a contact for Ahmed at ahmed@example.com and add him to the solar campaign" "What's the open rate on email 7?" "Add tag follow-up to contact 234"


Tools Available to Claude

Tool Description
get_contacts Search/list contacts with optional filters
get_contact Fetch a single contact by ID
create_contact Create a new contact with fields and tags
update_contact Update an existing contact's fields
delete_contact Delete a contact
send_email Send a transactional email to one contact
bulk_send_email Send an email to a list of contact IDs
get_email_stats Get open/click stats for an email
list_emails List all emails in Mautic
list_segments List all contact segments
add_contact_to_segment Add a contact to a segment
remove_contact_from_segment Remove a contact from a segment
list_campaigns List all campaigns
add_contact_to_campaign Add a contact to a campaign
list_tags List all tags defined in Mautic
add_tag_to_contact Add one or more tags to a contact
get_contact_activity Get full event/activity history for a contact
list_forms List all Mautic forms
get_form_submissions Get submissions for a specific form

Prerequisites

  • Node.js v18 or higher
  • A running Mautic instance (self-hosted or cloud)
  • Mautic API enabled with Basic Auth credentials
  • Claude Desktop (for the MCP integration)

Setup

1. Enable the Mautic API

In your Mautic admin panel:

  1. Go to Settings → Configuration → API Settings
  2. Set API enabled to Yes
  3. Set Enable HTTP basic auth to Yes
  4. Save

2. Clone and Install

git clone https://github.com/abdulhadi-98/mautic-mcp.git
cd mautic-mcp
npm install

3. Configure Credentials

Copy the example env file and fill in your details:

cp .env.example .env

Edit .env:

MAUTIC_URL=https://your-mautic-domain.com
MAUTIC_USER=admin
MAUTIC_PASS=yourpassword

Note: The URL should be your Mautic root URL — no trailing slash. The server automatically appends /api.

4. Connect to Claude Desktop

Open (or create) your Claude Desktop config file:

  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

Add the mautic server entry:

{
  "mcpServers": {
    "mautic": {
      "command": "node",
      "args": ["/absolute/path/to/mautic-mcp/index.js"]
    }
  }
}

Windows example:

{
  "mcpServers": {
    "mautic": {
      "command": "node",
      "args": ["C:\\Users\\YourName\\mautic-mcp\\index.js"]
    }
  }
}

Restart Claude Desktop. You'll see the Mautic tools appear in the toolbar (hammer icon).


Connecting from claude.ai (Web)

The server implements OAuth2 so it works directly from claude.ai in the browser — no desktop app needed.

Extra environment variable required

Add SERVER_URL to your deployment environment (the public HTTPS URL of your server, no trailing slash):

SERVER_URL=https://mcp.yourdomain.com

Connect on claude.ai

  1. Go to claude.ai → Settings → Integrations → Add Integration
  2. Enter your server URL: https://mcp.yourdomain.com
  3. Claude will redirect you to a sign-in page — enter your MCP_API_KEY
  4. You'll be redirected back to Claude, connected and ready

Every team member goes through the same flow with the same API key. The server issues each browser session its own bearer token after the key is verified.

How the OAuth flow works

claude.ai → GET  /.well-known/oauth-authorization-server  (discovery)
         → GET  /oauth/authorize                          (login page)
         → POST /oauth/authorize  (submit API key)        (issues auth code)
         → POST /oauth/token      (exchange code)         (issues bearer token)
         → POST /mcp              (all tool calls)        (requires bearer token)

No database is needed — auth codes expire in 5 minutes, bearer tokens are held in memory. Restarting the server invalidates all tokens (users re-authenticate once).


Usage Examples

Once connected, try these prompts in Claude:

Contact management

Get the first 20 contacts in Mautic
Search for contacts with the email domain @example.com
Create a contact: name Ahmed Khan, email ahmed@example.com, company Solar Co
Add tag "hot-lead" to contact 145

Email sending

Send email ID 8 to contact 312
Send email ID 8 to all of these contacts: 100, 101, 102, 103, 104
What are the open and click stats for email 12?

Segments and campaigns

List all segments
Add contact 200 to segment 3
List all campaigns and tell me which ones are active

Bulk operations

Get all contacts tagged "solar-dealer" and send them email ID 5
Add the 10 contacts I'll paste below to segment 7

Project Structure

mautic-mcp/
├── index.js          # MCP server — all tools and Mautic API calls
├── package.json      # Dependencies
├── .env.example      # Credentials template
└── README.md

Authentication

This server uses HTTP Basic Auth — the simplest method supported by Mautic. For production use cases, Mautic also supports OAuth2. To switch to OAuth2, replace the auth config in index.js with token-based headers using Mautic's OAuth2 flow.


Contributing

Contributions are welcome. To add a new tool:

  1. Add its schema to the ListToolsRequestSchema handler in index.js
  2. Add its execution logic to the CallToolRequestSchema switch block
  3. Open a PR with a description of what the tool does and which Mautic API endpoint it wraps

Please keep tools focused — one tool per Mautic API action.


License

MIT License — free to use, modify, and distribute.


Credits

Built and open-sourced by Discret AI

Discret AI builds AI-powered automation systems for businesses — from intelligent outreach pipelines to custom Claude integrations. This MCP server is part of our commitment to making AI + marketing automation accessible to everyone.


Related Resources

推荐服务器

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 模型以安全和受控的方式获取实时的网络信息。

官方
精选