MA

Mailchimp MCP Server: Read-Only API for AI

Enable AI agents to access Mailchimp data via the MCP server read-only API for secure, seamless insights and integrations.

Quick Install
npx -y @AgentX-ai/mailchimp-mcp

Overview

This MCP (Model Context Protocol) server provides a read-only bridge between AI agents and Mailchimp account data. It implements the MCP tool pattern to expose Mailchimp resources (audiences, campaigns, reports, templates, etc.) as structured, machine-readable endpoints so LLMs and automated agents can fetch contextual data without storing credentials or writing direct API integrations.

By keeping the server read-only, the project minimizes risk: AI agents can retrieve and analyze campaign metrics, audience segments, and subscriber details while preventing modifications to the Mailchimp account. This makes the server useful for analytics, prompt augmentation, RAG (retrieval-augmented generation), and agent-based automation workflows that require Mailchimp context.

Features

  • Read-only access to Mailchimp data for safe AI consumption
  • MCP-compatible endpoints that present Mailchimp resources as tools
  • Lightweight server suitable for local, containerized, or cloud deployment
  • Simple API key or environment-based authentication for the server itself
  • Pluggable: add or extend resource handlers to expose additional Mailchimp endpoints
  • JSON responses optimized for LLM consumption (compact, structured)

Installation / Configuration

Clone the repository and run the server locally or in Docker. The examples below assume a Node.js implementation; the project includes a Dockerfile for containerized runs.

  1. Clone and install
git clone https://github.com/AgentX-ai/mailchimp-mcp.git
cd mailchimp-mcp
npm install
  1. Configure environment variables

Create a .env file (or set environment variables in your deployment):

MAILCHIMP_API_KEY=your-mailchimp-api-key-usX
MAILCHIMP_SERVER_PREFIX=usX       # the datacenter prefix from your API key
MCP_SERVER_PORT=3000
MCP_API_KEY=local-mcp-secret      # protects the MCP endpoints
LOG_LEVEL=info
  1. Run locally
npm start
# or
node ./src/server.js
  1. Run with Docker
docker build -t mailchimp-mcp .
docker run -e MAILCHIMP_API_KEY=your-key -e MAILCHIMP_SERVER_PREFIX=usX -p 3000:3000 mailchimp-mcp

Notes

  • MAILCHIMP_API_KEY should be a Mailchimp API key with read access.
  • MCP_API_KEY secures requests to the MCP server; configure your agent to present this key when calling the tools.

Available Resources

The server exposes a set of read-only MCP tools representing common Mailchimp resources. Each tool returns JSON that’s normalized for AI consumption.

Tool name (example)Endpoint (example)Returns
mailchimp.audiencesGET /mcp/tools/audiencesAudience metadata, counts, tags
mailchimp.membersGET /mcp/tools/audiences/:id/membersSubscribers for an audience (paged)
mailchimp.campaignsGET /mcp/tools/campaignsCampaign list and metadata
mailchimp.reportsGET /mcp/tools/campaigns/:id/reportPerformance metrics and summary
mailchimp.templatesGET /mcp/tools/templatesAvailable templates and metadata
mailchimp.segmentsGET /mcp/tools/audiences/:id/segmentsSegment definitions and counts

These endpoints are read-only and typically support pagination and basic filtering. Responses are JSON with concise field names to simplify prompt retrieval and reasoning.

Example requests

Fetch campaign summaries:

curl -H "Authorization: Bearer ${MCP_API_KEY}" \
  "http://localhost:3000/mcp/tools/campaigns?limit=20"

Get report for a campaign:

curl -H "Authorization: Bearer ${MCP_API_KEY}" \
  "http://localhost:3000/mcp/tools/campaigns/abc123/report"

From Node.js (fetch):

const res = await fetch("http://localhost:3000/mcp/tools/campaigns?limit=5", {
  headers: { "Authorization": `Bearer ${process.env.MCP_API_KEY}` }
});
const campaigns = await res.json();

Use Cases

  • Agent-assisted analytics: An LLM agent can call the campaigns and reports tools to generate a natural-language performance summary (“Top 3 campaigns by open rate in the last 90 days”) without direct access to Mailchimp credentials.
  • Contextual prompt augmentation: On-demand audience and segment data can be appended to prompts for personalized content generation (subject lines, email bodies) with accurate audience sizes and engagement metrics.
  • Automated reporting: Scheduled agents can pull campaign reports and produce executive summaries or send aggregated results to dashboards.
  • Subscriber research: Agents can query audience members and segments to identify trends, churn signals, or high-engagement cohorts for marketing analysis.
  • Compliance and audit workflows: Because the server is read-only, auditors can safely run queries to verify subscriber counts, unsubscribes, and campaign sends without risk of state changes.
  • GitHub: https://github.com/AgentX-ai/mailchimp-mcp
  • Mailchimp API docs: https://mailchimp.com/developer/
  • MCP (Model Context Protocol): follow the MCP pattern used by your agent framework; this server exposes its tools in a compatible JSON format

If you need to expose additional Mailchimp endpoints or customize the tool schema, extend the tool handlers in the repository and follow the existing normalization patterns so LLMs can consume the results predictably.