WordPress MCP Setup for Claude Code

The WordPress MCP Adapter plugin exposes a WordPress site as an MCP server. Combined with Automattic’s @automattic/mcp-wordpress-remote package, Claude Code can create and edit posts, manage pages, and interact with WordPress directly from a session.

Architecture

Claude Code
  └── stdio
      └── npx @automattic/mcp-wordpress-remote
              └── HTTPS (Application Password auth)
                      └── WordPress REST API (/wp-json/mcp/...)
                              └── MCP Adapter plugin
                                      └── WordPress Abilities API

Requirements

  • WordPress 6.9+
  • Node.js (installed via nvm)
  • MCP Adapter plugin activated on the WordPress site

Step 1: Install the MCP Adapter Plugin

Via WP-CLI on the server:

wp plugin install https://github.com/WordPress/mcp-adapter/releases/latest/download/mcp-adapter.zip --activate

Or install manually from the GitHub releases page and activate in WP Admin → Plugins. Once active, the following REST API routes should be present:

/wp-json/mcp/
/wp-json/mcp/mcp-adapter-default-server

Step 2: Create a WordPress Application Password

  1. Log into WP Admin → Users → Profile
  2. Scroll to Application Passwords
  3. Enter a name (e.g. claude-code) and click Add New Application Password
  4. Copy the generated password — it is shown only once

Step 3: Install Node.js via nvm

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash
source ~/.nvm/nvm.sh
nvm install --lts

Step 4: Add the MCP Server to ~/.claude.json

Add the following under mcpServers in ~/.claude.json:

{
  "wordpress": {
    "type": "stdio",
    "command": "/home/user/.nvm/versions/node/v24.x.x/bin/npx",
    "args": ["@automattic/mcp-wordpress-remote"],
    "env": {
      "WP_API_USERNAME": "your-wp-username",
      "WP_API_PASSWORD": "xxxx xxxx xxxx xxxx xxxx xxxx",
      "WP_API_URL": "https://yourdomain.com/wp-json/mcp/mcp-adapter-default-server",
      "PATH": "/home/user/.nvm/versions/node/v24.x.x/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
    }
  }
}

Two critical details:

  • WP_API_URL must be the full endpoint path, not a bare domain. Passing just https://yourdomain.com triggers legacy mode in the package, which targets the deprecated /wp-json/wp/v2/wpmcp endpoint and returns a 404.
  • PATH must include the nvm Node path. Claude Code sessions do not source .bashrc or nvm, so without this, npx fails with env: 'node': No such file or directory.

Note: XML-RPC (/xmlrpc.php) is not used — the MCP Adapter uses the REST API exclusively. It can stay disabled.

Step 5: Restart Claude Code and Verify

MCP servers connect at session startup. After editing ~/.claude.json, start a new session. To verify the endpoint is reachable beforehand:

curl -s https://yourdomain.com/wp-json/mcp/ | python3 -m json.tool

Should list /mcp and /mcp/mcp-adapter-default-server routes. Once connected, WordPress tools will appear alongside any other MCP tools in the session.

Notes

  • The @automattic/mcp-wordpress-remote package is downloaded on first use by npx and cached in ~/.npm/.
  • For additional WordPress sites, add new entries under mcpServers with different keys (e.g. wordpress-staging).
  • MCP servers only connect at session start — always start a new Claude Code session after changing MCP configuration.

Leave a Reply

Your email address will not be published. Required fields are marked *