Connect Campaign Monitor to Claude: Track Stats and Segment Audience
Learn how to connect Campaign Monitor to Claude using a managed MCP server. This guide covers tracking stats, segmenting audiences, and configuring secure AI tool calls.
If you need to connect Campaign Monitor to Claude to track campaign performance, segment your audience, or audit transactional email logs, you need a Model Context Protocol (MCP) server. This server acts as the translation layer between Claude's natural language tool calls and Campaign Monitor's REST APIs. You can either build 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 ChatGPT, check out our guide on /connect-campaign-monitor-to-chatgpt-run-email-campaigns-and-lists/ or explore our broader architectural overview on /connect-campaign-monitor-to-ai-agents-automate-sends-and-account-admin/.
Giving a Large Language Model (LLM) read and write access to a sprawling email marketing platform like Campaign Monitor is an engineering challenge. You have to handle OAuth 2.0 or API key authentication, map complex, nested JSON schemas to MCP tool definitions, and deal with Campaign Monitor's distinct account hierarchies. Every time a marketing team adds a new client ID or updates a custom field, your integration logic has to adapt.
This guide breaks down exactly how to use Truto to generate a secure, managed MCP server for Campaign Monitor, connect it natively to Claude Desktop, and execute complex audience segmentation and reporting workflows using natural language.
The Engineering Reality of the Campaign Monitor 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, the reality of implementing it against Campaign Monitor's APIs is painful. Campaign Monitor is built for agencies and large organizations, and its API architecture reflects that complexity.
If you decide to build a custom MCP server for Campaign Monitor, here are the specific integration challenges you will face:
The Client vs. Account Hierarchy
Campaign Monitor uses a strict hierarchy where an overarching Account manages multiple Clients. Almost every meaningful operation - listing campaigns, creating segments, viewing subscriber lists - requires a client_id in the API path or payload. If you build a naive MCP server, Claude will constantly fail because it doesn't know which Client ID to inject into the request. You must build an abstraction layer that allows the LLM to first query the available clients, store that state, and map it to subsequent API calls.
Transactional vs. Marketing API Separation
Campaign Monitor treats marketing emails (Campaigns) and transactional emails (Smart and Classic) as entirely different systems with different endpoints and data models. A "sent campaign" and a "sent smart email" share almost no structural DNA in the API. If an LLM is asked to "find out why John's email bounced," it has to know whether to check campaign_monitor_campaigns_bounces or campaign_monitor_transactional_statistics. Hardcoding these routing rules into a custom MCP server is brittle.
Complex Pagination and Geolocation Data
When you pull subscriber engagement data (like opens or clicks), Campaign Monitor returns paginated results containing deeply nested geocoded locations (latitude, longitude, region, country code). LLMs have strict context window limits. If you dump 50 pages of raw JSON geolocation data into Claude's context window without standardizing or truncating it, you will immediately trigger a context overflow. Your MCP server must inject specific instructions into the schema to force the LLM to handle pagination cursors (PageNumber, PageSize, OrderField) safely.
How to Generate a Managed MCP Server for Campaign Monitor
Instead of writing and hosting custom JSON-RPC middleware to handle Campaign Monitor's quirks, you can use Truto to auto-generate a secure MCP server.
Truto handles the underlying API complexity - authentication, pagination standardization, and schema mapping - and exposes a clean list of tools dynamically derived from the Campaign Monitor API documentation.
You can create this MCP server in two ways: via the Truto UI for rapid prototyping, or via the API for programmatic, multi-tenant deployment.
Method 1: Via the Truto UI
If you are an IT admin or developer testing the integration, the UI is the fastest path.
- Log into your Truto dashboard and navigate to the Integrated Accounts page.
- Select your connected Campaign Monitor account.
- Click the MCP Servers tab.
- Click Create MCP Server.
- Configure your server settings (e.g., restrict allowed methods to "read" for safety, or filter by specific tags like "campaigns").
- Click Generate and copy the resulting MCP Server URL (e.g.,
https://api.truto.one/mcp/abc123def456...).
Method 2: Via the Truto API
For B2B SaaS platforms provisioning AI agents for their own customers, you can generate MCP servers programmatically. Make an authenticated POST request to the Truto API to generate a unique, tenant-scoped MCP URL.
curl -X POST https://api.truto.one/integrated-account/{integrated_account_id}/mcp \
-H "Authorization: Bearer YOUR_TRUTO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Campaign Monitor Analytics Agent",
"config": {
"methods": ["read", "list"],
"tags": ["campaigns", "statistics"]
},
"expires_at": "2026-12-31T23:59:59Z"
}'This API call returns a secure JSON-RPC 2.0 endpoint. Truto hashes the token before storing it in Cloudflare KV, ensuring that even if infrastructure is compromised, the raw tokens cannot be extracted.
Connecting the MCP Server to Claude
Once you have your Truto MCP Server URL, you need to connect it to your LLM client. We will look at both the UI-based approach and the manual configuration approach for headless setups.
Method A: Via the Claude UI
If you are using Claude Desktop or an enterprise workspace that supports visual connectors, adding the server takes seconds.
- Open Claude and navigate to Settings.
- Go to Integrations (or Connectors depending on your tier).
- Click Add MCP Server.
- Paste the Truto MCP URL generated in the previous step.
- Click Add.
Claude will immediately execute a tools/list handshake with the server, mapping all available Campaign Monitor endpoints as callable tools in its context window.
Method B: Via Manual Config File (SSE Transport)
For developer environments, CLI tools, or custom agents running Claude Desktop locally, you can modify the configuration file directly to use Server-Sent Events (SSE).
Open your claude_desktop_config.json file (typically located at ~/Library/Application Support/Claude/claude_desktop_config.json on macOS or %APPDATA%\Claude\claude_desktop_config.json on Windows) and add the following JSON:
{
"mcpServers": {
"campaign_monitor_truto": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-sse",
"https://api.truto.one/mcp/YOUR_TRUTO_TOKEN"
]
}
}
}Save the file and restart Claude Desktop. The server-sse package will establish a persistent connection to the Truto proxy, allowing Claude to execute tools against Campaign Monitor.
Hero Tools for Campaign Monitor
Truto dynamically generates dozens of tools for Campaign Monitor based on the underlying API definitions. Here are the most powerful "hero tools" for tracking stats and segmenting audiences, complete with the prompts required to trigger them.
Get Campaign Summary Statistics
Tool: campaign_monitor_campaigns_summary
This is the core tool for analyzing campaign performance. It returns a high-level aggregate of opens, clicks, unsubscribes, bounces, and spam complaints for a specific sent campaign.
"Claude, pull the summary statistics for the Q3 Newsletter campaign (ID: abc12345). Calculate our open rate and click-to-open rate based on the total recipients."
Retrieve Detailed Open Activity
Tool: campaign_monitor_campaigns_opens
While the summary gives you aggregate numbers, this tool provides the raw, paginated list of every subscriber who opened the campaign. Crucially, Campaign Monitor includes geocoded location data and IP addresses in this payload, making it perfect for geographic analysis.
"Fetch the first page of opens for campaign ID xyz987. Group the results by country name and tell me which region had the highest engagement."
Analyze Subscriber History
Tool: campaign_monitor_subscribers_history
When you need to investigate a specific user's behavior across multiple lists and campaigns, this tool returns their entire timeline of interactions, including opens, link clicks, and bounce events.
"Look up the subscriber history for billing@example.com on list ID 445566. Did they open any of the automated retention emails we sent last week?"
Create and Refine Segments
Tool: list_all_campaign_monitor_client_segments
Before launching a new campaign, marketers often need to review existing segmentation rules. This tool lists all segments defined across a client's subscriber lists, allowing the LLM to audit audience targeting logic.
"List all the segments currently configured for Client ID 998877. Identify any segments that appear to target inactive or disengaged users based on their titles."
Draft a New Campaign
Tool: create_a_campaign_monitor_campaign
AI agents are not just for reading data - they can take action. This tool allows Claude to compile HTML content, define sender details, specify target segments, and push a draft campaign directly into the Campaign Monitor interface.
"Create a new draft campaign for Client ID 998877 named 'Spring Promo 2026'. Use 'marketing@ourdomain.com' as the sender. Target segment IDs [111, 222] and generate a brief HTML payload announcing our 20% off sale."
Track Transactional Delivery Statistics
Tool: campaign_monitor_transactional_statistics
Because Campaign Monitor separates marketing and transactional emails, this tool is required to audit password resets, receipts, and alert emails. It returns aggregate delivery, bounce, and open metrics filtered by date range or specific transactional groups.
"Pull the transactional delivery statistics for the last 30 days. Did we see an unusual spike in hard bounces for the 'Password Reset' email group?"
For the complete inventory of available operations - including webhooks, list management, and custom field creation - view the Campaign Monitor integration page.
Workflows in Action
Exposing individual tools to an LLM is useful, but the real power of MCP lies in chained workflows. Here is how Claude reasons through complex, multi-step marketing operations using the Campaign Monitor server.
Scenario 1: Post-Campaign Geolocation Analysis
A marketing director wants to know where a recent global newsletter performed best to optimize ad spend for the next quarter. The LLM must find the client, locate the campaign, and parse paginated location data.
"Find the 'Global Q3 Update' campaign for our main client account. Pull the open data and generate a markdown table showing the top 5 countries by open volume, along with the most active city in each."
How the agent executes this:
- Calls
list_all_campaign_monitor_clientsto retrieve theClientID. - Calls
campaign_monitor_campaigns_list_sentusing theclient_idand filters the response in-memory to find theCampaignIDfor "Global Q3 Update". - Calls
campaign_monitor_campaigns_openspassing thecampaign_id. - Analyzes the returned JSON array, extracts the
country nameandcityfrom the geocoded payloads, aggregates the counts, and formats the output into a markdown table.
sequenceDiagram
participant User as User
participant Claude as Claude Desktop
participant Truto as Truto MCP Server
participant CM as Campaign Monitor API
User->>Claude: "Analyze opens by country for Q3 Update..."
Claude->>Truto: tools/call (list_all_campaign_monitor_clients)
Truto->>CM: GET /api/v3.3/clients.json
CM-->>Truto: [{ClientID: "A1B2"}]
Truto-->>Claude: Client data
Claude->>Truto: tools/call (campaign_monitor_campaigns_list_sent)
Truto->>CM: GET /api/v3.3/clients/A1B2/campaigns.json
CM-->>Truto: [{CampaignID: "X9Y8", Name: "Global Q3 Update"}]
Truto-->>Claude: Campaign list
Claude->>Truto: tools/call (campaign_monitor_campaigns_opens)
Truto->>CM: GET /api/v3.3/campaigns/X9Y8/opens.json
CM-->>Truto: [{EmailAddress: "...", Latitude: "...", CountryCode: "US"}]
Truto-->>Claude: Geocoded open data
Claude-->>User: Markdown table of top regionsScenario 2: Churn Auditing and Suppression
An IT admin needs to investigate why a batch of transactional receipts failed to deliver and ensure those bad addresses are suppressed from future marketing sends to protect domain reputation.
"Check our transactional email statistics for the last 7 days. If there are hard bounces, find the specific email addresses that bounced, and add them to our client suppression list."
How the agent executes this:
- Calls
list_all_campaign_monitor_transactional_statisticsto confirm there is a non-zero bounce count. - Calls
list_all_campaign_monitor_transactional_messagesfiltering for bounced statuses to retrieve the raw array of failedRecipientemail addresses. - Calls
list_all_campaign_monitor_clientsto retrieve the targetclient_id. - Calls
campaign_monitor_suppression_list_suppresspassing theclient_idand the array of bouncedEmailAddressesto actively block them.
The LLM handles the logic routing, moving data from the transactional architecture over to the marketing suppression lists seamlessly.
Security and Access Control
Giving an AI agent access to your email marketing database requires strict security controls. Truto's MCP architecture provides several layers of protection built into the token generation process:
- Method Filtering: You can strictly limit the MCP server to
readoperations. This ensures the LLM can query stats and subscriber lists, but physically cannot trigger a campaign send or delete a client. - Tag Filtering: Limit the server's scope to specific functional areas. By filtering for the "statistics" tag, the LLM will only see reporting endpoints and will be unaware that subscriber deletion tools even exist.
- Time-to-Live (Expires At): When generating a server for a temporary audit, use the
expires_atparameter. Truto schedules a Durable Object alarm that automatically purges the token from Cloudflare KV at the exact millisecond of expiration, preventing lingering backdoor access. - API Token Authentication: By enabling
require_api_token_auth: true, the MCP server URL alone is no longer enough to execute tools. The caller must also pass a valid Truto session or API token, ensuring that only authenticated team members can use the tools, even if the URL leaks in a shared chat log.
Handling Rate Limits at Scale
Campaign Monitor enforces strict API quotas, particularly on heavy reporting endpoints and bulk imports.
It is critical to understand how Truto handles these limits: Truto does not retry, throttle, or apply backoff on rate limit errors. When Campaign Monitor returns an HTTP 429 Too Many Requests error, Truto passes that error directly back to the calling agent.
However, Truto does normalize the upstream rate limit information into standardized headers (ratelimit-limit, ratelimit-remaining, ratelimit-reset) per the IETF specification. It is the responsibility of the MCP client (or the LLM framework executing the tool) to read these headers, implement backoff logic, and pause execution until the ratelimit-reset window clears. Do not rely on the proxy to absorb these errors automatically.
Architecting for AI-Driven Marketing Operations
Connecting Campaign Monitor to Claude via a managed MCP server transforms how your team interacts with marketing data. You no longer have to export CSVs, run pivot tables, or manually cross-reference transactional logs against marketing lists. By providing the LLM with a highly structured, dynamically generated toolset, you enable natural language execution of complex segmentation and analytics tasks.
Stop writing custom JSON-RPC middleware and maintaining mapping logic for every new Campaign Monitor endpoint.
FAQ
- How do I connect Campaign Monitor to Claude?
- You can connect Campaign Monitor to Claude by creating a Model Context Protocol (MCP) server using Truto. Truto auto-generates the server URL, which you can add to Claude Desktop via the UI or a configuration file.
- Can I prevent Claude from sending emails in Campaign Monitor?
- Yes. When configuring your Truto MCP server, you can apply method filtering (e.g., restricting the server to "read" operations only) to ensure the LLM can pull reports but cannot trigger campaigns or modify lists.
- How does the MCP server handle Campaign Monitor's rate limits?
- Truto passes HTTP 429 rate limit errors directly to the caller, standardizing the rate limit data into IETF-compliant headers (ratelimit-limit, ratelimit-remaining, ratelimit-reset). The calling agent is responsible for implementing retry and backoff logic.
- Do I need to hardcode Campaign Monitor's client IDs into the MCP tools?
- No. The LLM uses tools like `list_all_campaign_monitor_clients` to discover the correct Client IDs dynamically, which it then passes as parameters to subsequent API calls for campaigns and lists.