Connect Klaviyo to Claude Code

Read Klaviyo profiles, lists, segments, campaigns, flows, metrics and events. Add Toolspoke to Claude Code once and it can use 12 Klaviyo actions. Your Klaviyo credential stays in Toolspoke, and you choose which actions Claude Code may call.

Set it up in Claude Code

Three steps, the first one once for every toolkit you will ever add.

  1. Add Toolspoke to Claude Code

    Run it in your project, then /mcp to sign in

    claude mcp add --transport http toolspoke https://toolspoke.com/mcp

    The sign-in opens in your browser, and Toolspoke asks you to approve it.

  2. Install Klaviyo and connect it

    Add Klaviyo to a project in your Toolspoke workspace.

    API key. You provide it once, when you install the connector. Toolspoke encrypts it at rest and decrypts it only for the length of a single call, and the gateway attaches it to the outbound request itself, so it is never part of the arguments an agent sends.

    Private API key
    Klaviyo → Settings → API keys → Create private API key. Give it the read scopes this install needs (Profiles, Lists, Segments, Campaigns, Flows, Metrics, Events) and add Profiles write only if create_or_update_profile will be used.
  3. Choose what Claude Code may do

    All 12 actions start on. Switch off the one action that changes something in Klaviyo, and Claude Code gets a refusal if it tries.

What you can ask Claude Code for

A few of the Klaviyo actions that only read, so they are safe to try first.

  • List profiles in the Klaviyo account
  • Fetch one profile by its Klaviyo ID, optionally with its list and segment memberships
  • Fetch one list by ID
  • List the account's segments, audiences defined by rules, which Klaviyo re-evaluates continuously

What Claude Code can do in Klaviyo

11 actions read and one writes.

Reads

  • List profiles

    List profiles in the Klaviyo account. Returns real people, email addresses, phone numbers, names and custom properties, so ask for a filter rather than paging the whole account. Filters use Klaviyo's expression syntax: equals(email,'[email protected]'), any(id,["01ABC","01DEF"]), greater-than(created,2026-01-01T00:00:00Z).

  • Get profile

    Fetch one profile by its Klaviyo ID, optionally with its list and segment memberships. Returns that person's contact details and properties.

  • List lists

    List the account's lists, the manually managed audiences a person is added to or removed from, as opposed to segments, which are rule-driven. Returns list names and IDs, not their members. Klaviyo caps this endpoint at 10 per page.

  • Get list

    Fetch one list by ID. Pass additional_fields ["profile_count"] to include how many people are on it. Klaviyo rate-limits that variant hard (about one call a second), so do not ask for it in a loop.

  • List segments

    List the account's segments, audiences defined by rules, which Klaviyo re-evaluates continuously. Returns definitions and IDs, not the people in them. Klaviyo caps this endpoint at 10 per page.

  • List campaigns

    List campaigns. Klaviyo rejects this endpoint without a channel filter, so `filter` always carries one and defaults to equals(messages.channel,'email'). Whatever you pass must still name a channel, combine with and(...), e.g. and(equals(messages.channel,'sms'),equals(status,'Sent')). Valid channels are email, sms and mobile_push.

  • Get campaign

    Fetch one campaign by ID, with its status, schedule and audience references. Pass include to pull the campaign's messages, subject lines, preview text and template references, in the same call.

  • List metrics

    List the metrics Klaviyo tracks for this account. Placed Order, Opened Email, Viewed Product, and anything your integrations send. Call this first to find the metric ID that query_metric_aggregates needs.

  • Query metric aggregates

    Count or sum a metric over a date range, optionally bucketed by interval and broken down by a property. This is the reporting action: it answers "how many orders last month", "revenue by channel", "opens per day" without returning a row per person. Get the metric ID from list_metrics. Measurements are count, sum_value, unique. Break down with group_by, e.g. ["$attributed_channel"] or ["$flow"].

  • List flows

    List the account's automated flows, welcome series, abandoned cart, win-back, with their status and trigger type. Returns definitions, not the people who went through them.

  • List events

    List raw events, one row per thing one person did, with the event properties that came with it. Filter by metric_id or profile_id and by datetime; without a filter this is the account's whole firehose. Use query_metric_aggregates instead when the question is a total rather than a list of individual actions.

Writes

  • Create or update profile

    Create a profile, or update one that already exists, by email, phone number or external ID. Klaviyo matches on those identifiers, so calling this twice with the same email updates rather than duplicates. Answers 201 when it created and 200 when it updated. Properties passed here replace the values already stored under those keys.

Klaviyo in Claude Code: questions

Does Claude Code see my Klaviyo credential?

No. The credential is stored encrypted in Toolspoke, and the gateway adds it to each call. Claude Code only ever talks to Toolspoke, and the dashboard shows the last four characters of the credential and nothing more.

Can I stop Claude Code from changing things in Klaviyo?

Yes. Each of the 12 actions can be switched off for a project. Turn off the one that changes something and Claude Code can only read.

Will 12 actions crowd Claude Code's context?

No. Toolspoke shows Claude Code five bridge tools, plus a guide where a toolkit has one, and Claude Code searches for the Klaviyo action it needs when it needs it. Adding more toolkits does not add more tools to its list.

Can I add it once for every project?

Yes. Add --scope user to the command and Claude Code keeps Toolspoke in every project on this machine. Without it, the server is added to the project you ran the command in.

What does it cost?

Tool calls are free on every plan, and a Klaviyo call does not run in a sandbox, so it bills nothing.

Try Klaviyo in Claude Code

Free to start, and tool calls cost nothing on any plan.