WordPress MCP Server
@gopalcnepal
A Model Context Protocol (MCP) server for interacting with WordPress sites. This server provides tools to fetch posts, pages, categories, and site information from any WordPress installation with REST API enabled.
Overview
What is WordPress MCP Server?
A Model Context Protocol (MCP) server that provides tools to fetch posts, pages, categories, and site information from any WordPress installation with REST API enabled. It is intended for developers or AI assistants that need to interact programmatically with WordPress sites.
How to use WordPress MCP Server?
Install via UV, clone the repository, create a virtual environment, and install dependencies. Configure a .env file with WORDPRESS_URL. Start the server with uv run main.py and add the server’s configuration to Claude for Desktop’s claude_desktop_config.json. Tools include fetch_wordpress_info, fetch_posts, fetch_categories, fetch_posts_by_category, fetch_pages, fetch_post_by_id, and fetch_page_by_id.
Key features of WordPress MCP Server
- Fetches site info, posts, pages, and categories
- Supports filtering posts by category
- Retrieves individual posts and pages by ID
- Requires Python 3.13 and WordPress REST API enabled
- Uses UV for dependency management
- Includes error handling for network and API errors
Use cases of WordPress MCP Server
- An AI assistant retrieving recent blog posts from a WordPress site
- Listing all categories for content organization
- Getting a specific page by ID for editing or analysis
- Displaying site information during onboarding or diagnostics
- Fetching posts filtered by category for targeted summaries
FAQ from WordPress MCP Server
What prerequisites are needed?
Python 3.13, a WordPress site with REST API enabled, and the UV package installer (recommended).
How do I configure the server?
Create a .env file in the project root with the entry WORDPRESS_URL="https://your-wordpress-site.com".
What tools does the server provide?
Seven tools: fetch_wordpress_info, fetch_posts, fetch_categories, fetch_posts_by_category, fetch_pages, fetch_post_by_id, and fetch_page_by_id.
How do I integrate with Claude for Desktop?
Start the server with uv run main.py, then add a JSON entry to claude_desktop_config.json specifying the uv command and the path to the wordpress directory.
What error handling is included?
The server handles invalid JSON responses, network errors, WordPress API errors, and invalid URLs.