The WordPress MCP Server allows AI assistants like Claude to interact with WordPress sites through the WordPress REST API. It supports managing multiple WordPress sites, providing access to content management, post operations, and site configuration through natural language commands.
For an automated installation with Claude Desktop:
npx -y @smithery/cli install server-wp-mcp --client claude
Install the package directly with npm:
npm install server-wp-mcp
Note: Application Passwords require WordPress 5.6+ and HTTPS.
Create a JSON configuration file (e.g., wp-sites.json
) with your WordPress site details:
{
"myblog": {
"URL": "https://myblog.com",
"USER": "yourusername",
"PASS": "abcd 1234 efgh 5678"
},
"testsite": {
"URL": "https://test.example.com",
"USER": "anotherusername",
"PASS": "wxyz 9876 lmno 5432"
}
}
Each site entry requires:
URL
: Full WordPress site URL (including http:// or https://)USER
: WordPress usernamePASS
: Application password (spaces will be automatically removed)The key you use (e.g., "myblog", "testsite") becomes the site alias for all interactions.
Add the server to your claude_desktop_config.json
:
{
"mcpServers": {
"wordpress": {
"command": "node",
"args": ["path/to/server/dist/index.js"],
"env": {
"WP_SITES_PATH": "/absolute/path/to/wp-sites.json"
}
}
}
}
Important: The WP_SITES_PATH
environment variable must use an absolute path to your configuration file.
This tool maps all available REST API endpoints on a WordPress site.
Arguments:
{
"site": {
"type": "string",
"description": "Site alias (as defined in configuration)",
"required": true
}
}
Execute REST API requests to WordPress sites.
Arguments:
{
"site": {
"type": "string",
"description": "Site alias",
"required": true
},
"endpoint": {
"type": "string",
"description": "API endpoint path",
"required": true
},
"method": {
"type": "string",
"enum": ["GET", "POST", "PUT", "DELETE", "PATCH"],
"description": "HTTP method",
"default": "GET"
},
"params": {
"type": "object",
"description": "Request parameters or body data",
"required": false
}
}
Once configured, you can ask Claude to perform various WordPress operations:
List and query posts:
Create and edit content:
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.