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.
You can install the MCP Server plugin directly from the nightly build or via 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
For the best experience, use this plugin with the WP-CLI AI command. Follow these steps to set up the complete environment:
Install and activate the MCP server plugin:
wp plugin install --activate https://github.com/mcp-wp/mcp-server/archive/refs/heads/main.zip
Install and activate the AI Services plugin:
wp plugin install --activate ai-services
Install the AI command package:
wp package install mcp-wp/ai-command:dev-main
Configure the MCP server (replace "example.com" with your actual domain):
wp mcp server add "mysite" "https://example.com/wp-json/mcp/v1/mcp"
Test the functionality with a simple command:
wp ai "Greet my friend Pascal"
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.
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.
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"
]
}
}
}
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.
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.