Get the FREE Ultimate OpenClaw Setup Guide →

the-wordpress

MCP server from Leonelberio/the-wordpress-mcp-server

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio leonelberio-the-wordpress-mcp-server node path/to/build/index.js \
  --env WORDPRESS_PASSWORD="your-app-password" \
  --env WORDPRESS_SITE_URL="https://your-wordpress-site.com" \
  --env WORDPRESS_USERNAME="your-username"

How to use

This MCP server provides a WordPress integration interface over the MCP (Model Context Protocol) framework. It exposes JSON-RPC 2.0 methods to interact with a WordPress site through the WordPress REST API. The available methods are create_post, get_posts, and update_post, each supporting environment-provided credentials or optional per-request credentials. To use it, configure the WordPress site URL and credentials (via environment variables or request parameters), then call the methods with the required parameters (for example, title and content for creating a post). The server handles authentication and communicates with WordPress to create, fetch, or update posts as requested.

Typical workflows include creating a new post with create_post, retrieving a list of posts with get_posts (supporting pagination), and updating an existing post with update_post. You can provide siteUrl, username, and password in the request if you did not supply them via environment variables. The server will translate JSON-RPC requests into WordPress REST API calls and return the results in JSON-RPC compatible responses.

How to install

Prerequisites:

  • Node.js 20.0.0 or higher
  • npm (package manager)
  • Access to a WordPress site with REST API enabled and an application password for authentication (recommended)

Installation steps:

  1. Clone the repository git clone <repository-url> cd <repository-directory>

  2. Install dependencies npm install

  3. Build the project npm run build

  4. Configure MCP settings In your MCP settings file, add the WordPress server configuration (see example in the README). Example:

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

  5. Run the MCP server Use your existing MCP orchestration to start the server as configured. For a direct node run (for testing), you could execute: node path/to/build/index.js

Note: If you prefer not to use environment variables, you can supply WORDPRESS_SITE_URL, WORDPRESS_USERNAME, and WORDPRESS_PASSWORD in the JSON-RPC request parameters instead.

Additional notes

Tips and considerations:

  • It is recommended to use WordPress application passwords for authentication rather than your main account password.
  • You can supply credentials per-request or rely on environment variables. If both are present, request-provided credentials may override env vars for that call.
  • Ensure WORDPRESS_SITE_URL uses the correct protocol (https is preferred in production).
  • The server assumes REST API access to WordPress; check that permalinks are configured and CORS settings allow requests from your MCP environment if needed.
  • For post creation, you can specify status as 'draft', 'publish', or 'private'. When updating posts, include the postId and any fields you wish to change (title, content, or status).
  • If you encounter authentication errors, verify that WordPress application passwords are active and have the necessary capabilities (read/write for posts).
  • When hosting across environments (Windows/macOS/Linux), ensure the path to the built index.js is correct and that file permissions allow execution.

Related MCP Servers

Sponsor this space

Reach thousands of developers