MCP Integration Guide
Teams Included on the Teams plan. Not available on the Lite version. Upgrade →
Model Context Protocol (MCP) Integration
ABSPLITTEST integrates with the Model Context Protocol (MCP), allowing AI assistants like Windsurf, Claude Desktop, and Cline to create and manage your A/B tests directly.
What is MCP?
The Model Context Protocol is a standardized way for AI applications to interact with external tools and services. It enables AI assistants to perform actions on your behalf, like creating tests, viewing results, and managing campaigns.
Prerequisites
- WordPress 6.9 or higher
- ABSPLITTEST plugin installed and activated
- WordPress MCP Adapter plugin (installed manually, see Step 1)
- An MCP-compatible AI client (for example Claude Desktop, Claude Code, Cursor, Windsurf or Cline)
Quick Setup
Step 1: Install WordPress MCP Adapter
Go to AB Split Test → Settings → Developer and find MCP Integration (AI Assistants). If the adapter is missing, the section links to the latest release. Download the zip, go to Plugins → Add New Plugin, click Upload Plugin, choose the zip, click Install Now and then Activate Plugin.
Alternative Installation Methods:
# Via WP-CLI
wp plugin install https://github.com/WordPress/mcp-adapter/releases/latest/download/mcp-adapter.zip --activate
# Manual Download
# Visit https://github.com/WordPress/mcp-adapter/releases
Step 2: Create Application Password
- 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 3: Configure Your AI Client
The quickest way is on the same Developer tab: enter your username and Application Password, choose your client from the Your AI client dropdown (Windsurf IDE, Claude Desktop, Claude Code, Codex CLI, Cursor, Cline, OpenClaw or Hermes Agent) and click Copy. The configuration comes with your site address filled in. The examples below show the same setup by hand.
Windsurf IDE
Add to your .windsurf/mcp_config.json:
{
"mcpServers": {
"wordpress-yoursite": {
"command": "npx",
"args": ["-y", "@automattic/mcp-wordpress-remote@latest"],
"env": {
"WP_API_URL": "https://your-site.com/wp-json/mcp/mcp-adapter-default-server",
"WP_API_USERNAME": "your-username",
"WP_API_PASSWORD": "your-application-password"
}
}
}
}
Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json (Mac) or %APPDATA%/Claude/claude_desktop_config.json (Windows):
{
"mcpServers": {
"wordpress-yoursite": {
"command": "npx",
"args": ["-y", "@automattic/mcp-wordpress-remote@latest"],
"env": {
"WP_API_URL": "https://your-site.com/wp-json/mcp/mcp-adapter-default-server",
"WP_API_USERNAME": "your-username",
"WP_API_PASSWORD": "your-application-password"
}
}
}
}
Cline (VS Code Extension)
Add to your VS Code settings or Cline MCP configuration following the same pattern as above.
Available ABSPLITTEST Tools
Once configured, these tools are available to your AI assistant:
absplittest-create-test
Create new A/B tests with full configuration options.
// Example AI prompt:
"Create a magic test called 'Homepage Hero' to test the headline"
absplittest-duplicate-test
Copy an existing test’s settings, variations, goals, targeting and audiences into a new test. Results are not copied. The copy is a draft unless you ask for another status (a duplicated idea stays an idea).
// Example AI prompt:
"Duplicate test #123 so I can run it again"
absplittest-list-tests
List all A/B tests with their configurations and results.
// Example AI prompt:
"Show me all my active A/B tests"
absplittest-get-test-results
Get detailed results for a specific test.
// Example AI prompt:
"What are the results for test #123?"
absplittest-update-test-status
Change test status (publish, draft, pending, complete).
// Example AI prompt:
"Publish test #123"
absplittest-get-settings / absplittest-update-settings
From version 2.6.0, administrators can read and update every site-wide plugin setting through these tools - secrets are write-only and always returned masked. See Managing Plugin Settings via REST API, WP-CLI and MCP.
// Example AI prompts:
"Turn on heatmaps and set retention to 14 days"
"Add [email protected] to the winner notification emails"
Example Workflows
Create and Launch a Test
You: "Create a magic test for the homepage CTA button.
Test 'Buy Now' vs 'Get Started' vs 'Try Free'.
Track clicks on .cta-button and publish it."
AI: Creates test, configures conversion tracking, and publishes
Monitor Performance
You: "Show me all running tests and their conversion rates"
AI: Lists all published tests with current performance metrics
Optimize Based on Results
You: "Which variation is winning in test #123?
If it has statistical significance, pause the test."
AI: Analyzes results and updates test status accordingly
Troubleshooting
MCP Server Not Connecting
- Verify WordPress MCP Adapter is installed and activated
- Check Application Password is correct (no spaces)
- Ensure URL includes
/wp-json/mcp/mcp-adapter-default-server - Restart your AI client after configuration changes
Tools Not Appearing
- Confirm ABSPLITTEST plugin is active
- Check WordPress version is 6.9 or higher
- Verify user has
edit_postscapability
Authentication Errors
- Regenerate Application Password
- Check username is correct (case-sensitive)
- Ensure no special characters in password are escaped incorrectly
Security Best Practices
- Use Application Passwords, never your main WordPress password
- Create separate Application Passwords for each AI client
- Revoke unused Application Passwords regularly
- Use HTTPS for all connections
- Monitor API usage in WordPress admin