MCP Integration (AI Assistants)
Connect AI assistants like Claude Desktop, OpenClaw, ChatGPT and more to create, manage and analyze your A/B tests directly.
⚠️ WordPress MCP Adapter Required
The WordPress MCP Adapter plugin is not installed.
To use the MCP integration with AB Split Test, install and activate the WordPress MCP Adapter plugin first.
Step 1: Install WordPress MCP Adapter Plugin
- Get the WordPress MCP Adapter from its releases page on GitHub (download the zip)
- Go to Plugins → Add New Plugin and click Upload Plugin
- Choose the zip, click Install Now, then Activate Plugin
- Come back to this tab for the connection steps
Requirements: WordPress 6.9 or higher
The WordPress MCP Adapter is active and ready to use. AB Split Test tools are now available via MCP.
Step 1: Create WordPress Application Password
AI clients need authentication to access your WordPress site:
- Go to Users → Profile
- Scroll to Application Passwords section
- Enter a name (e.g., "Windsurf MCP")
- Click Add New Application Password
- Copy the generated password (you won't see it again!)
Step 2: Configure Your AI Client
; fragments are escaped as they are concatenated. The
// only raw HTML is the two placeholder spans the config JS rewrites live.
$abst_mcp_url = rest_url( 'mcp/mcp-adapter-default-server' );
$abst_mcp_user_span = '
' . esc_html( wp_get_current_user()->user_login ) . '';
$abst_mcp_pass_span = '
YOUR_APPLICATION_PASSWORD';
$abst_mcp_json = function( $root ) use ( $abst_mcp_url, $abst_mcp_user_span, $abst_mcp_pass_span, $mcpServerName ) {
return "{\n"
. ' "' . esc_html( $root ) . "\": {\n"
. ' "' . esc_html( $mcpServerName ) . "\": {\n"
. " \"command\": \"npx\",\n"
. " \"args\": [\"-y\", \"@automattic/mcp-wordpress-remote@latest\"],\n"
. " \"env\": {\n"
. ' "WP_API_URL": "' . esc_html( $abst_mcp_url ) . "\",\n"
. ' "WP_API_USERNAME": "' . $abst_mcp_user_span . "\",\n"
. ' "WP_API_PASSWORD": "' . $abst_mcp_pass_span . "\"\n"
. " }\n }\n }\n}";
};
$abst_mcp_clients = array(
'windsurf' => array(
'title' => 'Windsurf IDE',
'intro' => 'Add to your
.windsurf/mcp_config.json:',
'code' => $abst_mcp_json( 'mcpServers' ),
),
'claude' => array(
'title' => 'Claude Desktop',
'intro' => 'Add to your Claude Desktop config file.
Windows: %APPDATA%\Claude\claude_desktop_config.jsonmacOS: ~/Library/Application Support/Claude/claude_desktop_config.json',
'code' => $abst_mcp_json( 'mcpServers' ),
),
'claude_code' => array(
'title' => 'Claude Code',
'intro' => 'Run once in your terminal (from any directory):',
'code' => 'claude mcp add ' . esc_html( $mcpServerName ) . ' \\' . "\n"
. ' --env WP_API_URL=' . esc_html( $abst_mcp_url ) . ' \\' . "\n"
. ' --env WP_API_USERNAME=' . $abst_mcp_user_span . ' \\' . "\n"
. ' --env WP_API_PASSWORD=' . $abst_mcp_pass_span . ' \\' . "\n"
. ' -- npx -y @automattic/mcp-wordpress-remote@latest',
),
'codex' => array(
'title' => 'Codex CLI (OpenAI)',
'intro' => 'Add to
~/.codex/config.toml:',
'code' => '[mcp_servers.' . esc_html( str_replace( '-', '_', $mcpServerName ) ) . "]\n"
. "command = \"npx\"\n"
. "args = [\"-y\", \"@automattic/mcp-wordpress-remote@latest\"]\n"
. "\n"
. '[mcp_servers.' . esc_html( str_replace( '-', '_', $mcpServerName ) ) . ".env]\n"
. 'WP_API_URL = "' . esc_html( $abst_mcp_url ) . "\"\n"
. 'WP_API_USERNAME = "' . $abst_mcp_user_span . "\"\n"
. 'WP_API_PASSWORD = "' . $abst_mcp_pass_span . '"',
),
'cursor' => array(
'title' => 'Cursor',
'intro' => 'Add to
~/.cursor/mcp.json (or
.cursor/mcp.json inside a project):',
'code' => $abst_mcp_json( 'mcpServers' ),
),
'cline' => array(
'title' => 'Cline (VS Code Extension)',
'intro' => 'Add to Cline\'s MCP settings file (
~/.cline/mcp.json, or the MCP settings JSON in the extension):',
'code' => $abst_mcp_json( 'mcpServers' ),
),
'openclaw' => array(
'title' => 'OpenClaw',
'intro' => 'Add to
~/.openclaw/openclaw.json (note the nested
mcp.servers shape), then restart the gateway:',
'code' => "{\n"
. " \"mcp\": {\n"
. " \"servers\": {\n"
. ' "' . esc_html( $mcpServerName ) . "\": {\n"
. " \"command\": \"npx\",\n"
. " \"args\": [\"-y\", \"@automattic/mcp-wordpress-remote@latest\"],\n"
. " \"env\": {\n"
. ' "WP_API_URL": "' . esc_html( $abst_mcp_url ) . "\",\n"
. ' "WP_API_USERNAME": "' . $abst_mcp_user_span . "\",\n"
. ' "WP_API_PASSWORD": "' . $abst_mcp_pass_span . "\"\n"
. " }\n }\n }\n }\n}",
),
'hermes' => array(
'title' => 'Hermes Agent (Nous Research)',
'intro' => 'Add under the top-level
mcp_servers key in
~/.hermes/config.yaml, then run
/reload-mcp or restart:',
'code' => "mcp_servers:\n"
. ' ' . esc_html( $mcpServerName ) . ":\n"
. " command: \"npx\"\n"
. " args: [\"-y\", \"@automattic/mcp-wordpress-remote@latest\"]\n"
. " env:\n"
. ' WP_API_URL: "' . esc_html( $abst_mcp_url ) . "\"\n"
. ' WP_API_USERNAME: "' . $abst_mcp_user_span . "\"\n"
. ' WP_API_PASSWORD: "' . $abst_mcp_pass_span . '"',
),
);
foreach ( $abst_mcp_clients as $abst_mcp_key => $abst_mcp_client ) :
?>
array( 'class' => true ) ) );
?>
Step 3: Copy Configuration & Connect
Your configuration is ready to use:
- Copy the configuration for your AI client (Windsurf, Claude Desktop, Claude Code, Codex, Cursor, Cline, OpenClaw or Hermes) from below
- Paste it into your MCP client's configuration file
- Restart your MCP client to load the new configuration. Load a new conversation, as old conversations generally cache the previous configuration
- The AB Split Test tools should appear in your AI assistant's available tools
- Try asking: "List all my A/B tests" or "Create a test of the home page against the new landing page we just generated, conversion is reaching the thank-you page"
Example: Ask Your AI Assistant
Create a Magic Test:
"Create a magic A/B test called 'Homepage Headline Test' that tests the h1 element against a new headline, 'Start Free Today'. Count a visit to the thank-you page as the conversion."
List Tests:
"Show me all my A/B tests"
Get Results:
"Get the results for test ID 3504"
Troubleshooting
- Tools not appearing: Make sure WordPress MCP Adapter plugin is installed and activated
- Authentication errors: Verify your Application Password is correct (no spaces)
- Connection errors: Check that your WordPress site URL is correct and accessible
- Minimum WordPress 6.9: The Abilities API is only available in WordPress 6.9+ and requires MCP adapter plugin to function.