This MCP server enables interaction with WordPress sites through the WordPress REST API, allowing you to create, retrieve, and update posts using JSON-RPC 2.0 protocol. It works on Windows, macOS, and Linux systems, providing a convenient way to manage WordPress content programmatically.
To install the WordPress MCP server:
npm install
npm run build
Add the server to your MCP settings file with environment variables for WordPress credentials:
{
"mcpServers": {
"wordpress": {
"command": "node",
"args": ["path/to/build/index.js"],
"env": {
"WORDPRESS_SITE_URL": "https://your-wordpress-site.com",
"WORDPRESS_USERNAME": "your-username",
"WORDPRESS_PASSWORD": "your-app-password"
}
}
}
}
Security Tip: For security, use WordPress application passwords instead of your main account password. Generate an application password in your WordPress dashboard under Users → Security → Application Passwords.
Creates a new WordPress post.
Parameters:
siteUrl
: (optional if set in env) WordPress site URLusername
: (optional if set in env) WordPress usernamepassword
: (optional if set in env) WordPress application passwordtitle
: Post titlecontent
: Post contentstatus
: (optional) 'draft' | 'publish' | 'private' (default: 'draft')Retrieves WordPress posts.
Parameters:
siteUrl
: (optional if set in env) WordPress site URLusername
: (optional if set in env) WordPress usernamepassword
: (optional if set in env) WordPress application passwordperPage
: (optional) Number of posts per page (default: 10)page
: (optional) Page number (default: 1)Updates an existing WordPress post.
Parameters:
siteUrl
: (optional if set in env) WordPress site URLusername
: (optional if set in env) WordPress usernamepassword
: (optional if set in env) WordPress application passwordpostId
: ID of the post to updatetitle
: (optional) New post titlecontent
: (optional) New post contentstatus
: (optional) 'draft' | 'publish' | 'private'{
"jsonrpc": "2.0",
"id": 1,
"method": "create_post",
"params": {
"title": "My New Post",
"content": "Hello World!",
"status": "draft"
}
}
{
"jsonrpc": "2.0",
"id": 1,
"method": "create_post",
"params": {
"siteUrl": "https://your-wordpress-site.com",
"username": "your-username",
"password": "your-app-password",
"title": "My New Post",
"content": "Hello World!",
"status": "draft"
}
}
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "wordpress" '{"command":"node","args":["path/to/build/index.js"],"env":{"WORDPRESS_SITE_URL":"https://your-wordpress-site.com","WORDPRESS_USERNAME":"your-username","WORDPRESS_PASSWORD":"your-app-password"}}'
See the official Claude Code MCP documentation for more details.
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 > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"wordpress": {
"command": "node",
"args": [
"path/to/build/index.js"
],
"env": {
"WORDPRESS_SITE_URL": "https://your-wordpress-site.com",
"WORDPRESS_USERNAME": "your-username",
"WORDPRESS_PASSWORD": "your-app-password"
}
}
}
}
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 explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"wordpress": {
"command": "node",
"args": [
"path/to/build/index.js"
],
"env": {
"WORDPRESS_SITE_URL": "https://your-wordpress-site.com",
"WORDPRESS_USERNAME": "your-username",
"WORDPRESS_PASSWORD": "your-app-password"
}
}
}
}
3. Restart Claude Desktop for the changes to take effect