Get the FREE Ultimate OpenClaw Setup Guide →

Klaviyo -Enhanced

Klaviyo MCP Server Enhanced with better reporting and analytics

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio ivan-rivera-projects-klaviyo-mcp-server-enhanced node src/server.js \
  --env LOG_FILE="/tmp/klaviyo-mcp.log" \
  --env NODE_ENV="development" \
  --env LOG_LEVEL="info" \
  --env KLAVIYO_API_KEY="your_private_api_key_here"

How to use

Klaviyo MCP Server Enhanced provides a comprehensive interface to the Klaviyo API via the MCP protocol. It includes analytics and reporting capabilities such as campaign performance metrics (open rates, click rates, bounce rates), custom metric aggregation, revenue attribution, and subscriber insights. The server exposes tools for retrieving campaigns, individual campaign messages, and aggregated analytics, with enhanced caching, rate-limit handling, and robust error management to ensure resilient operation when integrating with Claude or other LLMs. To interact with the server, you can start it in development or production mode and use the MCP Inspector or in-application calls to access tools like get_campaign_metrics, query_metric_aggregates, get_campaign_performance, get_campaigns, get_campaign, and get_campaign_message among others. Ensure your Klaviyo API key is provided via environment variables and that the server is configured to the correct API revision (2024-06-15).

How to install

Prerequisites:

  • Node.js v18+ (as recommended by the project)
  • npm (comes with Node.js)

Installation steps:

  1. Clone the repository: git clone https://github.com/ivan-rivera-projects/Klaviyo-MCP-Server-Enhanced.git cd Klaviyo-MCP-Server-Enhanced

  2. Install dependencies: npm install

  3. Create an environment file based on the example (if provided) and configure your Klaviyo API key: cp .env.example .env

    Edit .env to add:

    KLAVIYO_API_KEY=your_private_api_key_here

    LOG_LEVEL=info

    LOG_FILE=/tmp/klaviyo-mcp.log

  4. Start the server (development): npm run dev

  5. Start the server (production): npm start

Optional: Test with MCP Inspector if available in your setup: npm run inspect

Additional notes

Tips and caveats:

  • You must provide a valid Klaviyo API key with appropriate scopes (campaigns:read, metrics:read, etc.).
  • The server uses a centralized configuration system for API parameters and the revision date (2024-06-15); adjust values in src/config.js if needed.
  • The startup section mentions occasional JSON parsing warnings when Claude Desktop connects; these are normal during initial handshake and should not affect operation.
  • Logs are masked to protect sensitive data; you can customize log destinations and verbosity through environment variables or config.
  • If you hit rate limits, the server includes exponential backoff with jitter and retry logic to gracefully degrade or retry requests.
  • For debugging, increase LOG_LEVEL to debug and monitor /tmp/klaviyo-mcp.log or your configured log destination.

Related MCP Servers

Sponsor this space

Reach thousands of developers