Environment

Setting Up Your Local WordPress AI Development Environment

⏱ 15 min

Everything in this track assumes WordPress 6.9 or later (for the Abilities API) and, from Course 5 onward, WordPress 7.0 or later (for the core PHP AI Client SDK entry point). This lesson gets a local environment running with both, plus the MCP Adapter plugin, so every later lesson can jump straight into code.

What you'll learn in this lesson
Pick a local environment tool
wp-env (official, CLI-based) versus a GUI tool like Local, and when each makes sense.
Get a WordPress 6.9+ site running locally
With WP-CLI available inside it.
Install the MCP Adapter plugin
From its GitHub repository, since it is not yet in the WordPress.org plugin directory as a stable release.
Verify the whole stack is wired up
Confirm the Abilities API and the MCP Adapter are both active before moving on.
Prerequisites

Node.js and npm (for wp-env) or Docker Desktop, and enough disk space for a local WordPress install. No existing WordPress experience required beyond basic wp-admin familiarity. Completing the previous lesson first is recommended but not required.

Step 1: Choose your local environment tool

You have two reasonable options. @wordpress/env (the wp-env CLI) is the official WordPress tool for this, it’s Docker-based, config-driven, and matches what WordPress core contributors use themselves, which makes it a safe default for this track. A GUI tool like Local by WP Engine works too and is friendlier if you’re not comfortable in a terminal, but the rest of this lesson assumes wp-env since its setup is scriptable and reproducible.

Step 2: Install and start wp-env

1
Install Node.js
wp-env requires Node.js. If you don't have it, install the current LTS release from nodejs.org before continuing.
2
Install wp-env globally
Run npm -g install @wordpress/env in your terminal.
3
Create a project folder
Make an empty directory for this track's work, e.g. wp-ai-course, and cd into it.
4
Add a .wp-env.json file
A minimal config pinning a recent WordPress core version is enough to start; wp-env defaults to the latest WordPress release if you omit a version.
5
Start the environment
Run wp-env start. The first run downloads WordPress and MySQL Docker images, so it can take a few minutes.

Once it finishes, wp-env start prints the local URLs for your site (typically http://localhost:8888) and the wp-admin login (admin / password by default).

Step 3: Confirm WordPress 6.9+ and the Abilities API

Run WP-CLI commands through wp-env’s wrapper:

# File: run from your project folder, after `wp-env start`
wp-env run cli wp core version
wp-env run cli wp eval 'var_dump( function_exists( "wp_register_ability" ) );'

The version command should report 6.9 or higher, and the second command should print bool(true). If wp-env pulled an older WordPress release, update core with wp-env run cli wp core update, then re-run the check.

Step 4: Install the MCP Adapter plugin

The MCP Adapter isn’t (yet) distributed as a packaged .zip on WordPress.org, install it from its GitHub repository into your local site’s plugins folder:

# File: from your project folder
cd wp-content/plugins
git clone https://github.com/WordPress/mcp-adapter.git
cd mcp-adapter
composer install

Then activate it, either from wp-admin’s Plugins screen, or from the CLI:

wp-env run cli wp plugin activate mcp-adapter
Keep it version-pinned

The MCP Adapter is under active development. For a course you’re following step by step, check out a specific commit or tagged release rather than tracking the default branch, so the exact CLI commands and class names in later lessons keep matching what you have installed.

Test it: verify the full stack

wp-env run cli wp plugin list --status=active

You should see mcp-adapter in the active plugins list. Then confirm its own WP-CLI commands are registered:

wp-env run cli wp mcp-adapter list --format=table

This lists any MCP servers currently registered, which will be empty until Course 2, but the command running without a “command not found” error confirms the plugin is correctly wired into WP-CLI.

If wp mcp-adapter list fails

Two likely causes: the plugin isn’t active (recheck Step 4), or composer install wasn’t run inside the plugin’s folder, the MCP Adapter depends on the wordpress/php-mcp-schema package and won’t load without its vendor/ directory present.

Recap

You now have a local WordPress 6.9+ site running under wp-env, with the Abilities API confirmed available and the MCP Adapter plugin installed and active. Nothing is registered yet, that starts in the next course, but your environment is ready for it.

Resources & further reading

← What Is the WordPress AI Stack? Abilities API, MCP Adapter & PHP AI Client SDK Explained Understanding Abilities: WordPress's New Way to Expose Site Actions →