WordPress MCP
MCP WordPress Remote connects AI assistants to WordPress sites with secure authentication methods. It offers automatic token management, multi-instance support, and detailed logging for reliable integration.
How to Install and Use WordPress MCP
If you want to connect AI assistants like Claude Desktop to your WordPress site easily and securely, WordPress MCP is the tool you need. It supports multiple ways to log in, including OAuth 2.1, JWT tokens, and application passwords. Here’s a simple guide to get you started.
Step 1: Install WordPress MCP
First, you need to install the WordPress MCP package using npm. This lets you run the MCP server that connects your AI assistant to your WordPress site.
Open your terminal or command prompt and run this command:
npm install @automattic/mcp-wordpress-remote
This installs the necessary files to your system.
Step 2: Configure Your MCP Client
Next, you need to tell your MCP client (like Claude Desktop) how to use WordPress MCP. You do this by adding a configuration block to your client’s settings file.
Here’s an example configuration you can use. Replace https://your-wordpress-site.com with your actual WordPress site URL:
{
"mcpServers": {
"wordpress": {
"command": "npx",
"args": ["-y", "@automattic/mcp-wordpress-remote"],
"env": {
"WP_API_URL": "https://your-wordpress-site.com"
}
}
}
}
This tells the client to run WordPress MCP remotely using the installed package.
Step 3: Choose Your Authentication Method
WordPress MCP supports three main ways to log in. Pick the one that fits your setup best.
Option 1: OAuth 2.1 (Recommended)
OAuth 2.1 is the safest and easiest way. It uses a browser to authorize once, then manages tokens automatically.
To enable OAuth, add this to your config environment:
{
"OAUTH_ENABLED": "true"
}
The full example looks like this:
{
"mcpServers": {
"wordpress": {
"command": "npx",
"args": ["-y", "@automattic/mcp-wordpress-remote"],
"env": {
"WP_API_URL": "https://your-wordpress-site.com",
"OAUTH_ENABLED": "true"
}
}
}
}
Option 2: JWT Token Authentication
If you prefer server-to-server authentication or OAuth is not available, use a JWT token.
Add your token like this:
{
"JWT_TOKEN": "your-jwt-token-here"
}
Example:
{
"mcpServers": {
"wordpress": {
"command": "npx",
"args": ["-y", "@automattic/mcp-wordpress-remote"],
"env": {
"WP_API_URL": "https://your-wordpress-site.com",
"JWT_TOKEN": "your-jwt-token-here"
}
}
}
}
Option 3: WordPress Application Passwords (Legacy)
This uses your WordPress username and an application password for basic authentication.
Example configuration:
{
"mcpServers": {
"wordpress": {
"command": "npx",
"args": ["-y", "@automattic/mcp-wordpress-remote"],
"env": {
"WP_API_URL": "https://your-wordpress-site.com",
"WP_API_USERNAME": "your-username",
"WP_API_PASSWORD": "your-application-password",
"OAUTH_ENABLED": "false"
}
}
}
}
To create an application password:
- Go to your WordPress admin dashboard.
- Navigate to Users > Profile.
- Scroll down to Application Passwords.
- Create a new password for MCP access.
Step 4: Run WordPress MCP
Once configured, start your MCP client (like Claude Desktop). It will automatically use the WordPress MCP server with your settings.
If you want to run WordPress MCP directly from the command line, use:
npx @automattic/mcp-wordpress-remote
Make sure your environment variables like WP_API_URL and authentication details are set.
Optional: Add Custom Headers
If your WordPress site needs extra headers (like API keys), you can add them using the CUSTOM_HEADERS environment variable.
Example with JSON format:
{
"mcpServers": {
"wordpress": {
"command": "npx",
"args": ["-y", "@automattic/mcp-wordpress-remote"],
"env": {
"WP_API_URL": "https://your-wordpress-site.com",
"CUSTOM_HEADERS": "{\"X-MCP-API-Key\": \"your-api-key\", \"X-Custom-Header\": \"value\"}"
}
}
}
}
Summary
- Install WordPress MCP with
npm install @automattic/mcp-wordpress-remote. - Configure your MCP client with your WordPress URL.
- Choose and set up your authentication method.
- Start your MCP client or run the MCP server with
npx. - Optionally, add custom headers if needed.
This setup lets your AI assistant connect smoothly and securely to your WordPress site using WordPress MCP.