# Configure the Klaviyo MCP Server

Connect Klaviyo's official hosted MCP server to a Dtwo gateway via OAuth.

## Overview

Klaviyo operates an official hosted MCP server at `mcp.klaviyo.com` for campaigns, flows, profiles, lists and segments, templates, and reporting. Access is authorized through OAuth 2.1 with dynamic client registration, so there's no OAuth app to create in Klaviyo first — the gateway registers itself when a user authorizes.

## 1. Add the MCP server to your gateway config

Go to your gateway in the Dtwo UI and open **Configuration → Advanced**. In the `mcp_servers` section add the following entry:

```yaml
  - name: klaviyo
    description: "Klaviyo's official hosted MCP server for campaigns, flows, profiles, and reporting."
    url: https://mcp.klaviyo.com/mcp
    transport_type: streamablehttp
    authentication:
      type: oauth
      grant_type: authorization_code
      issuer: "https://mcp.klaviyo.com"
      redirect_uri: "<CALLBACK_URL>"
      dcr_enabled: true
      pkce_enabled: true
```

Replace the placeholder value:

- `<CALLBACK_URL>` — your Dtwo gateway's OAuth callback URL, found in the Overview tab for your gateway in the Dtwo UI.

Klaviyo doesn't use OAuth scopes for its MCP server, so the entry has none. To turn off every tool that writes to the Klaviyo account, set the `url` to `https://mcp.klaviyo.com/mcp?read-only=true`.

## 2. Deploy and verify

Save the configuration and deploy the gateway.

Then, in your AI client, ask it to authorize Klaviyo via the gateway. This opens the Klaviyo sign-in and consent screen — sign in as the user whose permissions the agent should inherit, and approve the consent prompt. Only Klaviyo users with an Owner, Admin, or Manager role can authorize the MCP server. Once authorized, confirm the server's tools appear and run a quick call, such as getting the account details or listing recent campaigns, to make sure the connection works.

If the tools don't appear after you authorize, refresh the tool list in your AI client — some clients don't pick it up automatically.

---

Having trouble? Email [support@dtwo.ai](mailto:support@dtwo.ai).