# Optimizely MCP

> Optimizely connects your AI client directly to your product experimentation platform. List all projects, check experiment statuses, and toggle feature flags—all without logging into a dashboard. Use this server to audit audiences, manage live tests, or pause features instantly via natural conversation.

## Overview
- **Category:** data-analytics
- **Price:** Free
- **Tags:** ab-testing, feature-flags, experimentation, digital-experience, product-analytics

## Description

**Optimizely MCP Server: A/B Testing and Feature Flag Management.**

Forget logging into your dashboard just to check if an experiment is running or toggle a flag. This server connects your AI client straight into Optimizely, letting you audit your entire digital property stack using nothing but natural conversation. You can manage everything—from listing every single project you own to pausing live tests and checking audience definitions—without ever touching the platform UI.

### System Overview and Project Mapping

You need a clear map of what's running? This server gives it to you right out of the gate. It retrieves a full list of all Optimizely projects available in your account using `list_projects`. Need details on one specific workspace? Use `get_project` to pull all metadata for any given project.

### Experiment Management and Control

Managing tests shouldn't be a pain. You can get an immediate overview of multiple active or draft experiments across a whole project using `list_experiments`. For deep dives, use `get_experiment` to grab every detail on one specific test—you'll see its configuration, its current status, and how it’s set up.

When you need action, this server lets you control the rollout instantly. You can immediately pause an experiment using `pause_experiment`, stopping whatever active user traffic was hitting those tests. Conversely, if you want to restart a test that got stuck or needs a fresh run, just use `start_experiment`. These tools let you manage live tests and rollouts via chat.

### Feature Flag Management

Feature flags are key, but tracking them can be a mess. You can pull a list of every feature flag name available in your current project using `list_feature_flags` and then grab the full definition and status for any single flag with `get_feature_flag`. This lets you audit whether those flags are set up correctly before code hits production.

### Audience and Event Auditing (The Setup Check)

Before you deploy anything, you gotta make sure your tracking is solid. The server lists every defined user group or audience within a project using `list_audiences`. This lets you verify exactly who's being targeted for any given test. You can also list all configured conversion tracking events for the entire project via `list_events`, confirming that your setup can track what it needs to.

This server gives your agent direct access to audit every core resource—projects, feature flags, audiences, and conversion events. It lets you check experiment status or toggle a flag's operational state using natural talk. You don’t need tokens or complex API calls; you just ask your AI client what you want done.

## Tools

### get_experiment
Gets all details for one specific, named experiment.

### get_feature_flag
Gets the full definition and status of a single feature flag.

### get_project
Gets all metadata for one specific Optimizely project.

### list_audiences
Lists every defined user group or audience within a given project.

### list_events
Lists all configured conversion tracking events for the project.

### list_experiments
Lists multiple experiments in a project, giving an overview of their names and statuses.

### list_feature_flags
Lists every feature flag name available within the current project.

### list_projects
Retrieves a list of all Optimizely projects you own in your account.

### pause_experiment
Immediately sets a specified experiment's status to paused, stopping its active rollout.

### start_experiment
Restarts an experiment and sets its operational status back to running.

## Prompt Examples

**Prompt:** 
```
List all Optimizely projects in my account.
```

**Response:** 
```
I've retrieved 4 projects: 'Main Website', 'Mobile App iOS', 'Checkout Flow', and 'New Product Beta'. Which one would you like to explore?
```

**Prompt:** 
```
Check the status of all experiments in project 12345.
```

**Response:** 
```
There are 5 experiments in project 12345. 2 are currently running ('Hero Banner v2', 'Free Shipping Prompt'), 2 are paused, and 1 is in draft mode.
```

**Prompt:** 
```
Pause experiment 67890 in project 12345.
```

**Response:** 
```
Experiment 67890 ('Hero Banner v2') has been successfully paused.
```

## Capabilities

### Audit and list core resources
The agent can pull lists of every project, feature flag, audience, and conversion event in your account.

### Check experiment status and details
You get detailed information on any specific experiment—like its configuration or current running state—using `get_experiment`.

### Control feature flag rollout
The agent lets you check flag definitions (`get_feature_flag`) and change the operational status of an experiment using tools like `start_experiment` or `pause_experiment`.

### Identify all projects
You can list every Optimizely project available, getting a quick overview of your entire digital property map.

### View tracking definitions
The system lists defined audiences and conversion events so you can verify that your targeting setup is solid before launching code.

