About WordPress MCP Server
WordPress MCP Server publishes articles to WordPress and manages the metadata they need. It is for content workflows that need category and tag handling, connection checks, and featured images through either an MCP or standalone FastAPI server.
Key features
- 01Publish articles to WordPress
- 02Check WordPress connections
- 03Create and retrieve categories and tags
- 04Create missing metadata during preparation
- 05Add featured images from URLs or base64
Use cases
- 01Publish an article with category and tag IDs
- 02Prepare categories and tags before publishing
- 03Attach a featured image to an article
MCP support
It runs as an MCP server with tools for publishing articles, preparing category and tag metadata, and testing the WordPress connection. It can also run as a standalone FastAPI server.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.
Tools
Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.
Details
From the project READMEWordPress MCP Server
A Machine Communication Protocol (MCP) server that allows publishing content to WordPress sites.
Features
- Publish articles to WordPress
- Test WordPress connection
- Create, retrieve, and manage WordPress categories and tags
- Automatically handle category and tag creation when publishing
- Support for featured images via URL or base64-encoded data
- Works as both standalone FastAPI server and MCP server
- Environment variable support for WordPress credentials
Setup
-
Create a virtual environment using UV:
uv venv .venv\Scripts\activate -
Install dependencies:
uv pip install -r requirements.txt -
Configure WordPress credentials:
- Rename
.env.exampleto.env(or create a new.envfile) - Update with your WordPress site URL, username, and application password
- Rename
Usage
As MCP Server
Run the server in MCP mode:
python main.py --mcp
As Standalone API
Run the server as a standalone FastAPI application:
python main.py
The API will be available at http://localhost:8000
API Endpoints
GET /- Root endpointGET /wp-config- Get WordPress configuration from environment variablesPOST /get-categories- Get all categories from WordPressPOST /get-tags- Get all tags from WordPressPOST /test-connection- Test the WordPress connectionPOST /publish-article- Publish an article to WordPress
MCP Tools
PUBLISH_ARTICLE- Publish an article to WordPress with category and tag IDsPREPARE_ARTICLE_METADATA- Check for existing categories and tags, create them if they don't exist, and return their IDsTEST_CONNECTION- Test connection to WordPress site
Category and Tag Management
The WordPress MCP Server now supports advanced category and tag management:
Using PREPARE_ARTICLE_METADATA
This tool allows you to:
- Check if categories and tags exist on your WordPress site
- Automatically create any categories or tags that don't exist
- Return the IDs of all categories and tags for use with PUBLISH_ARTICLE
Example workflow:
- Call PREPARE_ARTICLE_METADATA with category and tag names
- Get back the corresponding IDs
- Use those IDs with PUBLISH_ARTICLE to publish your content
Featured Image Support
The WordPress MCP Server now supports adding featured images to articles:
Using PUBLISH_ARTICLE with Images
You can add a featured image to your article in two ways:
-
Via URL: Provide an
image_urlparameter with a direct link to the image"image_url": "https://example.com/path/to/image.jpg" -
Via Base64: Provide an
image_base64parameter with the base64-encoded image data"image_base64": "iVBORw0KGgoAAAANSUhEUgAA..." -
Custom Filename: Optionally specify a filename for the uploaded image
"image_filename": "my-custom-image-name.jpg"
The server will:
- Download the image (if URL provided) or decode the base64 data
- Upload the image to WordPress
- Set it as the featured image for the article
- Return the media ID in the response
Using the Standalone API
When using the standalone API, you can provide a featured image either as:
- A file upload using the
imageform field - A URL using the
image_urlform field
Environment Variable Support
All tools now support using environment variables from your .env file as defaults:
WP_SITE_URL- Your WordPress site URLWP_USERNAME- Your WordPress usernameWP_PASSWORD- Your WordPress application password
This means you can call the tools without explicitly providing these parameters if they're set in your environment.
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.