What is the WP-CLI MCP server?
wp-cli-mcp is a Node.js MCP server that wraps WP-CLI so an AI tool can manage a WordPress install. Its tool table covers core, plugins, themes, posts, menus, users, options, media, database export and search replace, scaffolding for themes, plugins and blocks, and a raw command. It runs locally or over SSH.
wp-cli-mcp is a small Node.js server that exposes WP-CLI commands as MCP tools. Instead of typing wp commands, you describe the job and the AI tool picks the matching tool, such as listing plugins or creating a page.
Because it sits on WP-CLI, it needs no WordPress plugin on the site. It works against a local install through a path, or against a remote server through an SSH connection string.
What an agent can do with it
- Install, activate, deactivate and delete plugins and themes, and read or write theme files.
- Create, read, update and delete posts and post meta, terms, users, menus and menu items.
- Export the database, run a query, and run a dry run search and replace before applying it for a domain migration.
- Scaffold a theme, plugin or Gutenberg block.
- Run any other WP-CLI command through the raw tool.
Who it is for
Best for
- Developers who already live in WP-CLI and want a conversational layer on top.
- Agencies that manage remote servers over SSH and repeat the same maintenance steps.
Not for
- Shared hosts without WP-CLI or SSH access.
- Anyone who wants guardrails. The tool list includes wp_eval, a raw command tool and delete tools, and the README describes no confirmation or undo step.
Check the details before you trust it
The README headline says 45+ tools while its heading says 30+, and it does not state supported WordPress or WP-CLI versions. Read the tool table against your own needs and test on a staging copy first.
Use it with UiChemy
This server handles maintenance and scaffolding. UiChemy Composer writes HTML, CSS and JS for WordPress pages, and WP Block Theme Converter covers turning HTML into a block theme. Click Get Started on uichemy.com.
Connect WP-CLI MCP Server: Manage WordPress Through WP-CLI With AI to your AI client
npm install -g wp-cli-mcpInstall WP-CLI
The README requires WP-CLI in your PATH, a WordPress installation reachable locally or over SSH, and Node.js 18 or later.
Install the server
Run npm install -g wp-cli-mcp to put the wp-cli-mcp command on your PATH.
Set the target
Add the config to your MCP client with WP_PATH for a local site, or WP_SSH as user@host:/path for a remote one. WP_URL is for multisite.
Start with reads
Ask for the core version and plugin list first. Export the database before any change that touches content or search and replace.
Client configuration
{
"mcpServers": {
"wordpress": {
"command": "wp-cli-mcp",
"env": {
"WP_PATH": "/path/to/your/wordpress"
}
}
}
}Endpoints and ports
/var/www/htmlLocal WordPress pathuser@host:/path/to/wpSSH connection string for a remote sitehttps://example.comSite URL, used for multisiteWhat you can do with it
- Local or SSHOne environment variable switches between a local path and a remote server over SSH.
- Theme scaffoldingChild theme, plugin and block starters are generated with WP-CLI scaffold commands.
- Safe migration patternThe README example exports the database, previews search and replace as a dry run, applies it, then flushes cache.
- Menus and widgetsMenus, menu items, locations, sidebars and widgets can be listed or built.
- Post meta accessPost meta can be read, listed and updated alongside the post itself.
- Raw escape hatchwp_cli_raw runs any WP-CLI command that the named tools do not cover.
- No site pluginIt talks to WP-CLI, so nothing extra is installed on the WordPress site.
Tools it exposes
wp_core_version / wp_core_check_update
Read the core version and check for updates.
wp_plugin_list / wp_plugin_install / wp_plugin_activate / wp_plugin_deactivate / wp_plugin_delete / wp_plugin_search
Manage plugins.
wp_theme_list / wp_theme_install / wp_theme_activate / wp_theme_delete
Manage themes.
wp_theme_file_list / wp_theme_file_read / wp_theme_file_write / wp_theme_file_delete
Work with theme files.
wp_post_list / wp_post_get / wp_post_create / wp_post_update / wp_post_delete
Manage posts.
wp_menu_create / wp_menu_item_add / wp_menu_location_assign
Build navigation menus.
wp_db_query / wp_db_export / wp_search_replace
Database queries, export and search replace.
wp_scaffold_theme / wp_scaffold_plugin / wp_scaffold_block
Generate theme, plugin and block starters.
wp_eval
Execute PHP in the WordPress context.
wp_cli_raw
Run any WP-CLI command.
Frequently asked questions
What is wp-cli-mcp?
wp-cli-mcp is an MIT licensed Node.js MCP server that wraps WP-CLI. It gives an AI tool named tools for plugins, themes, posts, menus, users, options, the database and scaffolding, plus a raw command tool, against a local WordPress install or one reached over SSH.
How do I install the WP-CLI MCP server?
Run npm install -g wp-cli-mcp, then add a server entry to your MCP client with the command wp-cli-mcp and an env value WP_PATH pointing at your WordPress folder. You need WP-CLI in your PATH and Node.js 18 or later.
Can it manage a remote WordPress site?
Yes. Set WP_SSH to a user@host:/path string instead of WP_PATH and the commands run over SSH on that server. The README shows this as a separate configuration and lists WP_URL for multisite setups.
Does wp-cli-mcp need a WordPress plugin?
No. It drives WP-CLI directly, so the only requirements are WP-CLI, Node.js 18 and a WordPress installation it can reach. That keeps the site free of extra code but also means it has no capability checks of its own.
Is wp-cli-mcp safe to use on a live site?
The README documents delete tools, wp_eval and a raw command tool but describes no confirmation step or rollback. Use it on staging, export the database first and use an SSH account with limited rights before pointing it at production.
Can wp-cli-mcp build Gutenberg blocks?
It has a wp_scaffold_block tool that generates a block starter through WP-CLI, and the README example asks for a testimonial block. It does not edit existing block content, so see GravityKit Block MCP for block editor work.
Does it work with WooCommerce or Elementor?
The README can install WooCommerce through plugin tools and lists WooCommerce among its topics, but it has no store or page builder tools. For store data see WooCommerce MCP Server; the README also points to Elementor MCP.
Which AI tools can use wp-cli-mcp?
The README shows setup for Claude Code and describes the server as giving AI tools WordPress management. Its topics also list Cursor, and any client that can launch a stdio MCP server with environment variables should be able to run it.


