home / mcp / wordpress mcp server

WordPress MCP Server

An MCP server that enables AI assistants to interact with WordPress sites via the REST API across multiple sites.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "emzimmer-server-wp-mcp": {
      "url": "https://example-mcp-server.example.com/mcp",
      "headers": {
        "WP_SITES_PATH": "/absolute/path/to/wp-sites.json"
      }
    }
  }
}

You can manage and interact with multiple WordPress sites through a single MCP server. This server connects to WordPress REST API endpoints, enabling content management, post operations, and site configuration using natural language via your MCP client.

How to use

You will configure your WordPress MCP Server with a JSON file that lists each WordPress site you want to manage. Once configured, you can ask your MCP client to list posts, create or update content, manage comments, and adjust site settings across all connected sites. The server handles authentication, endpoint discovery, and translates your natural language requests into REST API calls to WordPress.

Practical usage patterns include: list posts from a site, create a new draft post with a given title, update a post’s featured image, manage comments, or adjust site configurations like themes and plugins. You can perform multi-site operations by addressing the specific site alias you defined in your configuration. The server automatically discovers available endpoints for each site and routes your requests accordingly.

How to install

Prerequisites: ensure you have Node.js and npm installed on your system. You may also use a package manager that supports npm packages.

Install the WordPress MCP Server package locally in your project.

npm install server-wp-mcp

Run the MCP server as a local stdio process. The runtime command and arguments shown below are the typical pattern to start the server from your environment. Use the absolute path to your generated server bundle if needed.

node path/to/server/dist/index.js

Provide the path to your configuration file via an environment variable when starting the server. This keeps sensitive details out of the command line. Place your configuration file somewhere secure on disk and reference its absolute path.

export WP_SITES_PATH=/absolute/path/to/wp-sites.json
```
When running in a shell, you can combine the steps as needed for your environment.

If you prefer automatic installation via Smithery tooling, you can use the Smithery command to install the WordPress MCP Server for your client. The command shown assumes you are using a Claude client.

npx -y @smithery/cli install server-wp-mcp --client claude

Configuration

Create a JSON configuration file that lists each WordPress site you want to connect. The configuration file must include the site alias, the WordPress URL, username, and an application password that you obtain from WordPress. Spaces in passwords will be automatically removed by the server.

Use a name for each site alias that will be used to reference that site in MCP commands.

{
	"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"
	}
}

Your configuration file path must be provided to the client as an environment variable when starting the MCP server.

For Claude Desktop integration, add the MCP server to your Claude client configuration and point it to the server entry point. The environment variable must reference the absolute path to your configuration file.

{
	"mcpServers": {
		"wordpress": {
			"command": "node",
			"args": ["path/to/server/dist/index.js"],
			"env": {
				"WP_SITES_PATH": "/absolute/path/to/wp-sites.json"
			}
		}
	}
}

Security and maintenance notes

Keep your wp-sites.json file secure and never commit it to version control. Consider using environment variables for sensitive data in production. Ensure all WordPress sites are accessed over HTTPS and rotate application passwords regularly. Follow the principle of least privilege when assigning user roles.

Tools and endpoints

The MCP server supports dynamic endpoint discovery and execution of REST API requests against WordPress sites. The following tools are available for interacting with WordPress through the MCP server.

wp_discover_endpoints` Maps all available REST API endpoints on a WordPress site.

Arguments:
{
	"site": {"type": "string", "description": "Site alias (as defined in configuration)", "required": true}
}

Returns: List of available endpoints with their methods and namespaces.

`wp_call_endpoint` Executes 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}
}

Available tools

wp_discover_endpoints

Maps all available REST API endpoints on a WordPress site and returns the endpoints with methods and namespaces.

wp_call_endpoint

Sends REST API requests to a WordPress site for a given endpoint, method, and parameters.