WordPress REST API MCP server

Enables AI interaction with WordPress sites for content management through REST API endpoints that provide access to posts, users, taxonomies, media, and community events.
Back to servers
Provider
Pascal Birchler
Release date
Apr 03, 2025
Language
PHP
Stats
19 stars

The MCP Server for WordPress plugin implements the Model Context Protocol using the WordPress REST API. It enables your WordPress site to function as an MCP server, following the Streamable HTTP transport standard defined in the latest MCP specification.

Installation

You can install the MCP Server plugin directly from the nightly build or via WP-CLI.

Using the Nightly Build

  1. Download the latest nightly build from the official distribution page
  2. In your WordPress admin panel, navigate to Plugins > Add New
  3. Click "Upload Plugin" and select the downloaded ZIP file
  4. Click "Install Now" and then "Activate"

Using WP-CLI

Install and activate the plugin directly from GitHub with this command:

wp plugin install --activate https://github.com/mcp-wp/mcp-server/archive/refs/heads/main.zip

Using with WP-CLI AI Command

For the best experience, use this plugin with the WP-CLI AI command. Follow these steps to set up the complete environment:

  1. Install and activate the MCP server plugin:

    wp plugin install --activate https://github.com/mcp-wp/mcp-server/archive/refs/heads/main.zip
    
  2. Install and activate the AI Services plugin:

    wp plugin install --activate ai-services
    
  3. Install the AI command package:

    wp package install mcp-wp/ai-command:dev-main
    
  4. Configure the MCP server (replace "example.com" with your actual domain):

    wp mcp server add "mysite" "https://example.com/wp-json/mcp/v1/mcp"
    
  5. Test the functionality with a simple command:

    wp ai "Greet my friend Pascal"
    

Technical Details

The plugin creates a new REST API endpoint at /wp-json/mcp/v1/mcp that implements the MCP Streamable HTTP transport. This endpoint serves as the communication channel for MCP clients to interact with your WordPress site.

Under the hood, the plugin utilizes the logiscape/mcp-sdk-php package to handle the MCP server functionality, which it then exposes through WordPress's REST API infrastructure.

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later