Get the FREE Ultimate OpenClaw Setup Guide →

ai-command

Control WordPress using WP-CLI, AI, and MCP.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio mcp-wp-ai-command node path/to/server.js \
  --env WP_HOST="WordPress host (e.g., https://example.com)" \
  --env WP_USER="WordPress user with sufficient capabilities" \
  --env MCP_DEBUG="optional debug flag (e.g., true to enable verbose MCP logs)" \
  --env WP_PASSWORD="WordPress user password or token"

How to use

The WP-CLI AI Command MCP server provides an programmable interface to interact with WordPress installations using AI-powered commands. It exposes an MCP server that you can connect to from local or remote MCP clients, allowing you to issue commands, manage WordPress sites, and orchestrate AI-assisted workflows within a Model Context Protocol ecosystem. You can also connect this server to other MCP servers to coordinate actions across multiple environments. Once running, you can use MCP clients to browse available commands, execute AI-driven tasks, and channel responses back into your WordPress workflow or development pipeline.

How to install

Prerequisites:

  • Node.js installed on the machine where you plan to run the MCP server (recommended LTS version).
  • Access to a WordPress installation with WP-CLI available and proper permissions configured.
  • Basic familiarity with MCP clients and connecting to an MCP server.
  1. Install dependencies (if applicable) and prepare the environment:
# Example: install dependencies if a package.json exists
npm ci
  1. Place the server script at the path referenced in mcp_config (path/to/server.js). Ensure it can read environment variables for WordPress host, user, and password.

  2. Run the MCP server:

# Start the MCP server using Node.js
node path/to/server.js
  1. Verify connectivity by connecting an MCP client to the server, using the address/port exposed by your Node server (default MCP port, if not specified, should be documented in the repo or exercised via the client).

  2. Optional: configure environment variables to tailor access and debugging as described in the mcp_config env section.

Additional notes

Tips:

  • Ensure WP_HOST, WP_USER, and WP_PASSWORD are kept secure; prefer using a secrets manager or environment-based secret injection in production.
  • If you run multiple MCP servers, consider configuring distinct ports or hostnames to avoid conflicts.
  • Enable MCP_DEBUG to troubleshoot connection or command execution issues; review MCP client logs for command flow and responses.
  • If WordPress requires additional permissions or plugins for AI features, install and configure them before connecting the MCP server.
  • Check network access between the MCP client and server; firewalls or proxies can block MCP ports.

Related MCP Servers

Sponsor this space

Reach thousands of developers