Skip to content

oumarkonate/wordpress_manager

Repository files navigation

WordPress Manager MCP

A Model Context Protocol (MCP) server that exposes your WordPress site to any MCP-compatible AI assistant (Claude, etc.) via the WordPress REST API — 44 tools, zero extra plugins required.

Features

Manage your WordPress site through natural language:

  • Posts — list, get, create, update, delete, schedule (via date), revisions, autosaves, metadata
  • Pages — list, get, create, update, delete, schedule
  • Media — list, get, upload files, update metadata, delete, set featured image
  • Categories — list, create, update, delete
  • Tags — list, create, update, delete
  • Comments — list, get single, moderate
  • Users — list, get
  • Site settings — title, tagline, timezone, language and more (read-only)
  • Discovery — search, all taxonomies, all post statuses, registered post types
  • Navigation — menus, menu items (WordPress 5.9+)
  • Plugins & Themes — list installed plugins and themes (read-only, admin only)
  • Widgets — sidebars and active widgets (WordPress 5.8+)

Available tools (44)

Posts

Tool Description
list_posts List posts with filters (status, search, category, tag, pagination)
get_post Get a single post by ID (includes full content)
create_post Create a post — title, content, status, categories, tags, slug, date
update_post Update any field of an existing post (sparse update)
delete_post Move to trash or permanently delete a post
list_revisions List saved revisions for a post
list_autosaves List autosave drafts for a post
list_post_meta List custom metadata fields for a post (requires show_in_rest=True)

Pages

Tool Description
list_pages List pages with filters
get_page Get a single page by ID
create_page Create a page — title, content, status, parent, slug, date
update_page Update any field of an existing page (sparse update)
delete_page Move to trash or permanently delete a page

Media

Tool Description
list_media List media library items with filters
get_media Get a single media item by ID
upload_media Upload a local file to the media library (image, video, PDF…)
update_media Update media title, alt text, caption, or description
delete_media Permanently delete a media item
set_featured_image Set the featured image of a post or page by media ID

Categories

Tool Description
list_categories List categories with optional search filter
create_category Create a new category
update_category Update name, description, slug, or parent of a category
delete_category Permanently delete a category

Tags

Tool Description
list_tags List tags with optional search filter
create_tag Create a new tag
update_tag Update name, description, or slug of a tag
delete_tag Permanently delete a tag

Comments

Tool Description
list_comments List comments with filters (post, status, search)
get_comment Get a single comment by ID
moderate_comment Approve, hold, mark as spam, or delete a comment

Users

Tool Description
list_users List users with optional filters (search, roles)
get_user Get a single user by ID

Site & Discovery

Tool Description
get_site_info Retrieve general site metadata (name, URL, timezone…)
get_settings Get site settings (title, tagline, timezone, language, posts per page…)
list_post_types List all registered post types
list_taxonomies List all registered taxonomies (category, post_tag, custom…)
list_statuses List all available post statuses (publish, draft, pending, future…)
search Full-text search across posts, pages, and other content

Navigation (WordPress 5.9+)

Tool Description
list_menus List all navigation menus
list_menu_items List navigation menu items (filterable by menu ID)

Plugins & Themes (admin required)

Tool Description
list_plugins List installed plugins with active/inactive status
list_themes List installed themes with active/inactive status

Widgets (WordPress 5.8+)

Tool Description
list_sidebars List registered widget areas (sidebars)
list_widgets List active widgets (filterable by sidebar)

Requirements

  • Python 3.10+
  • A WordPress site with the REST API enabled (enabled by default since WordPress 4.7)
  • A WordPress Application Password for authentication (WordPress 5.6+, requires HTTPS)

Quick start

git clone https://github.com/oumarkonate/wordpress_manager.git
cd wordpress_manager
python3 -m venv .venv
source .venv/bin/activate      # Windows: .venv\Scripts\activate
pip install -r requirements.txt
cp .env.example .env
# Edit .env with your site URL and credentials
python -m wordpress_manager

See SETUP.md for detailed installation and configuration instructions.

Configuration

Copy .env.example to .env and fill in your credentials:

WP_URL=https://yoursite.com/wp-json/wp/v2
WP_LOGIN=your@email.com
WP_PASSWORD=xxxx xxxx xxxx xxxx xxxx xxxx
WP_ALLOW_DELETE=false
Variable Required Default Description
WP_URL yes WordPress REST API base URL — must end with /wp-json/wp/v2
WP_LOGIN yes WordPress username or email
WP_PASSWORD yes WordPress Application Password (xxxx xxxx xxxx xxxx xxxx xxxx)
WP_ALLOW_DELETE no false Set to true to allow deletion of posts, pages, media, categories, and tags. Blocked by default.

Never commit your .env file — it contains sensitive credentials. It is listed in .gitignore.

Safety note: WP_ALLOW_DELETE=false (the default) prevents all destructive operations. Keep it disabled unless you explicitly need to delete content.

Scheduling posts and pages

Pass an ISO 8601 date with status="future" to schedule content for later publication:

create_post(title="My article", content="...", status="future", date="2026-12-01T09:00:00")

Project structure

wordpress_manager/
├── .env.example                              # Configuration template
├── requirements.txt                          # Python dependencies
├── __main__.py                               # Entry point
├── server.py                                 # MCP server — tool registration
├── config.py                                 # Settings loaded from environment
├── lib/
│   └── wp_client.py                          # HTTP client wrapping the WP REST API
└── tools/                                    # One file per MCP tool
    ├── common.py                             # Pydantic models and parsers
    ├── get_post.py, list_posts.py, ...       # Post tools
    ├── get_page.py, list_pages.py, ...       # Page tools
    ├── upload_media.py, list_media.py, ...   # Media tools
    └── ...

Usage with Claude Code / Claude Desktop

Add the following to your MCP config (.mcp.json for Claude Code, or claude_desktop_config.json for Claude Desktop).

Linux / macOS

{
  "mcpServers": {
    "wordpress_manager": {
      "command": "/absolute/path/to/wordpress_manager/.venv/bin/python3",
      "args": ["-m", "wordpress_manager"],
      "env": {
        "PYTHONPATH": "/absolute/path/to"
      }
    }
  }
}

Windows

{
  "mcpServers": {
    "wordpress_manager": {
      "command": "C:\\path\\to\\wordpress_manager\\.venv\\Scripts\\python.exe",
      "args": ["-m", "wordpress_manager"],
      "env": {
        "PYTHONPATH": "C:\\path\\to"
      }
    }
  }
}

PYTHONPATH must point to the parent directory of wordpress_manager/. Credentials are loaded from .env automatically — do not put them in this config.

Ready-to-copy templates: claude_desktop_config.json.linux.example and claude_desktop_config.json.windows.example.

License

MIT

About

A Model Context Protocol (MCP) server that exposes your WordPress site to any MCP-compatible AI assistant (Claude, etc.) via the WordPress REST API.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages