Skip to content

Connect Klaviyo to Claude: Manage Catalogs, Coupons & Analytics

Learn how to connect Klaviyo to Claude using a managed MCP server. Automate campaigns, sync catalogs, and manage coupons with natural language.

Nachi Raman Nachi Raman · · 8 min read

If you need to connect Klaviyo to Claude to automate marketing operations, synchronize e-commerce catalogs, generate unique coupon codes, or extract campaign analytics, you need a Model Context Protocol (MCP) server. This server acts as the translation layer between Claude's natural language tool calls and Klaviyo'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 connecting Klaviyo to ChatGPT or explore our broader architectural overview on connecting Klaviyo to AI Agents.

Giving a Large Language Model (LLM) read and write access to a sprawling marketing ecosystem like Klaviyo is an engineering challenge. You have to handle API key management, map massive nested schemas to MCP tool definitions, and deal with Klaviyo's strict rate limits. Every time Klaviyo updates an endpoint or modifies the required shape of a payload, you have to update your server code, redeploy, and test the integration. This guide breaks down exactly how to use Truto to generate a secure, managed MCP server for Klaviyo, connect it natively to Claude, and execute complex workflows using natural language.

The Engineering Reality of the Klaviyo 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 Klaviyo's APIs is painful.

If you decide to build a custom MCP server for Klaviyo, you own the entire API lifecycle. Here are the specific challenges you will face:

The JSON:API Specification Nightmare Klaviyo heavily utilizes the JSON:API specification. This means payloads are deeply nested structures requiring data, type, attributes, and relationships nodes. LLMs struggle to correctly construct these deeply nested payloads consistently. If an LLM tries to create a profile, it will naturally attempt to send a flat JSON object like { "email": "user@example.com", "first_name": "John" }. Klaviyo will reject this. It requires { "data": { "type": "profile", "attributes": { "email": "user@example.com", "first_name": "John" } } }. A managed MCP server handles the schema translation, providing the LLM with strict, validated JSON Schemas derived directly from documentation.

Compound ID Structures Klaviyo requires specific compound IDs for many operations, particularly in catalog management. For example, fetching a single catalog category requires an ID formatted as $integration:::$catalog:::$external_id. Exposing this raw requirement to Claude often results in hallucinated or improperly delimited identifiers. The translation layer must enforce these patterns strictly.

Strict Rate Limits and Client-Side Backoff Klaviyo enforces tight rate limits on its endpoints. It is critical to understand how this is handled structurally. Truto does not retry, throttle, or apply backoff on rate limit errors. When an upstream API like Klaviyo returns an HTTP 429, Truto passes that error directly to the caller. Truto normalizes the upstream rate limit information into standardized headers (ratelimit-limit, ratelimit-remaining, ratelimit-reset) per the IETF specification. The caller (or the orchestrating agent framework) is entirely responsible for implementing retry logic and backoff. Do not expect the integration layer to absorb these errors automatically.

Fragmented Pagination Models Klaviyo utilizes cursor-based pagination across its endpoints. If you expose raw pagination tokens directly to Claude, the model will frequently attempt to hallucinate the next token or misunderstand how to iterate through pages. Truto normalizes this across all endpoints into a standard limit and next_cursor schema. The tool description explicitly instructs the LLM to pass cursor values back unchanged, ensuring stable data retrieval without token hallucination.

How to Generate a Managed MCP Server for Klaviyo

Instead of building a translation layer from scratch, you can use Truto to generate a managed MCP server dynamically. Truto creates tool definitions automatically by reading the underlying integration resources and documentation records. A tool only appears in the MCP server if it has a corresponding documentation entry, acting as a quality gate to ensure only well-described endpoints are exposed to the LLM.

You can generate the MCP server URL in two ways:

Method 1: Via the Truto UI

This is the fastest method for internal tooling and rapid prototyping.

  1. Navigate to the integrated account page for your Klaviyo connection in the Truto dashboard.
  2. Click the MCP Servers tab.
  3. Click Create MCP Server.
  4. Select your desired configuration (name, allowed methods, tags, and expiration).
  5. Copy the generated MCP server URL (e.g., https://api.truto.one/mcp/a1b2c3d4e5f6...).

Method 2: Via the API

For programmatic provisioning - such as generating a temporary MCP server for a specific customer workflow - you can use the REST API.

Make a POST request to /integrated-account/:id/mcp:

fetch('https://api.truto.one/admin/integrated-accounts/{account_id}/mcp', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_TRUTO_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    name: "Marketing Operations Agent",
    config: { 
      methods: ["read", "write"], 
      tags: ["marketing", "catalogs"]
    },
    expires_at: "2026-12-31T23:59:59Z"
  })
});

