- Explore MCP Servers
- MCP-wordpress
Mcp Wordpress
What is Mcp Wordpress
MCP-wordpress is a server that implements the Model-Calling-Protocol (MCP) to facilitate communication with the WordPress REST API, allowing users to perform various actions on a WordPress site through natural language instructions.
Use cases
Use cases for MCP-wordpress include automating content creation, managing WordPress resources via voice commands, integrating with chatbots for customer support, and simplifying API interactions for developers.
How to use
To use MCP-wordpress, send a POST request to the ‘/api/mcp’ endpoint with a JSON body containing your natural language request about WordPress. The server will process the request and return the results in a structured format.
Key features
Key features of MCP-wordpress include complete integration with the WordPress REST API, support for multiple AI providers (Anthropic Claude and OpenAI), natural language processing capabilities, authentication options, and endpoints for various WordPress resources such as posts, pages, media, and more.
Where to use
MCP-wordpress can be used in web development, content management, and any application that requires interaction with a WordPress site, particularly where natural language processing can enhance user experience.
Clients Supporting MCP
The following are the main client software that supports the Model Context Protocol. Click the link to visit the official website for more information.
Overview
What is Mcp Wordpress
MCP-wordpress is a server that implements the Model-Calling-Protocol (MCP) to facilitate communication with the WordPress REST API, allowing users to perform various actions on a WordPress site through natural language instructions.
Use cases
Use cases for MCP-wordpress include automating content creation, managing WordPress resources via voice commands, integrating with chatbots for customer support, and simplifying API interactions for developers.
How to use
To use MCP-wordpress, send a POST request to the ‘/api/mcp’ endpoint with a JSON body containing your natural language request about WordPress. The server will process the request and return the results in a structured format.
Key features
Key features of MCP-wordpress include complete integration with the WordPress REST API, support for multiple AI providers (Anthropic Claude and OpenAI), natural language processing capabilities, authentication options, and endpoints for various WordPress resources such as posts, pages, media, and more.
Where to use
MCP-wordpress can be used in web development, content management, and any application that requires interaction with a WordPress site, particularly where natural language processing can enhance user experience.
Clients Supporting MCP
The following are the main client software that supports the Model Context Protocol. Click the link to visit the official website for more information.
Content
WordPress MCP API Server
A Claude MCP (Model-Calling-Protocol) compatible server that can communicate with the WordPress REST API to perform all possible actions on a WordPress site. The server processes natural language instructions and converts them into WordPress API operations.
MCP Integration
This server follows Anthropic’s Model-Calling-Protocol standard, providing a simple request/response interface:
- Endpoint:
/api/mcp - Method: POST
- Request Format:
{
"messages": [
{
"role": "user",
"content": "Your natural language request about WordPress"
}
]
}
- Response Format:
{
"success": true,
"response": {
"role": "assistant",
"content": "Response from the MCP with WordPress operation results"
}
}
AI Providers
The server supports multiple AI providers:
- Anthropic Claude (default): Using Claude 3.5 Sonnet for natural language understanding
- OpenAI: Using GPT-4 as a fallback option
Features
- Complete WordPress REST API integration
- Authentication with regular credentials or application passwords
- Natural language processing of WordPress API requests
- OpenAI integration for advanced language understanding
- API endpoints for all WordPress resources:
- Posts
- Pages
- Media
- Users
- Categories
- Tags
- Comments
- Menus
- Custom Post Types
- Settings
- Plugins
- Support for custom/advanced WordPress REST API endpoints
- File uploads for media
- Error handling and security best practices
Prerequisites
- Node.js (v14+)
- npm or yarn
- WordPress site with REST API enabled
- OpenAI API key (for advanced natural language processing)
- (Optional) WordPress plugins:
- JWT Authentication for WP REST API (for token authentication)
- WP API Menus (for menu management)
- WP REST API - Custom Endpoints (for custom endpoints)
- WP REST API - Settings (for settings management)
- WP REST API - Plugin Extension (for plugin management)
Installation
- Clone the repository:
git clone <repository-url>
cd MCP-S
- Install dependencies:
npm install
- Create environment configuration:
cp .env.example .env
-
Edit the
.envfile with your WordPress site information. -
Create an uploads directory:
mkdir uploads
Usage
Start the server
Development mode:
npm run dev
Production mode:
npm start
API Endpoints
The server exposes the following endpoints:
Natural Language Processing
POST /api/wordpress/nlp- Process natural language request for WordPress operationsGET /api/wordpress/nlp- Process natural language request via query parameters
Example natural language requests:
- “Show me all published posts”
- “Create a new page titled ‘About Us’ with content ‘This is our company’”
- “Get user with ID 5”
- “List all categories”
- “Update post 123 to change the title to ‘New Title’”
- “Delete page 456”
Authentication
All endpoints require authentication parameters:
site_url: The WordPress site URLusername: WordPress username- Either
passwordorapp_password: Regular password or application password
These parameters can be passed as query parameters or in the request body.
Posts
GET /api/wordpress/posts- Get all postsGET /api/wordpress/posts/:id- Get a specific postPOST /api/wordpress/posts- Create a new postPUT /api/wordpress/posts/:id- Update a postDELETE /api/wordpress/posts/:id- Delete a post
Pages
GET /api/wordpress/pages- Get all pagesGET /api/wordpress/pages/:id- Get a specific pagePOST /api/wordpress/pages- Create a new pagePUT /api/wordpress/pages/:id- Update a pageDELETE /api/wordpress/pages/:id- Delete a page
Media
GET /api/wordpress/media- Get all mediaGET /api/wordpress/media/:id- Get a specific media itemPOST /api/wordpress/media- Upload a media fileDELETE /api/wordpress/media/:id- Delete a media item
Users
GET /api/wordpress/users- Get all usersGET /api/wordpress/users/:id- Get a specific userPOST /api/wordpress/users- Create a new userPUT /api/wordpress/users/:id- Update a userDELETE /api/wordpress/users/:id- Delete a user
Categories
GET /api/wordpress/categories- Get all categoriesGET /api/wordpress/categories/:id- Get a specific categoryPOST /api/wordpress/categories- Create a new categoryPUT /api/wordpress/categories/:id- Update a categoryDELETE /api/wordpress/categories/:id- Delete a category
Tags
GET /api/wordpress/tags- Get all tagsGET /api/wordpress/tags/:id- Get a specific tagPOST /api/wordpress/tags- Create a new tagPUT /api/wordpress/tags/:id- Update a tagDELETE /api/wordpress/tags/:id- Delete a tag
Comments
GET /api/wordpress/comments- Get all commentsGET /api/wordpress/comments/:id- Get a specific commentPOST /api/wordpress/comments- Create a new commentPUT /api/wordpress/comments/:id- Update a commentDELETE /api/wordpress/comments/:id- Delete a comment
Menus (requires WP API Menus plugin)
GET /api/wordpress/menus- Get all menusGET /api/wordpress/menus/:id- Get a specific menu
Settings (requires WP REST API - Settings plugin)
GET /api/wordpress/settings- Get all settingsPUT /api/wordpress/settings- Update settings
Plugins (requires WP REST API - Plugins Extension)
GET /api/wordpress/plugins- Get all pluginsGET /api/wordpress/plugins/:plugin- Get a specific pluginPUT /api/wordpress/plugins/:plugin/activate- Activate a pluginPUT /api/wordpress/plugins/:plugin/deactivate- Deactivate a plugin
Custom Post Types
GET /api/wordpress/custom/:type- Get all posts of a custom typeGET /api/wordpress/custom/:type/:id- Get a specific post of a custom typePOST /api/wordpress/custom/:type- Create a new post of a custom typePUT /api/wordpress/custom/:type/:id- Update a post of a custom typeDELETE /api/wordpress/custom/:type/:id- Delete a post of a custom type
Custom Endpoints
ALL /api/wordpress/custom/:endpoint- Make a request to a custom endpoint
Example Requests
Using the MCP Endpoint
# Using POST with JSON body (MCP standard format)
curl -X POST "http://localhost:3000/api/mcp" \
-H "Content-Type: application/json" \
-d '{
"messages": [
{"role": "user", "content": "Show me all published posts"}
]
}'
Using the Natural Language API (Legacy)
# Using POST with JSON body
curl -X POST "http://localhost:3000/api/wordpress/nlp" \
-H "Content-Type: application/json" \
-d '{
"site_url": "https://example.com",
"username": "admin",
"password": "password",
"query": "Show me all published posts"
}'
# Using GET with query parameters
curl -X GET "http://localhost:3000/api/wordpress/nlp?site_url=https://example.com&username=admin&password=password&query=List%20all%20categories"
Using the REST API directly
Get all posts
curl -X GET "http://localhost:3000/api/wordpress/posts?site_url=https://example.com&username=admin&password=password"
Create a new post
curl -X POST "http://localhost:3000/api/wordpress/posts" \
-H "Content-Type: application/json" \
-d '{
"site_url": "https://example.com",
"username": "admin",
"password": "password",
"title": "Hello World",
"content": "This is my first post!",
"status": "publish"
}'
Upload media
curl -X POST "http://localhost:3000/api/wordpress/media?site_url=https://example.com&username=admin&password=password" \
-F "file=@/path/to/image.jpg" \
-F "title=My Image"
License
MIT# Mise à jour le Mar 4 mar 2025 23:25:08 CET
EX request :
curl -X POST “http://localhost:3000/api/mcp”
-H “Content-Type: application/json”
-d “{
"messages": [
{
"role": "user",
"content": "Fais une requête GET sur /wp-json/wp/v2/pages/38 et montre-moi le contenu brut de la page"
}
],
"wordpress_credentials": {
"site_url": "https://jess-jeff.fr",
"username": "eyann",
"app_password": "w9Mf 8iLp 5LI4 fKaX 36MP Bq9y"
}
}”
Dev Tools Supporting MCP
The following are the main code editors that support the Model Context Protocol. Click the link to visit the official website for more information.










