Connect AI to Your A/B Tests
Use the Model Context Protocol (MCP) to manage experiments, analyze results, and automate your testing workflow from Claude Code, Claude Desktop, or ChatGPT. MCP access is currently in private beta.
What is MCP?
The Model Context Protocol (MCP) is an open standard that lets AI assistants connect to external tools and data sources. Instead of copy-pasting API responses, your AI assistant can directly manage your Otter A/B experiments.
Conversational
Ask in plain English: "Create a redirect test on the pricing page" and the AI handles the API calls.
Same API Key
Use the same account-scoped API key you already created for the REST API. No additional auth needed.
Scoped & Safe
API key scopes and project restrictions apply to MCP too. Read-only keys stay read-only.
Prerequisites
Before connecting MCP, you need an Otter A/B API key.
Create an API key
Go to Settings → API & MCP in your Otter A/B dashboard and create a new API key. Select the scopes you want the AI assistant to have access to.
Open SettingsCopy the token
The full token (e.g. oab_live_abc123_sk_...) is only shown once. Store it in a safe place.
Choose recommended scopes
For full MCP functionality, we recommend these scopes:
For read-only access (results inspection only), use: projects:read, experiments:read, results:read
Claude Code
Connect Otter A/B to Claude Code (the CLI) once MCP beta access has been enabled for your account.
Confirm beta access
The public npm package is not published yet. After Otter A/B enables MCP for your account, copy the exact install command from Settings → API & MCP or your beta invite:
# After beta access is enabled:
# copy the exact command from Settings → API & MCP
claude mcp add otterab -- <command provided by Otter A/B>Set your API key
Set the API key as an environment variable. You can do this globally or per-project:
# Option A: Set in your shell profile (~/.zshrc or ~/.bashrc)
export OTTERAB_API_KEY="oab_live_abc123_sk_9f8e7d..."
# Option B: Add to your project's .claude/settings.json
claude mcp add otterab -e OTTERAB_API_KEY=oab_live_abc123_sk_9f8e7d... -- <beta command from Otter A/B>Start using it
Open Claude Code and start asking about your experiments:
> claude
You: List my running experiments on the Marketing Site project
Claude: I found 3 running experiments on "Marketing Site":
1. Pricing Hero Test - running since March 15
2. Homepage CTA Color - running since March 20
3. Nav Redesign v2 - running since March 25
You: How is the Pricing Hero Test performing?
Claude: The "Pricing Hero Test" is performing well:
- Control: 8.36% conversion rate (1,412 visitors)
- Clearer Headline: 10.72% conversion rate (1,408 visitors)
- Improvement: +28.2% with 96.1% confidence
The "Clearer Headline" variant is winning with statistical significance.Claude Desktop & Cowork
Connect Otter A/B to Claude Desktop or Claude Cowork after Otter A/B enables your private beta access.
Open Claude Desktop settings
Open Claude Desktop and navigate to Settings → Developer → Edit Config. This opens your claude_desktop_config.json file.
Add the beta MCP server configuration
Add the command details from Settings → API & MCP or your beta invite to the config file:
{
"mcpServers": {
"otterab": {
"command": "<provided after beta enablement>",
"args": ["<provided after beta enablement>"],
"env": {
"OTTERAB_API_KEY": "oab_live_abc123_sk_9f8e7d..."
}
}
}
}Restart Claude Desktop
Fully quit and reopen Claude Desktop. You should see the Otter A/B tools available in the tools menu (hammer icon).
Start a conversation
Ask Claude to interact with your experiments:
"Show me the results for my pricing page experiment"
"Create a redirect test that sends /pricing traffic to /pricing-v2"
"Pause the Homepage CTA experiment"
ChatGPT
Connect Otter A/B to ChatGPT using the private beta MCP bridge setup or the public REST API.
Install the MCP bridge
ChatGPT supports MCP servers through a local bridge. Install it globally:
npm install -g @anthropic-ai/mcp-chatgpt-bridgeConfigure the private beta server
Use the MCP command Otter A/B shares after your account is enabled:
{
"servers": {
"otterab": {
"command": "<provided after beta enablement>",
"args": ["<provided after beta enablement>"],
"env": {
"OTTERAB_API_KEY": "oab_live_abc123_sk_9f8e7d..."
}
}
}
}Alternative: Direct REST API
You can also use the Otter A/B REST API directly with ChatGPT Actions or custom GPTs. Point the action schema at the API base URL and provide your bearer token:
# ChatGPT Action configuration
openapi: "3.1.0"
info:
title: Otter A/B API
version: v1
servers:
- url: https://www.otterab.com/api/v1
paths:
/projects:
get:
operationId: listProjects
summary: List all projects
security:
- bearerAuth: []
/projects/{project_id}/experiments:
get:
operationId: listExperiments
summary: List experiments for a project
parameters:
- name: project_id
in: path
required: true
schema:
type: string
security:
- bearerAuth: []
components:
securitySchemes:
bearerAuth:
type: http
scheme: bearerAvailable Tools
Private beta MCP access exposes 17 tools organized by category. Each tool maps to a customer job, not a raw CRUD operation.
Projects
list_projectsprojectsList all projects accessible to this API key.
get_projectprojectsGet details for a specific project by ID.
create_projectprojectsCreate a new project with a name, URL, and platform.
Experiments
list_experimentsexperimentsList experiments for a project, optionally filtered by status.
get_experimentexperimentsGet full experiment details including variants, goals, and targeting.
create_experiment_draftexperimentsCreate a new experiment with variants, goals, and targeting in one call.
update_experiment_draftexperimentsUpdate a draft experiment. Replaces variants and goals.
start_experimentexperimentsStart a draft experiment. Requires 2+ variants and 1+ goals.
pause_experimentexperimentsPause a running experiment.
resume_experimentexperimentsResume a paused experiment.
complete_experimentexperimentsComplete a running or paused experiment.
archive_experimentexperimentsArchive a completed experiment.
quick_create_redirect_experimentexperimentsOne-step creation of a redirect experiment with source URL, redirect URL, and goal.
quick_create_visual_experimentexperimentsOne-step creation of a visual experiment with element changes and goal.
Results
get_experiment_resultsresultsGet results for an experiment across all goals with optional segment filters.
analyze_experimentresultsGet an AI-friendly summary of experiment results for the primary goal.
Account
list_targeting_fieldsaccountList available targeting fields and operators for building rules.
Usage Examples
Here are common workflows you can accomplish with the MCP integration.
Create a redirect experiment
Ask your AI assistant in natural language:
"Create a redirect experiment on the pricing page that sends half of traffic to /pricing-v2 and measures signup completion."
The AI calls:
{
"tool": "quick_create_redirect_experiment",
"input": {
"project_id": "42",
"name": "Pricing V2 Redirect Test",
"source_url": "https://example.com/pricing",
"redirect_url": "https://example.com/pricing-v2",
"goal": {
"goal_type": "pageview",
"name": "Signup Complete",
"config": { "url": "https://example.com/signup/success" }
}
}
}Analyze experiment results
Ask for a results breakdown:
"How is the Homepage CTA experiment performing? Show me the results by country."
The AI calls:
{
"tool": "get_experiment_results",
"input": {
"project_id": "42",
"experiment_id": "92",
"segment": { "country": "US" }
}
}Manage experiment lifecycle
Control experiments with simple commands:
"Pause the pricing test"
"Resume the nav redesign experiment"
"Complete the homepage CTA test and show me the final results"
The AI calls the appropriate lifecycle tool:
{
"tool": "complete_experiment",
"input": {
"project_id": "42",
"experiment_id": "92"
}
}Troubleshooting
Common issues and how to resolve them.
"Tools not showing up in Claude Desktop"
Make sure you fully quit and reopened Claude Desktop after editing the config. Check that the config file is valid JSON and that you copied the beta command exactly as shown in Settings → API & MCP.
"Authentication failed" or "invalid_api_key"
Double-check your API key is correct and not revoked. Make sure the OTTERAB_API_KEY environment variable is set. Keys starting with oab_test_ only work with test data.
"Missing required scope"
Your API key doesn't have the required scopes for that action. Create a new key with the needed scopes in Settings > API & MCP.
"Rate limit exceeded"
You've hit your plan's API rate limit. Wait a minute and try again, or upgrade your plan for higher limits. Starter: 100/min, Growth: 500/min, Scale: 2,000/min.
"npx command not found"
Make sure Node.js (v18+) is installed. The beta MCP command may rely on npm/npx, depending on the package Otter A/B enabled for your account.
Still stuck?
Contact us at support@otterab.com with your error message and we'll help you get connected.