MCP Integration Guide

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 automatically via settings)
  • An MCP-compatible AI client (Windsurf, Claude Desktop, or Cline)

Quick Setup

Step 1: Install WordPress MCP Adapter

Go to Settings → AB Split Test → MCP Integration and click the “Install WordPress MCP Adapter Now” button. The plugin will be automatically downloaded, installed, and activated.

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

  1. Go to Users → Profile
  2. Scroll to Application Passwords section
  3. Enter a name (e.g., “Windsurf MCP”)
  4. Click Add New Application Password
  5. Copy the generated password (you won’t see it again!)

Step 3: Configure Your AI Client

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-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).

// Example AI prompt:
"Publish test #123"

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_posts capability

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

See Also

Leave a Comment

You must be logged in to post a comment.