The API generates a secure token, hashes it, stores it in Cloudflare KV for fast resolution, and returns a ready-to-use URL. Because the tool namespaces are flattened (query and body parameters share a flat input space), the router will automatically map the LLM's arguments into the correct payload structure for Klaviyo.

Connecting the MCP Server to Claude

Once you have your Truto MCP URL, connecting it to Claude requires zero additional code. You can use either the UI or a configuration file.

Via the Claude UI

If you are using Claude Desktop or Claude Web:

  1. Open Claude and navigate to Settings → Integrations → Add MCP Server.
  2. Paste your Truto MCP URL.
  3. Click Add.

Note for ChatGPT users: Go to Settings → Apps → Advanced settings, enable Developer mode, and add a Custom connector by pasting the URL.

Via Manual Config File

If you are running Claude Desktop and prefer file-based configuration, or if you are integrating into a headless agent framework, you can connect using the Server-Sent Events (SSE) transport adapter.

Edit your claude_desktop_config.json file:

{
  "mcpServers": {
    "klaviyo-truto": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-sse",
        "https://api.truto.one/mcp/YOUR_SECURE_TOKEN"
      ]
    }
  }
}

Restart Claude Desktop. The application will perform an MCP handshake, calling the initialize method, and automatically discover all available Klaviyo tools.

Hero Tools for Klaviyo Workflows

Once connected, Claude has access to dozens of Klaviyo endpoints. Here are the most powerful operations you can automate via natural language.

list_all_klaviyo_segments

Retrieve all segments in a Klaviyo account. This tool returns segment records including names, processing status, and definitions. It is essential for audience discovery before deploying a targeted campaign.

"List all active segments in Klaviyo that have been updated in the last 30 days."

create_a_klaviyo_campaign

Create a new email or SMS campaign. The LLM can draft the campaign parameters, assign it to an audience (using the segment IDs retrieved earlier), and define the tracking options.

"Draft a new email campaign called 'Winter Clearance' and assign it to the 'High Value Customers' segment ID I just found."

list_all_klaviyo_profiles

Retrieve Klaviyo profiles. This tool supports complex filtering by email, phone number, or external ID. It is highly useful for verifying customer records or auditing user consent and subscription data.

"Search for a profile with the email address jdoe@example.com and tell me when their profile was created."

create_a_klaviyo_coupon_code

Generate a unique coupon code linked to a master coupon ID. The LLM can orchestrate workflows where a customer requests a discount, the LLM provisions a unique code synchronously, and then returns it to the user or adds it to their profile.

"Generate a new unique coupon code for the 'Summer Sale 2026' master coupon ID."

list_all_klaviyo_catalog_items

Extract catalog items from Klaviyo. This allows the AI agent to audit what products are currently published, check prices, and verify external IDs without leaving the chat interface.

"List the first 10 catalog items in the Klaviyo catalog and summarize their prices."

create_a_klaviyo_event

Push custom events to Klaviyo to track profile activity. If a customer takes an action in your external systems, the LLM can log that event directly to their Klaviyo profile, triggering subsequent marketing flows.

"Log a 'Completed Onboarding' event for the profile with email support@example.com."

For the complete inventory of available Klaviyo tools and their exact JSON Schema definitions, view the Klaviyo integration page.

Workflows in Action

Integrating Klaviyo via MCP allows Claude to string multiple API calls together into coherent workflows. Here is how an agent executes multi-step marketing operations.

Scenario 1: Provisioning and Distributing a VIP Coupon

A support agent wants to compensate a high-value customer with a unique discount code and log the interaction.

"Find the 'VIP Retention' master coupon in Klaviyo, generate a unique code for it, and then log a 'Received VIP Discount' event on the profile for vip.user@example.com."

