Get the FREE Ultimate OpenClaw Setup Guide →

mcp

MCP server implementation using the WordPress REST API

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-mcp-server docker run -i wordpress-mcp-server:latest \
  --env WP_ENV="production" \
  --env WP_SITE_URL="https://your-wordpress-site" \
  --env WP_AUTH_TOKEN="your-auth-token" \
  --env WP_PLUGIN_PATH="/var/www/html/wp-content/plugins"

How to use

This MCP server is implemented as a WordPress plugin that exposes a Model Context Protocol (MCP) endpoint via the WordPress REST API at /wp-json/mcp/v1/mcp. It relies on the logiscape/mcp-sdk-php package to provide MCP functionality and is designed to work alongside a WordPress site. Because the transport is based on WordPress, you’ll use WordPress tooling and REST calls to interact with MCP features. The README describes how to set up a WordPress-based MCP server and how to integrate it with the WP-CLI AI command for an end-to-end workflow. You’ll typically access the MCP endpoint through your WordPress site and use MCP clients to communicate with it via that REST route. Tools available include the WP-CLI-based AI command, and the MCP server exposes the standard MCP API surface via the /wp-json/mcp/v1/mcp route.

How to install

Prerequisites:

  • A WordPress installation (self-hosted or managed) with PHP and a web server.
  • Access to install plugins (via WordPress admin or WP-CLI).

Installation steps:

  1. Download or clone the MCP WordPress plugin repository and install it on your WordPress site. You can typically do this by visiting the WordPress admin > Plugins > Add New > Upload and selecting the plugin zip, or by using WP-CLI if desired.
  2. Activate the MCP WordPress plugin once installed.
  3. Ensure the WordPress site is accessible at your domain (e.g., https://your-wordpress-site).
  4. If you are using a containerized deployment (optional), start a WordPress-friendly container image that includes the MCP plugin. Example Docker-based setup could be:
    • docker pull wordpress:latest
    • docker run -d --name wordpress-mcp -p 8080:80 -e WORDPRESS_HOST='your-wordpress-site' wordpress:latest
  5. Configure environment variables if you’re orchestrating the containerized setup (for example, WP_SITE_URL and authentication tokens if needed by your deployment pipeline).
  6. Verify the MCP endpoint is available at https://your-wordpress-site/wp-json/mcp/v1/mcp.

Notes:

  • This plugin uses the WordPress REST API; ensure proper authentication and access controls are in place.
  • The Streamable HTTP transport is part of the MCP spec and is not fully implemented yet in this plugin, so some features may be experimental.

Additional notes

Tips and considerations:

  • The MCP endpoint is served through the WordPress REST API at /wp-json/mcp/v1/mcp; ensure your WordPress installation exposes this route (per the plugin’s configuration).
  • If you’re running in production, restrict access to the MCP endpoint with WordPress authentication or dedicated API tokens.
  • The plugin uses the logiscape/mcp-sdk-php package; keep your PHP version and dependencies up to date to ensure compatibility.
  • If you encounter transport issues, verify that the Streamable HTTP transport portion is compatible with your MCP clients and that the WordPress site’s SSL configuration is valid.
  • When testing locally, you can pair this with the WP-CLI AI command to experiment with MCP interactions from the WordPress environment.
  • If you run the MCP server behind a reverse proxy, ensure proper URL routing to /wp-json/mcp/v1/mcp and that CORS settings permit your MCP clients to access it as needed.

Related MCP Servers

Sponsor this space

Reach thousands of developers