Optimizely Experimentation MCP server example prompts

  • Updated
  • Optimizely Web Experimentation
  • Optimizely Personalization
  • Optimizely Feature Experimentation
  • Optimizely Performance Edge

The Optimizely Experimentation Model Context Protocol (MCP) server responds to natural language. You do not need to know tool names, API parameters, or query syntax. Describe what you want and your agent figures out which tools to call.

This page organizes prompts by use case. Each example includes the prompt you would type and a brief description of what happens behind the scenes.

Get started

The following prompts help you orient yourself when you first connect:

  • List my Optimizely projects – Returns all projects your account has access to, with names, IDs, and status.
  • What entities can I query? – Lists the entity types the MCP server supports (projects, flags, experiments, audiences, environments, and so on).

Query experiments and flags

The most common use case is asking questions about what is running, what is stale, and how your program is structured. See Stale in the Flag statuses in Feature Experimentation documentation.

List and filter

Use the following prompts to list and filter experiments and flags in your project:

  • Show me all running experiments in the Storefront project – Returns active experiments with key details like name, status, start date, and traffic allocation.
  • Which flags have not been modified in 90 days? – Finds stale flags that may be candidates for cleanup or archival.
  • List all experiments using the "mobile-users" audience – Searches across experiments to find which ones target a specific audience.

Compare and analyze

Use the following prompts to compare configurations and analyze program-level data:

  • How many experiments did we launch last quarter versus this quarter? – Counts experiments by creation date to show program velocity over time.
  • Show me flags in the Storefront project that are different between staging and production – Compares flag configurations across environments to surface inconsistencies. Useful before a release or when debugging environment-specific behavior.
  • What audiences are used in running experiments? – Lists the audiences actively in use, helping you understand your current targeting patterns.

Experiment results

Pull performance data and check statistical significance without opening the Optimizely UI.

  • What are the results for the homepage-hero experiment? – Retrieves performance data for a specific experiment, including metrics, variation performance, and statistical significance indicators.
  • Is the checkout-flow test statistically significant yet? – Returns the current state of statistical significance for each metric in the experiment.
  • What are our top experiments this month? – Summarizes program-level performance, highlighting experiments with the strongest results.
  • What is our overall experiment win rate this quarter? – Calculates the ratio of experiments that reached statistical significance with a positive result, giving you a program health metric.

SDK and implementation

Get implementation help directly in your editor, particularly for developers new to Optimizely or working with an SDK they have not used before.

  • I am new to Optimizely. Help me get started with the React SDK. – Searches SDK documentation and walks you through the setup process: installation, initialization, and evaluating your first flag.
  • Show me how to evaluate a feature flag in Python – Returns Python-specific code examples for flag evaluation, including type-safe variations and fallback handling.
  • What is the correct way to initialize the JavaScript SDK? – Provides initialization code with best practices: datafile management, SDK key configuration, and event dispatching.
  • How do I track custom events in the Go SDK? – Returns Go SDK documentation for event tracking, including the track API and user context setup.

Create flags and experiments

Use the following prompts to create flags, experiments, and audiences in your project:

  • Create a new feature flag called checkout-redesign with boolean variations – Creates the flag in your project with on and off variations. The agent confirms the target project and environment before making changes.
  • Set up an A/B test on the new pricing page with 50/50 traffic split – Creates an experiment with two variations and configures the traffic allocation. The agent walks you through each step, confirming the flag, variations, and targeting before committing.
  • Create an audience for users in the US who visited the pricing page – Creates a new audience with the specified conditions. The agent confirms the attribute names and condition logic before saving.

Flag cleanup

Use the following prompts to find and clean up stale flags:

  • Find stale flags in my project and give me a cleanup plan – Identifies flags that have not been modified recently, checks whether they are referenced in running experiments, and produces a prioritized cleanup plan.
  • Clean up the old-nav-header flag, we rolled it out months ago – Looks up the flag's current state and checks which variation is serving 100% of traffic. If you are working in an AI-powered code editor such as Cursor or Visual Studio Code, the agent can also search your local codebase for references to the flag key. No code is sent to Optimizely. Instead the search uses your editor's file access. The agent presents a step-by-step removal plan and archives the flag in Optimizely after you confirm.

Multi-step workflows

MCP works well when you chain prompts together. Your agent maintains context within a conversation, so each prompt builds on the last.

Workflow 1: Experiment audit

Start broad, then narrow down to what matters.

  • Show me all experiments that have been running for more than 30 days – The agent returns a list of long-running experiments with their start dates and current status.
  • Which of those have reached statistical significance? (continuing from the previous result) – The agent filters the previous list down to experiments where at least one metric has reached significance.
  • Summarize the results for the significant ones – The agent pulls results for each significant experiment and presents a summary table with metrics, lift, and confidence levels.

Workflow 2: New feature setup

Go from zero to a running flag in your staging environment.

  • Create a feature flag for the new search algorithm – The agent creates the flag in your project and confirms the name, key, and variations before proceeding.
  • Set it up with a 10% rollout in staging – The agent creates a rollout rule in the staging environment with 10% traffic allocation.
  • Generate the React code to evaluate this flag in my SearchResults component – The agent generates a code snippet using the React SDK, referencing the flag key and variation types from the flag you just created.

Tips for better results

Be specific about scope

Show me experiments in the Storefront project works better than show me my experiments. When you name the project, the agent does not have to guess which one you mean.

Use natural language

You do not need to know tool names or API parameters. Which flags are different between staging and production? is a valid query.

Reference entities by name or ID

Both work. Results for the homepage-hero experiment and Results for experiment 12345 are equally valid.

Ask follow-up questions

Your agent remembers context within a conversation. After getting a list of experiments, you can ask about a specific one without repeating the full context.

Chain prompts for complex tasks

Start with a broad query, then refine. This is often faster and more accurate than trying to get everything in a single prompt.