sequenceDiagram
    participant Agent as Claude
    participant Truto as Truto MCP
    participant Klaviyo as Klaviyo API

    Agent->>Truto: list_all_klaviyo_coupons
    Truto->>Klaviyo: GET /api/coupons
    Klaviyo-->>Truto: Returns Coupon List
    Truto-->>Agent: 'VIP Retention' ID: CPN-123
    
    Agent->>Truto: create_a_klaviyo_coupon_code
    Truto->>Klaviyo: POST /api/coupon-codes
    Klaviyo-->>Truto: Code: VIP-XYZ-789
    Truto-->>Agent: VIP-XYZ-789

    Agent->>Truto: create_a_klaviyo_event
    Truto->>Klaviyo: POST /api/events
    Klaviyo-->>Truto: Event Created
    Truto-->>Agent: Success
  1. Claude calls list_all_klaviyo_coupons to search for the specific master coupon and retrieves its ID.
  2. Claude calls create_a_klaviyo_coupon_code, passing the coupon ID to generate a unique redemption code.
  3. Claude calls create_a_klaviyo_event to push a custom metric (e.g., 'Received VIP Discount') to the user's profile, including the generated code in the event metadata.

Scenario 2: Synchronizing E-commerce Catalog Data

A merchant needs to ensure a specific subset of products is accurately reflected in Klaviyo for upcoming product recommendation blocks in an email.

"Check if the 'Wireless Headphones V2' catalog item exists in Klaviyo. If it doesn't, create it with external ID 'WH-V2' and a price of 199.99."

graph TD
    A["Agent receives<br>sync request"] --> B["Call list_all_klaviyo_catalog_items"]
    B --> C{"Does item exist?"}
    C -->|"No"| D["Call create_a_klaviyo_catalog_item"]
    C -->|"Yes"| E["Verify price and details"]
    D --> F["Return status to user"]
    E --> F
  1. Claude calls list_all_klaviyo_catalog_items filtering by the requested item name or external ID.
  2. The model analyzes the response. Seeing the item does not exist, it routes to the creation flow.
  3. Claude calls create_a_klaviyo_catalog_item using the strict JSON:API structure enforced by the MCP schema, mapping the external ID and price correctly.

Security and Access Control

When granting an LLM access to your Klaviyo environment, applying the principle of least privilege is non-negotiable. Truto's MCP servers provide several layers of access control:

  • Method Filtering: You can restrict an MCP server strictly to read operations. By setting config.methods: ["read"], the server will completely drop tools like create_a_klaviyo_campaign during the dynamic generation phase.
  • Tag Filtering: If your integration configuration assigns tags to resources, you can limit the MCP server to specific domains. For example, setting config.tags: ["catalogs"] ensures Claude can only access catalog and variant tools, blocking access to user profiles or campaigns.
  • Require API Token Auth: For higher security, setting require_api_token_auth: true means possession of the MCP URL is not enough. The client must also pass a valid Truto API token in the Authorization header, enforcing identity validation.
  • Automatic Expiration: Temporary workflows should use temporary access. Setting an expires_at timestamp ensures the server token is automatically purged from Cloudflare KV and the database when the task is done.

Wrapping Up

Building a custom integration layer for Klaviyo means taking on the burden of JSON:API schema translations, aggressive rate limit management, and complex endpoint pagination. By using a managed MCP server via Truto, you bypass the infrastructure overhead entirely. You get dynamically generated, schema-validated tools that map perfectly to the LLM's flat input namespace.

Whether you are automating campaign drafting, syncing e-commerce catalog variants, or provisioning unique discount codes, connecting Claude to Klaviyo via MCP unlocks massive operational leverage without writing boilerplate integration code.

FAQ

How does the MCP server handle Klaviyo's JSON:API payloads?
Truto dynamically generates MCP tools that abstract the complex JSON:API structure. The LLM passes flat arguments to the MCP server, and Truto's router translates these into the required data, type, attributes, and relationships nesting before sending the request to Klaviyo.
Does Truto retry Klaviyo rate limit errors automatically?
No. Truto does not retry or apply backoff on rate limit errors. When Klaviyo returns an HTTP 429, Truto passes the error back to the caller and translates the rate limit data into standard IETF headers (ratelimit-limit, ratelimit-remaining, ratelimit-reset). The client is responsible for backoff.
How can I restrict Claude to read-only access in Klaviyo?
When creating the MCP server in Truto (via UI or API), you can set the method filter configuration to ["read"]. This instructs the server to only generate tools for GET and LIST endpoints, preventing the LLM from executing write operations like creating campaigns or updating profiles.
Can I connect the Klaviyo MCP server to ChatGPT instead of Claude?
Yes. While this guide focuses on Claude Desktop, you can add the same Truto MCP URL to ChatGPT by navigating to Settings → Apps → Advanced settings, enabling Developer mode, and adding a Custom connector.

More from our Blog