I wanted to hook up Claude Code to be able to interact with my local wordpress-develop core development environment via MCP (Model Context Protocol). I couldn’t find documentation specifically for doing this, so I’m sharing how I did it here.
Assuming you have set up the environment (with Docker) and started it via npm run env:start.
1. Install & Activate the MCP Adapter plugin
The MCP adapter is not currently available as a plugin to install from the plugin directory. You instead have to obtain it from GitHub and install it from the command line. I installed it as a plugin instead of as a Composer package:
cd src/wp-content/plugins
git clone https://github.com/WordPress/mcp-adapter
cd mcp-adapter
composer install
Next, activate the plugin. Naturally, you can also just activate the “MCP Adapter” plugin from the WP admin. You can also activate it via WP-CLI (but from the project root working directory, since you can’t run this command from inside of the mcp-adapter directory:
npm run env:cli -- plugin activate mcp-adapter
2. Register the MCP server with Claude
Here’s the command I used to register the wordpress-develop MCP server with Claude:
claude mcp add-json wordpress-develop --scope user '{"command":"npm", "args":["--prefix", "~/repos/wordpress-develop/", "run", "env:cli", "--", "mcp-adapter", "serve", "--server=mcp-adapter-default-server", "--user=admin"]}'
Here’s the JSON with formatting:
{
"command": "npm",
"args": [
"--prefix",
"~/repos/wordpress-develop/",
"run",
"env:cli",
"--",
"mcp-adapter",
"serve",
"--server=mcp-adapter-default-server",
"--user=admin"
]
}
You may want to remove --scope user if you just want to register the MCP server for the one project. I tend to re-use the same WP environment for multiple projects (core and plugins), so I think it may make it easier for me to install at the user level instead.
You will also need to change the --prefix arg’s ~/repos/wordpress-develop/ value to correspond to where the repo is actually cloned on your system. I include this arg here so that when I start claude inside of a plugin project (e.g. inside src/wp-content/plugins/performance), it is able to successfully run the npm command in the package.json in the ancestor directory. You can remove this --prefix arg if this is not relevant to you.
Change the user from admin according to your needs.
3. Expose all abilities to MCP
Registered abilities are not exposed to MCP by default. This is a safety measure so that AI agents have to be explicitly allowed to perform potentially sensitive actions. So without any plugins active other than the MCP Adapter, prompting Claude with “discover abilities” results in:
No abilities found. The MCP server connection may be unstable. Try reconnecting again with
/mcp.
However, since this is a local development environment, there is no concern about this (for me at least). To opt in all abilities to be exposed to MCP by default, you can use the following plugin code:
add_filter(
'wp_register_ability_args',
static function ( array $args ): array {
if ( wp_get_environment_type() === 'local' ) {
$args['meta']['mcp']['public'] = true;
}
return $args;
}
);
This is also available in a gist, to facilitate installation via Git Updater.
Note: This filter does not currently apply if your ability is registered by extending Abstract_Ability in the AI plugin.
At this point, I can now open Claude (or re-connect to the MCP server) and see that it is able to see all (er, most) abilities that are registered on my wordpress-develop env with the same prompt “discover abilities”:
3 WordPress abilities available:
core/get-environment-info — Returns runtime context (PHP, database, WordPress version) with the ability name.
core/get-site-info — Returns site information (all fields or filtered subset)
core/get-user-info — Returns current user profile details
When I prompt “what’s the environment info?” it executes the core/get-environment-info ability via MCP and prints out:
- Environment: local
- PHP Version: 8.3.26
- Database Server: 8.4.8 (MySQL)
- WordPress Version: 7.1-alpha-62161-src
Now the environment just needs more abilities! I’ve filed a Performance Lab issue for us at the Core Performance table to work on adding abilities during Contributor Day at WordCamp Asia tomorrow.
Where I’ve shared this:
The post Adding an MCP Server to the WordPress Core Development Environment appeared first on Weston Ruter.
Discover more from Complete Nursing Solution
Subscribe to get the latest posts sent to your email.
ProDentim is a modern oral-health supplement formulated with specialized probiotics and naturally sourced ingredients to help maintain firm teeth
ProDentim is a distinctive oral-care formula that pairs targeted probiotics with plant-based ingredients to encourage strong teeth, comfortable gums, and reliably fresh breath.
NerveCalm is a high-quality nutritional supplement crafted to promote nerve wellness, ease chronic discomfort, and boost everyday vitality.
AquaSculpt is a high-quality metabolic support supplement created to help the body utilize fat more efficiently while maintaining steady
GL Pro is a natural dietary supplement formulated to help maintain steady, healthy blood sugar levels while easing persistent sugar cravings.
PurDentix is a revolutionary oral health supplement designed to support strong teeth and healthy gums. It tackles a wide range of dental concerns, including gum inflammation and tooth decay
Backbiome is an advanced daily wellness supplement formulated to help support spinal comfort, reduce feelings of built-up tension, and promote freer, smoother movement throughout everyday life.
AquaSculpt is a high-quality metabolic support supplement created to help the body utilize fat more efficiently while maintaining steady
Boostaro is a modern mens wellness formula created to support daily vitality, stamina, and confidence through a practical, natural routine.
GL Pro is a natural dietary supplement formulated to help maintain steady, healthy blood sugar levels while easing persistent sugar cravings.
Backbiome is an advanced daily wellness supplement formulated to help support spinal comfort, reduce feelings of built-up tension, and promote freer, smoother movement throughout everyday life.
Alright, heard about pkrvipgames from a mate. Gave it a whirl and not bad at all! Games are decent enough, and the site’s pretty easy to get around. Could use a few more options, but I’m not complaining. Check it out for yourself! pkrvipgames
Needed to get on verabetlogin, and this site made it super easy. No messing about, straight to the point. Definitely a handy link to keep around if you’re a regular. Nice and simple. verabetlogin
30winbet anyone? Gave it a go, and it’s pretty standard stuff. If you’re looking for a new place to try your luck, it’s worth a punt. Just don’t go expecting miracles. More of the same. 30winbet
The CBD collection – [url=https://www.tillmanstranquils.com/products/relax-gummies ]cbd gummies calm[/url] offers a medley of formats that make appropriate different preferences, and each a certain feels grandly executed. The lubricant appears blameless and accordance, the packaging materials bear heavy-duty, and the connivance is simple besides elegant. The products are foolproof to store and treks with, thanks to sheltered lids and thick sizing. Entire, the label delivers a outstanding and carefully crafted sample without surplus extras.
The CBD amassment – https://www.tillmanstranquils.com/products/indica-gummies offers a assortment of formats that make appropriate singular preferences, and each a certain feels intimately executed. The lubricate appears clean and in conformance, the packaging materials feel durable, and the design is lucid besides elegant. The products are comfortable to assemble and travel with, thanks to obvious lids and thick sizing. Overall, the brand delivers a impeccable and carefully crafted feel without unnecessary extras.