# Build with an AI agent

> Connect Claude Code, Cursor, Codex or another coding agent to Klaviyo: give it the docs as Markdown, connect it to your account through the MCP server, and point it at a skill for the task.

## Set up your agent

Paste this into your agent. It reads Klaviyo's docs, connects the MCP server and installs the CLI, asking you before anything touches your account.

```text
Set me up to build with the Klaviyo API. Read https://developers.klaviyo.com/llms.txt for Klaviyo's developer docs, then follow https://developers.klaviyo.com/en/docs/agent_setup.md to connect the Klaviyo MCP server (https://mcp.klaviyo.com/mcp) and install the Klaviyo CLI.
```

## Connect your agent to Klaviyo

Klaviyo's MCP server lets an agent work with the data in a Klaviyo account. Add the remote server at `https://mcp.klaviyo.com/mcp` to your MCP client. In Claude Code, run this command:

```bash
claude mcp add --transport http klaviyo https://mcp.klaviyo.com/mcp
```

[Set up the MCP server in another client](https://developers.klaviyo.com/en/docs/connect_to_the_klaviyo_mcp_server)

## Agent skills

Agent skills are step-by-step instructions that an AI coding agent such as Claude Code, Cursor or Codex follows to build on the Klaviyo API. Each one is a short SKILL.md that links to the reference and code files it needs, all in Markdown. Point your agent at the one that fits what you're building.

- [klaviyo-migrate-oauth](https://developers.klaviyo.com/.well-known/skills/klaviyo-migrate-oauth/SKILL.md): Use this skill when someone has an existing Klaviyo integration using a private API key and wants to migrate it to OAuth. Triggers when a user says things like "migrate my Klaviyo integration to OAuth", "convert from API key to OAuth", "I'm using Klaviyo-API-Key and need to switch to OAuth", "Klaviyo is requiring OAuth for the marketplace", or shares a codebase with Klaviyo-API-Key usage and asks how to convert it. Covers: auditing existing API key usage, mapping endpoints to OAuth scopes, creating the OAuth app, implementing PKCE, swapping auth headers, updating revision headers, and handling existing users through the transition.

- [klaviyo-new-oauth](https://developers.klaviyo.com/.well-known/skills/klaviyo-new-oauth/SKILL.md): Use this skill when someone is building a brand new Klaviyo integration using OAuth from scratch. Triggers when a user says things like "I want to integrate with Klaviyo", "help me build a Klaviyo OAuth app", "I need to connect my app to Klaviyo", "how do I set up Klaviyo OAuth", or shares a codebase and asks how to add Klaviyo as an integration. Covers: creating an OAuth app, selecting scopes, implementing the PKCE flow, token storage, making API calls with Bearer tokens, and revision header requirements.

- [klaviyo-onsite-forms](https://developers.klaviyo.com/.well-known/skills/klaviyo-onsite-forms/SKILL.md): Use this skill when someone with Klaviyo on a Vercel Shop or other headless storefront wants a Klaviyo signup form on it: "add a popup to my store", "create a Klaviyo flyout for 10% off", "change the popup copy", "publish the signup form", "take the popup down", or "why isn't my popup showing". Covers creating a popup, flyout, full-screen, banner or embedded form from an existing one, targeting it to only this storefront's hosts so other sites on the same Klaviyo account are untouched, editing its draft, publishing and unpublishing it, and checking it renders. Needs klaviyo.js already on the site, which klaviyo-vercel-shop adds.

- [klaviyo-store-analytics](https://developers.klaviyo.com/.well-known/skills/klaviyo-store-analytics/SKILL.md): Use this skill when someone with Klaviyo connected to their storefront asks how it's doing or wants a draft campaign from that data: "how many signups did the new storefront get", "which flows reached the most people last month", "rank our campaigns by click rate", "how much revenue came from email vs SMS", "how many shoppers used the shopping agent", or "draft a campaign for people who viewed but didn't buy". Covers read-only reporting through the Klaviyo MCP server (metric aggregates, campaign, flow, form and segment reports, profiles), questions specific to a Vercel Shop storefront's events and signup sources, and building segments, templates and campaigns as drafts that a person reviews and sends. Never sends anything.

- [klaviyo-vercel-shop](https://developers.klaviyo.com/.well-known/skills/klaviyo-vercel-shop/SKILL.md): Use this skill when someone wants to add Klaviyo to a Vercel Shop storefront (the Next.js and Shopify template from vercel.shop), or says "connect Klaviyo to my Vercel shop", "track product views and add to cart in Klaviyo", "add an email signup to my headless Shopify store", "add back in stock alerts", or "why aren't my storefront events showing up in Klaviyo". Covers connecting the Klaviyo account, adding consent-gated onsite tracking on the Hydrogen analytics bus, a footer signup form, back-in-stock alerts, identifying signed-in customers, a welcome flow, Vercel environment variables, and verifying events arrive. For Shop Agent, onsite forms or reporting, use klaviyo-vercel-shop-agent, klaviyo-onsite-forms or klaviyo-store-analytics after this one.

- [klaviyo-vercel-shop-agent](https://developers.klaviyo.com/.well-known/skills/klaviyo-vercel-shop-agent/SKILL.md): Use this skill when someone has Klaviyo on a Vercel Shop storefront and wants Shop Agent, the storefront's AI shopping assistant, to work with it: "let the shopping agent sign people up for back in stock", "have the AI assistant capture emails for sold-out sizes", "track Shop Agent in Klaviyo", or "segment shoppers who used the agent". Covers the notify-when-back-in-stock agent tool, the instruction that tells the agent when to offer it, the browser bridge that records a Used Shop Agent event and a Shop Agent user profile property, and verifying the conversation end to end. Needs klaviyo-vercel-shop applied first.


### Experimental skills

These skills are best effort and may change, so review what they produce. They aren't in the skills index, so installing from this site skips them: install one by name from `klaviyo-labs/skills` instead.

- [klaviyo-account-overview](https://developers.klaviyo.com/.well-known/skills/klaviyo-account-overview/SKILL.md): EXPERIMENTAL: preview skill, unsupported and may change. Onboarding tour of a newly connected Klaviyo account, covering what is set up, recent performance, three opportunities and one next step. Use when the user just connected Klaviyo, asks what it can do, or asks where to start. Not for a specific reporting question, such as ranking campaigns or comparing channels. Read-only. Requires the Klaviyo MCP server.

- [klaviyo-brand-voice](https://developers.klaviyo.com/.well-known/skills/klaviyo-brand-voice/SKILL.md): EXPERIMENTAL: preview skill, unsupported and may change. Capture a brand's voice, tone, messaging principles, style rules, and words to use or avoid as a reusable voice guide, then apply it whenever drafting or revising Klaviyo campaign, flow, SMS, or form copy. Use when the user asks to set up, document, or refine their brand voice, or asks for copy that "sounds like us". Never sends. Requires the Klaviyo MCP server.

- [klaviyo-insight-to-draft](https://developers.klaviyo.com/.well-known/skills/klaviyo-insight-to-draft/SKILL.md): EXPERIMENTAL: preview skill, unsupported and may change. Turn a finding already in the conversation into one approved draft change in Klaviyo: a segment plus draft campaign, revised campaign copy, or an edited flow message. Use when the user says "fix it", "set that up", "act on that", or "target the people who did X" right after a performance report or account overview surfaced a problem. Not for building a segment or campaign from scratch with no finding behind it. Never sends a campaign; its only send is a test email to an address the user confirms. Requires the Klaviyo MCP server.

- [klaviyo-product-data-model](https://developers.klaviyo.com/.well-known/skills/klaviyo-product-data-model/SKILL.md): Interview a user about their B2B product (businesses or accounts, the people who hold seats in them, business-level state like plan, seat limits and "sales contacted", and the events the product emits) and turn the answers into a Klaviyo data model: a Business custom object linked to seat profiles, plus one profile per business for business-level events. Also turn the situations the user wants to detect into segments and draft flows. Then create it in a Klaviyo account through the Klaviyo MCP. Use this whenever someone wants to model a B2B SaaS or PLG product in Klaviyo, set up custom objects for accounts, teams or workspaces, target "only seats at businesses over 90% of their limit" or "don't message businesses Sales contacted recently" audiences, send product-usage lifecycle email from Klaviyo, or demo Klaviyo for a non-retail product, even if they never say "custom object" or "data model". Also use it to draft or review such a spec or event catalog.
- [klaviyo-product-friction-analytics](https://developers.klaviyo.com/.well-known/skills/klaviyo-product-friction-analytics/SKILL.md): Build a product friction investigator on Klaviyo — instrument a web app to emit workflow and error events, stitch them to one profile and session, verify delivery, and visualize failure rate, affected users, failure reasons, and recovery in Grafana. Use when someone wants non-marketing product analytics on Klaviyo, wants to diagnose why users fail a core workflow (checkout, signup, booking, payment, upload), or asks to track error and recovery events with Klaviyo's Events API and build a dashboard on them.
- [klaviyo-weekly-brief](https://developers.klaviyo.com/.well-known/skills/klaviyo-weekly-brief/SKILL.md): EXPERIMENTAL: preview skill, unsupported and may change. One-minute weekly Klaviyo check-in that compares last week with the week before for campaigns and flows, names the biggest movers, and recommends one action. Use whenever someone asks for a weekly brief, how last week went, a Monday Klaviyo update, a recurring check-in, or whether a recent change worked. Not for other time windows or one-off reporting questions. Read-only. Requires the Klaviyo MCP server.


[All agent skills](https://developers.klaviyo.com/en/agents/skills)

## Files for agents

- [llms.txt](https://developers.klaviyo.com/llms.txt)
- [llms-full.txt](https://developers.klaviyo.com/llms-full.txt)
- [OpenAPI spec](https://raw.githubusercontent.com/klaviyo/openapi/2026-10-15/openapi/stable.json)
- [skills/index.json](https://developers.klaviyo.com/.well-known/skills/index.json)
- [mcp/server-card.json](https://developers.klaviyo.com/.well-known/mcp/server-card.json)
