WordPress MCP Python
Provides tools for managing WooCommerce products and orders.
Provides tools for managing WordPress sites via REST API, including posts, pages, categories, tags, users, media, and settings.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@WordPress MCP Python create a new draft post titled 'My First Post'"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
WordPress MCP Python
A lightweight standalone Python MCP server that connects to WordPress via REST API.
Features
Standalone Python package - Runs independently, no WordPress plugin needed
Easy setup with
pip installFull WordPress REST API support: Posts, Pages, Categories, Tags, Users, Media, Settings
WooCommerce support: Products, Orders (optional)
MCP SDK integration for Claude Desktop
Async/await for better performance
Related MCP server: MCP WordPress Server
Requirements
Python 3.8+
WordPress site with REST API enabled
Application Password or JWT token
Installation
From PyPI (recommended)
pip install wordpress-mcpFrom source
git clone https://github.com/tannht/wordpress-mcp-python.git
cd wordpress-mcp-python
pip install -e .Configuration
1. Get WordPress Application Password
Go to WordPress Admin → Users → Profile
Scroll down to Application Passwords
Create a new one (name it "MCP")
Copy the generated password
Format: abcd-efgh-ijkl-mnop (4 groups of 4 chars)
2. Set Environment Variables
export WP_URL="https://yoursite.com"
export WP_USERNAME="your_username"
export WP_PASSWORD="your_application_password"Or use JWT token:
export WP_URL="https://yoursite.com"
export WP_JWT_TOKEN="your_jwt_token"Usage
As a Library
import asyncio
from wordpress_mcp import WordPressClient
async def main():
client = WordPressClient(
base_url="https://yoursite.com",
username="your_username",
password="your_app_password"
)
# Create a post
post = await client.create_post(
title="Hello from Python!",
content="This post was created via Python MCP.",
status="draft"
)
print(f"Created post: {post['id']}")
asyncio.run(main())As MCP Server (for Claude Desktop)
# Run the MCP server
python -m wordpress_mcpClaude Desktop Integration
Add to your Claude Desktop config:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"wordpress": {
"command": "python",
"args": ["-m", "wordpress_mcp"],
"env": {
"WP_URL": "https://yoursite.com",
"WP_USERNAME": "your_username",
"WP_PASSWORD": "your_application_password"
}
}
}
}Docker
Build and run the MCP server using Docker:
# Build and start the server
docker compose up -d --build
# View logs
docker compose logs -f
# Stop the server
docker compose downThe server runs on stdio transport and connects to WordPress via REST API.
Environment Variables
Create a .env file in the project root:
WP_URL=https://yoursite.com
WP_USERNAME=your_username
WP_PASSWORD=your_application_password
# Or use JWT token
# WP_JWT_TOKEN=your_jwt_tokenClaude Code Integration
Add the WordPress MCP server to Claude Code:
claude mcp add --transport stdio wordpress \
--env WP_URL=https://yoursite.com \
--env WP_USERNAME=your_username \
--env WP_PASSWORD=your_application_password \
-- wordpress-mcpVerify connection:
claude mcp listMCP Tools Available
Posts
wp_posts_search- Search posts with paginationwp_get_post- Get post by IDwp_add_post- Create new postwp_update_post- Update postwp_delete_post- Delete post
Pages
wp_pages_search- Search pageswp_get_page- Get page by IDwp_add_page- Create new page
Categories
wp_list_categories- List all categorieswp_add_category- Add new category
Tags
wp_list_tags- List all tagswp_add_tag- Add new tag
Users
wp_users_search- Search userswp_get_user- Get user by ID
Media
wp_media_search- Search media items
Settings
wp_get_site_info- Get site informationwp_get_settings- Get site settings
WooCommerce (optional)
wc_products_search- Search productswc_get_product- Get product by IDwc_add_product- Create productwc_orders_search- Search orderswc_get_order- Get order by ID
Development
Setup Development Environment
# Install with dev dependencies
pip install -e ".[dev]"
# Run tests
pytest
# Run tests with coverage
pytest --cov=wordpress_mcp
# Format code
black src/ tests/
# Lint
ruff check src/ tests/Project Structure
wordpress-mcp-python/
├── pyproject.toml # Project metadata, dependencies
├── README.md
├── .gitignore
├── src/
│ └── wordpress_mcp/
│ ├── __init__.py # Package init, entry point
│ ├── client.py # WordPress REST API client
│ └── server.py # MCP server implementation
├── tests/
│ ├── __init__.py
│ ├── conftest.py # Pytest fixtures
│ └── test_client.py # Client tests
└── scripts/
└── test_connection.py # Connection test scriptTroubleshooting
Connection refused
Make sure WordPress REST API is enabled
Check your site URL is correct (include https://)
Authentication failed
Verify Application Password is correct
Ensure username has proper permissions
Import errors
Check Python version (3.8+ required)
Install with
pip install -e .for development
Comparison: Python vs PHP
Feature | Python MCP | PHP Plugin |
Installation | pip install | Upload plugin |
Size | ~50KB | ~160KB |
Dependencies | mcp, httpx, pyjwt | firebase/php-jwt |
Location | Runs anywhere | Must be in WordPress |
Update | git pull | Plugin update |
License
MIT
Credits
Based on WordPress MCP by Automattic.
Available Tools
49 toolswc_add_productC
Add a WooCommerce product
Inputs: name (required), status, sale_price, description, +2 more.
wc_add_product_brandC
Add a WooCommerce product brand
Inputs: name (required), slug, description.
wc_add_product_categoryC
Add a WooCommerce product category
Inputs: name (required), slug, parent, description.
wc_add_product_tagC
Add a WooCommerce product tag
Inputs: name (required), slug, description.
wc_delete_productC
Delete a WooCommerce product
Inputs: id (required), force.
wc_delete_product_brandC
Delete a WooCommerce product brand
Inputs: id (required), force.
wc_delete_product_categoryC
Delete a WooCommerce product category
Inputs: id (required), force.
wc_delete_product_tagC
Delete a WooCommerce product tag
Inputs: id (required), force.
wc_get_orderC
Get WooCommerce order by ID
Inputs: id (required).
wc_get_productB
Get WooCommerce product by ID
Inputs: id (required).
wc_list_product_brandsC
List WooCommerce product brands
Inputs: page, per_page.
wc_list_product_categoriesC
List WooCommerce product categories
Inputs: page, per_page.
wc_list_product_tagsC
List WooCommerce product tags
Inputs: page, per_page.
wc_orders_searchC
Search WooCommerce orders
Inputs: page, status, per_page.
wc_products_searchC
Search WooCommerce products
Inputs: page, search, per_page.
wc_update_productC
Update a WooCommerce product
Inputs: id (required), name, status, sale_price, +3 more.
wc_update_product_brandC
Update a WooCommerce product brand
Inputs: id (required), name, slug, description.
wc_update_product_categoryC
Update a WooCommerce product category
Inputs: id (required), name, slug, parent, +1 more.
wc_update_product_tagC
Update a WooCommerce product tag
Inputs: id (required), name, slug, description.
wp_add_categoryC
Add a new WordPress category
Inputs: name (required), slug, parent, description.
wp_add_mediaC
Upload a media file to WordPress
Inputs: file_path (required), title, alt_text.
wp_add_pageC
Add a new WordPress page
Inputs: title (required), content (required), status.
wp_add_postC
Add a new WordPress post
Inputs: title (required), content (required), status, excerpt.
wp_add_tagC
Add a new WordPress tag
Inputs: name (required), slug, description.
wp_add_userC
Add a new WordPress user
Inputs: email (required), username (required), role, password, +2 more.
wp_delete_categoryB
Delete a WordPress category
Inputs: id (required).
wp_delete_mediaC
Delete a WordPress media item
Inputs: id (required), force.
wp_delete_pageC
Delete a WordPress page by ID
Inputs: id (required).
wp_delete_postB
Delete a WordPress post by ID
Inputs: id (required).
wp_delete_tagD
Delete a WordPress tag
Inputs: id (required).
wp_delete_userC
Delete a WordPress user
Inputs: id (required), reassign.
wp_get_mediaC
Get a WordPress media item by ID
Inputs: id (required).
wp_get_pageC
Get a WordPress page by ID
Inputs: id (required).
wp_get_postC
Get a WordPress post by ID
Inputs: id (required).
wp_get_settingsB
Get WordPress site settings
Inputs: no named parameters.
wp_get_site_infoC
Get WordPress site information
Inputs: no named parameters.
wp_get_userC
Get a WordPress user by ID
Inputs: id (required).
wp_list_categoriesB
List all WordPress categories
Inputs: no named parameters.
wp_list_tagsB
List all WordPress tags
Inputs: no named parameters.
wp_media_searchC
Search WordPress media items
Inputs: page, per_page.
wp_pages_searchC
Search and filter WordPress pages
Inputs: page, search, per_page.
wp_posts_searchC
Search and filter WordPress posts with pagination
Inputs: page, search, status, per_page.
wp_update_categoryC
Update a WordPress category
Inputs: id (required), name, slug, parent, +1 more.
wp_update_pageC
Update a WordPress page by ID
Inputs: id (required), title, status, content.
wp_update_postC
Update a WordPress post by ID
Inputs: id (required), title, status, content, +1 more.
wp_update_settingsC
Update WordPress site settings
Inputs: url, email, title, description.
wp_update_tagC
Update a WordPress tag
Inputs: id (required), name, slug, description.
wp_update_userC
Update a WordPress user
Inputs: id (required), role, email, username, +2 more.
wp_users_searchC
Search WordPress users
Inputs: page, per_page.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 49 tools
Each tool targets a distinct resource (post, page, category, tag, user, media, settings, product, order) and action (search, get, add, update, delete, list), with clear wp_ vs wc_ prefixes separating WordPress and WooCommerce. No two tools appear to serve the same purpose.
The naming follows a consistent prefix_verb_noun pattern (e.g., wp_get_post, wc_add_product) with clear prefixes for WordPress (wp_) and WooCommerce (wc_). A minor deviation is that search operations use plural nouns (wp_posts_search, wc_products_search) while other operations use singular (wp_get_post, wc_get_product).
49 tools is excessive; even for a dual-domain server covering WordPress and WooCommerce, many operations could be consolidated (e.g., generic resource tools or grouped endpoints). The surface is heavy and increases cognitive load for an agent.
Core CRUD is well-covered for posts, pages, categories, tags, users, media, products, and product taxonomies, but notable gaps exist: WooCommerce orders lack create/update/delete, media has no update, and comments, custom post types, and order refunds are missing. These gaps will hinder full lifecycle management.
Maintenance
Related MCP Connectors
WordPress MCP server: generate SEO posts, AI images, autoblog & WooCommerce on your self-hosted site
WordPress MCP server: publish posts, AI images, SEO and full site management, self-hosted
Free MCP server for WordPress: Claude and ChatGPT connect with OAuth. No account, cap or API key.
Manage WordPress blogs and WooCommerce shops from Claude, ChatGPT, Cursor and other MCP apps.
Related MCP Servers
- FlicenseBqualityDmaintenanceLocal MCP server for Codex/Claude to query and edit WordPress content through the WordPress REST API.26-
- AlicenseBqualityDmaintenanceComprehensive MCP server to manage WordPress sites via natural language, enabling content creation, SEO, and multi-site administration through AI tools like Claude Desktop.701,709 npmMIT
- FlicenseNot gradedqualityDmaintenanceA Model Context Protocol (MCP) server that bridges AI assistants to WordPress, enabling natural-language management of posts, pages, media, comments, users, plugins, and settings across multiple sites simultaneously.1-
- AlicenseNot gradedqualityCmaintenanceMCP server for WordPress content management via REST API, supporting posts, pages, media, comments, and terms through natural language interfaces like Cursor, ChatGPT, Codex, and Claude.14 npmMIT