Connect Mailchimp to ChatGPT: Design Campaigns and Email Templates
Learn how to connect Mailchimp to ChatGPT using an MCP server. Automate email campaigns, manage audiences, and design templates with AI-driven workflows.
If you need to connect Mailchimp to ChatGPT to automate email marketing campaigns, manage audience segments, or generate dynamic HTML templates, you need a Model Context Protocol (MCP) server. This server acts as the critical translation layer between ChatGPT's JSON-RPC tool calls and Mailchimp's REST APIs. You can either build, host, and maintain this infrastructure yourself, or use a managed integration platform like Truto to dynamically generate a secure, authenticated MCP server URL.
If your team uses Claude, check out our guide on connecting Mailchimp to Claude or explore our broader architectural overview on connecting Mailchimp to AI Agents.
Giving a Large Language Model (LLM) read and write access to a marketing automation platform like Mailchimp is a massive engineering challenge. You have to handle complex nested data payloads, map campaign configuration options to MCP tool definitions, and deal with strict audience management rules. Every time a developer updates an API schema or changes a rate limit, your custom server code must be updated, redeployed, and tested.
This guide breaks down exactly how to use Truto to generate a secure, managed MCP server for Mailchimp, connect it natively to ChatGPT, and execute complex workflows using natural language.
Stop writing boilerplate API integration code. Let Truto generate secure, managed MCP servers for your AI agents in seconds. :::
The Engineering Reality of the Mailchimp API
A custom MCP server is a self-hosted integration layer. While the open MCP standard provides a predictable way for models to discover tools, implementing it against Mailchimp's highly specific API architecture is exceptionally painful.
If you decide to build a custom MCP server for Mailchimp, you own the entire API lifecycle. Here are the specific integration challenges that break standard CRUD assumptions when working with Mailchimp:
Sharded Data Center Routing
Mailchimp does not have a single global API endpoint. Every Mailchimp account is assigned to a specific data center (e.g., us1, us19, eu2). When you authenticate a user via OAuth, you must extract the dc (data center) prefix from the OAuth metadata and use it to construct the base URL for all subsequent requests (https://<dc>.api.mailchimp.com/3.0/). If your custom MCP server fails to store and route requests to the correct data center per tenant, every API call will fail. Truto handles this routing dynamically via its Proxy API layer, abstracting the data center complexity away from the MCP tool call entirely.
Strict Rate Limits and Concurrency Caps
Mailchimp enforces strict rate limits - typically capping connections at 10 concurrent requests per account. Exceeding this triggers a 429 Too Many Requests error. It is critical to understand that Truto does not retry, throttle, or apply backoff on rate limit errors. When Mailchimp returns an HTTP 429, Truto passes that exact error back to the caller (your AI agent). Truto normalizes the upstream rate limit information into standardized headers (ratelimit-limit, ratelimit-remaining, ratelimit-reset) per the IETF spec. The caller - whether that is your custom code or the LLM framework - is entirely responsible for reading these headers and executing the retry or exponential backoff logic.
Complex Nested Schemas for Campaigns
Creating a campaign in Mailchimp is not a flat key-value operation. The create_a_mailchimp_campaign endpoint requires deeply nested objects like settings (which contains subject_line, title, from_name, reply_to), recipients (which requires list IDs and segment options), and tracking. When exposing this to an LLM via MCP, your JSON schemas must perfectly describe these nested requirements. If the schema is loose, ChatGPT will hallucinate flat payloads that Mailchimp will outright reject. Truto derives these schemas automatically from documentation records, ensuring the LLM understands exactly how to construct the nested body.
The Flat Namespace for MCP Tool Calls
When an MCP client like ChatGPT calls a tool, all arguments arrive as a single flat object. The underlying Mailchimp API, however, expects query parameters (like pagination count and offset) to be separate from the JSON request body. Truto's MCP router solves this by splitting the flat argument object into query and body parameters using the schemas' property keys. You just have to ensure the LLM passes the required fields, and the proxy layer handles the physical request formatting.
How to Generate a Mailchimp MCP Server
Instead of forcing your engineering team to build data center routing and schema parsers, you can generate a fully functional Mailchimp MCP server using Truto. Each server is scoped to a single integrated account and is secured by a hashed cryptographic token.
You can create an MCP server either through the Truto UI or programmatically via the REST API.
Method 1: Via the Truto UI
For ad-hoc agent testing or internal operations, the dashboard is the fastest route:
- Navigate to the Integrated Accounts page in your Truto dashboard and select the connected Mailchimp account.
- Click the MCP Servers tab.
- Click Create MCP Server.
- Select your desired configuration. For example, you can filter the allowed methods to
readonly, preventing the AI from accidentally sending a campaign. - Copy the generated MCP server URL (e.g.,
https://api.truto.one/mcp/abc123def456...).
Method 2: Via the Truto API
For production workflows, you should generate MCP servers programmatically. This allows you to spin up short-lived servers for specific agent sessions.
Make a POST request to /integrated-account/:id/mcp:
const response = await fetch('https://api.truto.one/integrated-account/<YOUR_ACCOUNT_ID>/mcp', {
method: 'POST',
headers: {
'Authorization': 'Bearer <YOUR_TRUTO_API_KEY>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: "ChatGPT Campaign Designer",
config: {
methods: ["read", "write", "custom"], // Restrict what the LLM can do
tags: ["campaigns", "templates"] // Restrict access to specific Mailchimp resources
},
expires_at: "2026-12-31T23:59:59Z" // Optional time-to-live
})
});
const data = await response.json();
console.log(data.url);
// Yields: https://api.truto.one/mcp/<secure-token>Truto validates that the integration is AI-ready, generates a random hex string, hashes it with an HMAC key, stores the configuration in Cloudflare KV, and returns the ready-to-use URL.
How to Connect the MCP Server to ChatGPT
Once you have your Truto MCP server URL, connecting it to ChatGPT takes seconds. The server acts as a self-contained JSON-RPC 2.0 endpoint.
Method A: Via the ChatGPT UI (Custom Connectors)
If you are using ChatGPT Plus, Enterprise, or Developer accounts, you can attach the server directly in the browser:
- In ChatGPT, navigate to Settings -> Apps -> Advanced settings.
- Enable the Developer mode toggle.
- Under MCP servers / Custom connectors, click Add new server.
- Provide a recognizable name (e.g., "Mailchimp Ops (Truto)").
- Paste the Truto MCP URL into the Server URL field and click Save.
ChatGPT will immediately ping the /initialize endpoint, perform a handshake, and ingest the tool descriptions for Mailchimp.
Method B: Via Manual Config File (Local Agents)
If you are running an orchestrator, Claude Desktop, or a local agent framework that relies on MCP configuration files, you can connect using the Server-Sent Events (SSE) transport. Create a JSON configuration file specifying the npx command:
{
"mcpServers": {
"mailchimp_truto": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-sse",
"--url",
"https://api.truto.one/mcp/<YOUR_SECURE_TOKEN>"
]
}
}
}Restart your agent framework, and the tools will automatically populate.
Mailchimp Hero Tools for AI Agents
Truto derives MCP tools dynamically from Mailchimp's integration resources and documentation records. If a resource lacks documentation, it is dropped from the MCP server, acting as a strict quality gate.
Here are the most powerful Mailchimp tools you can expose to your LLM.
create_a_mailchimp_campaign
This is the core tool for initiating email marketing workflows. It accepts nested objects defining the campaign type, recipients, and tracking settings. The LLM must supply the required type parameter (typically regular or plaintext).
"Draft a new regular marketing campaign targeting the list with ID 'abc1234'. Set the subject line to 'Q4 Product Updates' and the from name to 'Engineering Team'."
update_a_mailchimp_campaign_by_id
Campaigns are frequently updated before sending. This tool allows the AI to patch specific fields - like adjusting the reply-to email address or changing A/B testing parameters - without overwriting the entire configuration. It requires the id of the campaign and the updated settings object.
"Update the campaign with ID 'c8f9b2d' to track HTML clicks and change the subject line to 'Important: Q4 Product Updates'."
create_a_mailchimp_template
LLMs excel at generating HTML content. This tool allows the agent to take raw markdown or generated text and push it directly into Mailchimp as a saved email template. It requires a name and the raw html string.
"Generate a clean, responsive HTML email template for a product launch announcement. Once generated, save it to Mailchimp as 'Q4 Launch Template'."
mailchimp_members_upsert
Managing audience lists manually is prone to errors. The upsert tool is incredibly powerful because it is idempotent: it will add a new member if the email address does not exist, or update their fields if they are already subscribed. It requires the list_id, email_address, and a status_if_new flag.
"Take this list of webinar attendees and upsert them into the main subscriber audience. Tag them with 'q4-webinar' and set their status to 'subscribed'."
list_all_mailchimp_lists
Before an LLM can add a user or create a campaign, it needs to know the correct Audience ID (List ID). This read-only tool allows the agent to search and retrieve all subscriber lists in the account, including vital metadata like subscriber counts and list ratings.
"Fetch all available audience lists in our Mailchimp account and tell me which one has the highest subscriber count."
list_all_mailchimp_campaign_folders
Enterprise accounts often have thousands of campaigns. Folders keep them organized. This tool allows the AI to retrieve folder IDs, which are necessary when you want the agent to organize newly generated campaigns correctly.
"Find the ID for the campaign folder named '2026 Newsletters'."
Note: This is only a curated selection. For the complete list of available operations, required parameters, and schema definitions, review the Mailchimp integration page.
Workflows in Action
AI agents are most effective when they string multiple tools together to accomplish a business goal. Here are two concrete ways a Mailchimp MCP server can automate your operations.
Automated Newsletter Assembly
Marketing teams waste hours moving content from Google Docs to Mailchimp. An AI agent can handle the entire assembly process.
"Find the 'Monthly Newsletter' audience. Then, generate an HTML email summarizing our recent blog posts, save it as a new template, and create a draft campaign using that template targeting the audience."
Step-by-step execution:
- The agent calls
list_all_mailchimp_liststo find the correct Audience ID. - The agent generates the HTML content and calls
create_a_mailchimp_templateto store the design in Mailchimp. - The agent calls
create_a_mailchimp_campaign, passing the Audience ID, the new Template ID, and the required campaign settings. - The agent returns the URL to the draft campaign so the marketing manager can review it before hitting send.
sequenceDiagram
participant User as Marketer
participant ChatGPT as ChatGPT
participant Truto as Truto MCP Router
participant Upstream as Mailchimp API
User->>ChatGPT: "Create a newsletter for the main list..."
ChatGPT->>Truto: call list_all_mailchimp_lists()
Truto->>Upstream: GET /3.0/lists
Upstream-->>Truto: { lists: [{ id: "aud_123", name: "Monthly Newsletter" }] }
Truto-->>ChatGPT: Result: "aud_123"
ChatGPT->>Truto: call create_a_mailchimp_template({ html, name })
Truto->>Upstream: POST /3.0/templates
Upstream-->>Truto: { id: "tpl_456" }
Truto-->>ChatGPT: Result: "tpl_456"
ChatGPT->>Truto: call create_a_mailchimp_campaign({ list_id, template_id })
Truto->>Upstream: POST /3.0/campaigns
Upstream-->>Truto: { id: "camp_789", status: "save" }
Truto-->>ChatGPT: Result: "camp_789"
ChatGPT-->>User: "Draft campaign created successfully."Support-Driven Audience Upserts
When a support agent resolves a critical ticket, they often need to update the customer's marketing preferences or add them to an exclusion list.
"The user at jane.doe@example.com just reported a bug. Upsert her into the 'Software Updates' list and add a tag indicating she experienced the Q4 outage."
Step-by-step execution:
- The agent calls
list_all_mailchimp_liststo find the ID for "Software Updates". - The agent calls
mailchimp_members_upsertusing the target email address and list ID. - The AI confirms the member's profile has been updated and tags have been applied, bridging the gap between support operations and marketing data.
Security and Access Control
Giving an LLM access to a live marketing database requires strict access controls. The Truto MCP architecture provides multiple layers of security to prevent accidental data destruction or unauthorized access.
- Method Filtering: You can restrict a Mailchimp MCP server to specific HTTP methods. Passing
methods: ["read"]ensures the agent can query lists and templates but cannot executecreate,update, ordeleteoperations. - Tag Filtering: Limit the surface area by passing tags like
["audiences"]. The server will only expose tools related to subscriber lists, hiding all campaign and file manager endpoints. - Require API Token Auth: By setting
require_api_token_auth: true, possession of the MCP URL is no longer enough. The client must also pass a valid Truto API token in theAuthorizationheader, tying usage directly to authenticated users. - Expiring Servers: Use the
expires_atproperty to grant temporary access. Truto automatically schedules a cleanup alarm that completely destroys the KV entries and database records once the timestamp is reached, eliminating stale access vectors.
Final Thoughts on MCP Architecture
Building an AI integration for Mailchimp requires navigating specific data center routing, managing strict API rate limits (and handling your own backoff when you hit those 429s), and wrangling deeply nested JSON schemas. Writing a custom MCP server means you inherit the maintenance burden of that entire lifecycle.
By leveraging a dynamic, documentation-driven architecture like Truto, your engineering team can sidestep the boilerplate entirely. You configure the filters, generate a secure token URL, and let your AI agents get straight to work designing campaigns, updating audiences, and analyzing marketing data in real time.
FAQ
- How do rate limits work with Truto's Mailchimp MCP server?
- Truto does not automatically retry or absorb rate limit errors. If you exceed Mailchimp's concurrency limits, Truto passes the HTTP 429 error directly back to the caller with standard IETF rate-limit headers. The caller must implement its own retry and backoff logic.
- Can I prevent ChatGPT from accidentally sending a Mailchimp campaign?
- Yes. When creating the MCP server in Truto, you can use method filtering. By setting the allowed methods to `read`, the LLM will only be able to execute `GET` or `LIST` operations, completely blocking any write or send actions.
- Do I need to manage Mailchimp's data center routing logic?
- No. Truto's Proxy API layer handles data center routing automatically. When you authenticate an account, Truto stores the `dc` prefix and maps all subsequent MCP tool calls to the correct regional endpoint seamlessly.
- How do I pass complex nested data like campaign settings to the MCP tool?
- Truto automatically derives tool schemas from Mailchimp's documentation records. ChatGPT receives a clear JSON schema outlining the required nested objects, allowing the LLM to format the flat input arguments correctly for Truto's MCP router.