## Use Cases

### Hotfix: An experiment is breaking the checkout flow.
The QA lead notices a critical bug in 'Checkout v3'. Instead of waiting for an engineer to log into the console, they prompt their agent: 'Pause experiment 789.' The agent executes `pause_experiment`, instantly taking the faulty test out of circulation. Problem solved.

### Pre-launch audit of tracking data.
The Data Scientist needs to confirm that the 'Subscription Complete' event is tracked correctly for a new campaign. They use `list_events` and then `get_project` on the main website project to verify the exact definition, ensuring no gaps in reporting.

### Project Scoping: What projects do we even have?
The Product Manager starts a new quarter and needs an inventory of all possible deployment targets. They ask their agent to run `list_projects`. The agent returns the names, allowing them to scope out which flag definitions or experiments they need to focus on.

### Testing Flag Dependency: Does Feature X exist?
Before coding a new page element, an engineer needs to know if 'Beta Widget' is already controlled by a flag. They ask the agent to run `list_feature_flags` in that project. The immediate list response confirms its existence or lack thereof.

## Benefits

- Stop guessing if a test is live. Use `list_experiments` to see the names and current status of every A/B test in a project at a glance.
- Rollback features instantly. Need to stop an experiment? Running `pause_experiment` cuts off traffic immediately, giving you time to fix the issue without manual clicks.
- Verify your targeting setup before launch. Calling `list_audiences` and `list_events` confirms that all necessary user groups and conversion points are defined correctly.
- See the full story behind a flag. Instead of just knowing a feature exists, running `get_feature_flag` shows you its exact definition and associated project metadata.
- Map your whole workspace. Use `list_projects` to see every Optimizely site or app connected under one roof, giving you total visibility over all deployments.

## How It Works

The bottom line is, your AI client uses these tools to talk to Optimizely and execute specific actions or fetch structured data based on simple prompts.

1. First, subscribe to the Optimizely server and provide it with your Personal Access Token.
2. Next, ask your AI client for a list of projects or experiments. The agent uses the relevant listing tool (e.g., `list_projects`) to fetch the data.
3. Finally, you tell the agent what to do—like 'Pause experiment 123'—and it executes the state-changing function (`pause_experiment`).

## Frequently Asked Questions

**How do I list all my projects using the Optimizely MCP Server?**
You run `list_projects`. This tool fetches every single project available in your account, giving you a master inventory of everything connected to Optimizely.

**Can I check if an experiment is running with the get_experiment tool?**
Yes. Use `get_experiment` and provide the experiment ID. The detailed metadata returned will include its current status, telling you whether it’s active or paused.

**What's the difference between list_feature_flags and get_feature_flag?**
`list_feature_flags` gives you a quick index of every flag name in the project. You must then use `get_feature_flag` with that specific name to pull its full definition, status, and details.

**Does list_audiences help me validate my tracking?**
Yes. By listing audiences, you verify that the target user segments (like 'Paid US Users') are defined correctly and ready to be used for testing or targeting purposes.

**How do I change the status of an experiment using the `pause_experiment` tool?**
You call `pause_experiment` with the target experiment's ID. This action immediately sets its status to paused, stopping all traffic and data collection for that specific test run.

**If I use `get_feature_flag`, what metadata does it return about the flag?**
The tool provides core details like the feature name, ID, and current status. This includes knowing which project the flag belongs to, so you don't have to guess its scope.

**What should I do if the `list_experiments` tool returns zero results?**
Zero results mean no experiments are configured in that specific project. You need to check your project ID or confirm that an active experiment hasn't been deleted yet.

**How is the data from `list_events` different from what `list_audiences` provides?**
The `list_events` tool shows defined conversion goals—what actions users took. `list_audiences` lists groups of users based on those events; it defines *who* did it.

**Where do I find my Personal Access Token?**
In Optimizely, go to **Profile Settings** > **API Access** and generate a new Personal Access Token. Ensure it has the necessary permissions for the projects you want to manage.

**Can I start an experiment that is in draft mode?**
Yes, using the `start_experiment` tool will attempt to set the status to 'running'. However, Optimizely requires the experiment to be valid and fully configured before it can transition from draft to running.

**How do I find my Project ID?**
You can use the `list_projects` tool to see all projects associated with your account along with their IDs. You can also find it in the URL when viewing a project in the Optimizely dashboard.