A comprehensive MCP server that connects Claude to WordPress sites through the WordPress REST API with multiple authentication options. Supports OAuth 2.1 with PKCE, JWT tokens, and application passwords for accessing posts, pages, users, media, and comments. Includes WooCommerce integration for e-commerce operations like managing products and orders. Implements the full MCP Authorization specification with automatic token management and endpoint discovery. You'd reach for this when building AI workflows that need to read, create, or modify WordPress content, manage WooCommerce stores, or integrate Claude into existing WordPress-based systems without manual API setup.
A Model Context Protocol (MCP) server for seamless WordPress integration
Connect AI assistants like Claude Desktop to your WordPress sites with multiple authentication methods including OAuth 2.0, JWT tokens, and application passwords.
npm install @automattic/mcp-wordpress-remote
Add to your MCP client configuration (e.g., Claude Desktop's claude_desktop_config.json):
{
"mcpServers": {
"wordpress": {
"command": "npx",
"args": ["-y", "@automattic/mcp-wordpress-remote"],
"env": {
"WP_API_URL": "https://your-wordpress-site.com/wp-json/mcp/mcp-adapter-default-server"
}
}
}
}
You can add custom headers to all API requests using the CUSTOM_HEADERS environment variable. This is useful for API keys, custom authentication, or other header requirements.
{
"mcpServers": {
"wordpress": {
"command": "npx",
"args": ["-y", "@automattic/mcp-wordpress-remote"],
"env": {
"WP_API_URL": "https://your-wordpress-site.com/wp-json/mcp/mcp-adapter-default-server",
"CUSTOM_HEADERS": "{\"X-MCP-API-Key\": \"*Ibo7tweixlbfuwaiufxgakjyefctwajcetb*\", \"X-Custom-Header\": \"value\"}"
}
}
}
}
{
"mcpServers": {
"wordpress": {
"command": "npx",
"args": ["-y", "@automattic/mcp-wordpress-remote"],
"env": {
"WP_API_URL": "https://your-wordpress-site.com/wp-json/mcp/mcp-adapter-default-server",
"CUSTOM_HEADERS": "X-MCP-API-Key:IOskncfyes78U8on3q7ry43o487tybrc,X-Custom-Header:value"
}
}
}
}
CUSTOM_HEADERS='{"X-MCP-API-Key": "wc_mcp_FaQduhQcW0mfVaZgP3yaaqDuXaZ3mw7j"}' \
WP_API_URL="https://your-site.com/wp-json/mcp/mcp-adapter-default-server" \
npx @automattic/mcp-wordpress-remote
Custom headers are included in:
JWT_TOKEN environment variableWP_API_USERNAME and WP_API_PASSWORDInstall the MCP Adapter plugin on your WordPress site. Once active, it registers a default MCP server at /wp-json/mcp/mcp-adapter-default-server — set WP_API_URL to that full URL (examples throughout this README show the pattern). To target a custom server id or namespace, pass the full URL of that server instead.
wordpress-mcp pluginEarlier versions of this proxy were designed for Automattic/wordpress-mcp, which exposes its endpoint at /wp-json/wp/v2/wpmcp. That plugin is deprecated in favor of mcp-adapter, but existing installs continue to work — for backwards compatibility, a bare-domain WP_API_URL (e.g. https://your-wordpress-site.com) still resolves to the wordpress-mcp endpoint. New setups should install mcp-adapter and use the full URL shown above.
OAuth 2.1 provides the most secure and user-friendly experience with full MCP Authorization specification compliance.
{
"mcpServers": {
"wordpress": {
"command": "npx",
"args": ["-y", "@automattic/mcp-wordpress-remote"],
"env": {
"WP_API_URL": "https://your-wordpress-site.com/wp-json/mcp/mcp-adapter-default-server",
"OAUTH_ENABLED": "true"
}
}
}
}
MCP Authorization Specification Features:
Benefits:
For server-to-server authentication or when OAuth is not available.
{
"mcpServers": {
"wordpress": {
"command": "npx",
"args": ["-y", "@automattic/mcp-wordpress-remote"],
"env": {
"WP_API_URL": "https://your-wordpress-site.com/wp-json/mcp/mcp-adapter-default-server",
"JWT_TOKEN": "your-jwt-token-here"
}
}
}
}
Uses WordPress username and application password for basic authentication.
{
"mcpServers": {
"wordpress": {
"command": "npx",
"args": ["-y", "@automattic/mcp-wordpress-remote"],
"env": {
"WP_API_URL": "https://your-wordpress-site.com/wp-json/mcp/mcp-adapter-default-server",
"WP_API_USERNAME": "your-username",
"WP_API_PASSWORD": "your-application-password",
"OAUTH_ENABLED": "false"
}
}
}
}
To create an application password:
{
"mcpServers": {
"wordpress": {
"command": "npx",
"args": ["-y", "@automattic/mcp-wordpress-remote"],
"env": {
"WP_API_URL": "https://your-wordpress-site.com/wp-json/mcp/mcp-adapter-default-server",
"OAUTH_CALLBACK_PORT": "7665",
"OAUTH_HOST": "127.0.0.1",
"WP_OAUTH_CLIENT_ID": "your-custom-client-id"
}
}
}
}
For WooCommerce-specific tools and reports:
{
"mcpServers": {
"wordpress": {
"command": "npx",
"args": ["-y", "@automattic/mcp-wordpress-remote"],
"env": {
"WP_API_URL": "https://your-wordpress-site.com/wp-json/mcp/mcp-adapter-default-server",
"WOO_CUSTOMER_KEY": "ck_your-consumer-key",
"WOO_CUSTOMER_SECRET": "cs_your-consumer-secret"
}
}
}
}
| Variable | Description | Default | Required |
|---|---|---|---|
WP_API_URL | WordPress site URL including the MCP endpoint path (e.g. …/wp-json/mcp/mcp-adapter-default-server). A bare domain resolves to the deprecated wordpress-mcp endpoint for backwards compatibility. | - | ✅ |
OAUTH_ENABLED | Enable OAuth authentication | true | - |
OAUTH_CALLBACK_PORT | OAuth callback port | 7665 | - |
OAUTH_HOST | OAuth callback hostname | 127.0.0.1 | - |
WP_OAUTH_CLIENT_ID | Custom OAuth client ID | - | - |
| OAuth Endpoints | |||
OAUTH_AUTHORIZE_ENDPOINT | OAuth authorization endpoint | - | ✅ (for custom OAuth) |
OAUTH_TOKEN_ENDPOINT | OAuth token endpoint | - | ✅ (for custom OAuth) |
OAUTH_AUTHENTICATE_ENDPOINT | OAuth authenticate endpoint | - | - |
| MCP OAuth 2.1 Settings | |||
OAUTH_FLOW_TYPE | OAuth flow type (authorization_code or implicit) | authorization_code | - |
OAUTH_USE_PKCE | Use PKCE (required for OAuth 2.1) | true | - |
OAUTH_DYNAMIC_REGISTRATION | Enable dynamic client registration | true | - |
OAUTH_RESOURCE_INDICATOR | Use resource indicators (RFC 8707) | true | - |
| Configuration | |||
WP_MCP_CONFIG_DIR | Config directory override | ~/.mcp-auth | - |
LOG_FILE | Log file path | - | - |
LOG_LEVEL | Log level (0-3) | 2 | - |
LOG_TO_STDERR | Mirror all log levels to stderr (errors always are) | false | - |
WP_API_TIMEOUT_MS | Request timeout for tool calls (ms) | 120000 | - |
WP_API_INIT_TIMEOUT_MS | Timeout for the initialize handshake (ms) | 25000 | - |
| TLS / Certificates | |||
NODE_EXTRA_CA_CERTS | Path to an extra CA file to trust (mkcert/corporate CA) | - | - |
NODE_USE_SYSTEM_CA | Trust the OS certificate store (Node 22.15+) | - | - |
| Legacy Authentication | |||
JWT_TOKEN | JWT token for authentication | - | - |
WP_API_USERNAME | WordPress username (legacy) | - | - |
WP_API_PASSWORD | WordPress app password (legacy) | - | - |
WOO_CUSTOMER_KEY | WooCommerce consumer key | - | - |
WOO_CUSTOMER_SECRET | WooCommerce consumer secret | - | - |
To use only JWT or Basic Auth:
{
"env": {
"OAUTH_ENABLED": "false",
"JWT_TOKEN": "your-jwt-token"
}
}
For development and testing, you can use the local repository:
Clone the repository:
git clone https://github.com/Automattic/mcp-wordpress-remote.git
cd mcp-wordpress-remote
Install dependencies:
npm install
Build the project:
npm run build
Configure your MCP client to use the local version:
{
"mcpServers": {
"wordpress": {
"command": "node",
"args": ["/path/to/your/mcp-wordpress-remote/dist/proxy.js"],
"env": {
"WP_API_URL": "https://your-wordpress-site.com/wp-json/mcp/mcp-adapter-default-server"
}
}
}
}
npm run build:watch - Automatically rebuilds on file changesnpm test - Run the test suitenpm run check - Run TypeScript and Prettier checksTokens are automatically stored in:
~/.mcp-auth/wordpress-remote-{version}/
# View stored tokens
ls -la ~/.mcp-auth/wordpress-remote-*/
# Clear all tokens (forces re-authentication)
rm -rf ~/.mcp-auth/wordpress-remote-*/
# Clear tokens for specific version
rm -rf ~/.mcp-auth/wordpress-remote-0.2.1/
The proxy automatically coordinates between multiple instances:
If you see "waiting for other instance" messages, this is normal behavior.
OAuth browser doesn't open:
OAUTH_CALLBACK_PORTOAuth authorization fails:
JWT authentication fails:
Basic Auth fails:
API endpoint not found:
WP_API_URL points at the server route (e.g. …/wp-json/mcp/mcp-adapter-default-server)Permission denied:
If port 3000 is already in use:
{
"env": {
"OAUTH_CALLBACK_PORT": "8080"
}
}
"Waiting for other instance" messages are normal when multiple MCP clients start simultaneously. The system coordinates authentication to prevent conflicts.
Enable detailed logging:
{
"env": {
"LOG_LEVEL": "3",
"LOG_FILE": "/path/to/logfile.log"
}
}
Log levels:
0 - Errors only1 - Warnings and errors2 - Info, warnings, and errors (default)3 - Debug, info, warnings, and errorsGPL v2 or later
Contributions welcome! This project is maintained by Automattic Inc.
Need help? Check the troubleshooting section or open an issue.