mcp-wordpress
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., "@mcp-wordpress list all pages on my WordPress site"
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.
mcp-wordpress
MCP server for WordPress REST API. Lets Claude Code read, edit, and manage WordPress pages, posts, shortcodes, and media — all from the CLI.
Works with any WordPress site, any theme, any set of plugins.
Features
80 tools covering content CRUD, Gutenberg blocks, direct-sale ads, classic menus/widgets, settings, Blocksy page layout, patterns, revisions, taxonomies, media, shortcode surgery, site diagnostics, and cache
Shortcode parser — reads, replaces, and inserts shortcodes without touching surrounding content
Gutenberg-native — addresses blocks by path, hash, anchor, metadata name, or explicit query and prevents ambiguous edits
Cache flush — clears Elementor CSS, WP object cache, and popular cache plugins (W3TC, LiteSpeed, WP Super Cache, WP Fastest Cache)
Zero config — just three env vars and you're connected
Related MCP server: WordPress MCP Server
Quick Start
1. Install
npx @leonardobora/mcp-wordpress
# or clone and run locally:
git clone https://github.com/leonardobora/mcp-wordpress.git
cd mcp-wordpress && npm install2. Create a WordPress Application Password
Log in to WordPress admin
Go to Users > Profile
Scroll to Application Passwords
Enter a name (e.g. "Claude Code") and click Add New Application Password
Copy the generated password (you won't see it again)
3. Register in your project
Add a .mcp.json to the root of your project:
{
"mcpServers": {
"wordpress": {
"command": "npx",
"args": ["-y", "@leonardobora/mcp-wordpress"],
"env": {
"WP_SITE_URL": "https://your-site.com",
"WP_USERNAME": "your-username",
"WP_APP_PASSWORD": "xxxx xxxx xxxx xxxx xxxx xxxx"
}
}
}
}Or if running from a local clone:
{
"mcpServers": {
"wordpress": {
"command": "node",
"args": ["path/to/mcp-wordpress/src/server.js"],
"env": {
"WP_SITE_URL": "https://your-site.com",
"WP_USERNAME": "your-username",
"WP_APP_PASSWORD": "xxxx xxxx xxxx xxxx xxxx xxxx"
}
}
}
}4. (Optional) Enable cache flush
Copy examples/mcp-wordpress-flush-cache.php to your WordPress wp-content/mu-plugins/ directory. This enables the wp_flush_cache tool.
If your site already has a custom cache flush endpoint, set the WP_FLUSH_ENDPOINT env var:
"env": {
"WP_FLUSH_ENDPOINT": "my-plugin/v1/flush-cache"
}Available Tools
Tool | Description |
| Site information and authenticated-user capabilities |
| Page CRUD with pagination and concurrency guards |
| Post CRUD, taxonomy assignment, scheduling and featured media |
| Category management |
| Tag management |
| Media library and featured-image operations |
| Gutenberg outlines and safe block addressing |
| Gutenberg mutations with structural diffs, hash guards, and normalization checks |
| Classic widget management, exact ordering, and structured ad creatives (including full-width placements) |
| Existing Blocksy Content Block slots; creation is intentionally unavailable to prevent orphan blocks |
| Revision history and restore with an honest core REST fallback |
| Classic menus and theme-location assignment |
| Classic menu item CRUD and ordering |
| Site settings and guarded static-front-page switching ( |
| Optional-companion control for a page-specific right, left, or absent Blocksy sidebar |
| Synced pattern CRUD |
| Read-only core/theme/plugin registered patterns |
| Parse and list all shortcodes in a page |
| Replace entire page content |
| Replace entire post content |
| Find and replace a specific shortcode in a page |
| Insert content before/after a shortcode |
| Reserved compatibility tools that currently fail explicitly; safe Elementor REST support is planned for v1.4 |
| Flush WordPress + Elementor + plugin caches |
Usage Examples
Once registered, Claude Code can:
> List all pages on the site
> Show me the shortcodes on the Home page
> Replace the hero title on the About page to "Our Story"
> Insert a testimonials section after the feature cards on the Home page
> What images do we have in the media library?
> Flush the cache for page #275How It Works
The server connects to the WordPress REST API using Basic Auth (Application Passwords). It exposes MCP tools that Claude Code can call to read and modify content.
For shortcode operations, the server includes a custom parser (shortcode-utils.js) that understands WordPress shortcode syntax — [tag attr="value"] and [tag]content[/tag] — enabling surgical find-and-replace without touching surrounding content.
The news-portal recipe in src/portal/home.js generates canonical Gutenberg sections for breaking news, category grids, latest posts, popularity, and up to three sponsors, plus an ordered sidebar recipe. Its Docker integration test applies the recipe through the registered MCP tools and verifies the resulting public HTML. Popularity is explicit: comments mode is labelled “Em alta por comentários”; “Mais vistas” requires a real view-provider shortcode.
Elementor _elementor_data is protected post meta and cannot be safely read or written through the core posts REST controller. The compatibility tools therefore fail explicitly instead of reporting false success.
All supported mutations accept dry_run:true. Set WP_MCP_DRY_RUN=1 to force previews globally. Set WP_MCP_CONFIRM_DESTRUCTIVE=1 to require a matching dry-run immediately before any permanent (force:true) deletion.
Security
Never commit
.envor Application Passwords to version controlApplication Passwords can be revoked at any time from WordPress admin
The server uses Basic Auth over HTTPS — ensure your site has SSL
Consider creating a dedicated WordPress user with Editor role (not Administrator) for tighter permissions
A page-scoped cache flush requires
edit_postfor that page; an explicit site-wide flush requiresedit_pages
Environment Variables
Variable | Required | Description |
| Yes | WordPress site URL (e.g. |
| Yes | WordPress username |
| Yes | Application Password |
| No | Custom REST endpoint for cache flush (default: |
| No | Set to |
| No | Set to |
Testing
Run unit, type, lint, and offline MCP smoke checks:
npm test
npm run typecheck
npm run lint
npm run test:smokeRun the isolated WordPress 6.8 + Blocksy integration suite with Docker:
npm run integration:up
WP_MCP_IT=1 npm run test:integration
npm run integration:downThe integration environment uses only project-scoped containers and named volumes. integration:down removes those test volumes.
What's New
Recent work brought the server from a single-file shortcode/Elementor tool to an 80-tool modular MCP server with a real WordPress test loop:
Modularized tools with dry-run support — split the monolithic server into per-domain tool modules (
src/tools/*.js) behind a shared registry (src/registry.js), and added opt-indry_runpreviews plus theWP_MCP_DRY_RUN/WP_MCP_CONFIRM_DESTRUCTIVEenv-var safeguards for destructive calls.Content CRUD and taxonomy tools — added full page/post create-update-delete and category/tag management, including idempotent
wp_ensure_category/wp_ensure_tag.Media management tools — added the media library and featured-image tool set (
wp_list_media,wp_upload_media,wp_update_media,wp_delete_media,wp_set_featured_image).Docker WordPress integration suite — added a project-scoped Docker Compose environment (
test/integration/) that provisions a real WordPress 6.8 + Blocksy site and runs end-to-end tests against it (WP_MCP_IT=1 npm run test:integration), wired into CI.Expanded tool coverage to 80 tools — added Gutenberg block, revision, widget, menu, settings, pattern, and Blocksy layout tools, plus companion REST endpoints for scoped cache purges and revision restore.
Gutenberg block and classic WordPress tools — added block parsing/addressing/transform helpers, shortcode helpers, ad-creative generation, and the news-portal recipe (
src/portal/home.js) that assembles canonical Gutenberg sections for breaking news, category grids, latest posts, popularity, and sponsors.Full-width ad creative blocks — extended the structured ad-creative helper (
src/blocks/ad.js) with afull_widthoption for edge-to-edge placements.
Acknowledgment
The expansion from a 14-tool server to the current 80-tool modular MCP server was authored by André Escocard (andreescocard) and merged in PR #1: tool registry, dry-run and destructive-operation safeguards, content/media/taxonomy tools, Gutenberg blocks, menus, widgets, revisions, patterns, settings, the Blocksy companion endpoints, the Docker WordPress integration suite, and CI/lint/typecheck coverage.
License
MIT
Available Tools
80 toolswp_blocks_deleteA
Delete one Gutenberg block. Hash references prevent overwriting a block changed since it was read. Supports dry-run.
Inputs: at (required), ref (required), dry_run, post_type, +2 more.
wp_blocks_findB
Find all matching Gutenberg blocks and return paths and hashes for safe follow-up edits.
Inputs: ref (required), query (required), post_type, include_html.
wp_blocks_getB
Get one Gutenberg block by path, hash, anchor, metadata name, or unambiguous query.
Inputs: at (required), ref (required), post_type, include_html.
wp_blocks_insertB
Insert Gutenberg block(s). Hash references prevent overwriting a block changed since it was read. Supports dry-run.
Inputs: at (required), ref (required), block (required), position (required), +4 more.
wp_blocks_listC
List a post/page Gutenberg outline. Use paths to read and hashes to edit.
Inputs: ref (required), depth, filter, post_type.
wp_blocks_moveA
Move one Gutenberg block relative to another. Hash references prevent overwriting a block changed since it was read. Supports dry-run.
Inputs: to (required), ref (required), from (required), position (required), +4 more.
wp_blocks_replaceA
Replace one Gutenberg block with zero or more blocks. Hash references prevent overwriting a block changed since it was read. Supports dry-run.
Inputs: at (required), ref (required), blocks (required), dry_run, +3 more.
wp_blocks_updateA
Update Gutenberg block attributes or inner HTML. Hash references prevent overwriting a block changed since it was read. Supports dry-run.
Inputs: at (required), ref (required), attrs, dry_run, +5 more.
wp_create_categoryC
Create a WordPress category.
Inputs: name (required), slug, parent, dry_run, +1 more.
wp_create_pageB
Create a WordPress page. Supports dry-run previews.
Inputs: title (required), slug, author, parent, +8 more.
wp_create_postB
Create a WordPress post. Supports dry-run previews.
Inputs: title (required), slug, tags, author, +8 more.
wp_create_synced_patternC
Create synced pattern. Supports dry-run.
Inputs: title (required), content (required), slug, status, +1 more.
wp_create_tagC
Create a WordPress tag.
Inputs: name (required), slug, dry_run, description.
wp_create_widgetB
Create a block widget. Supply exactly one of block_content or structured ad_creative. Supports dry-run and automatic cache purge when available.
Inputs: sidebar (required), dry_run, auto_purge, ad_creative, +1 more.
wp_delete_categoryB
Permanently delete a WordPress category.
Inputs: id (required), force, dry_run.
wp_delete_mediaA
Permanently delete a media attachment. WordPress requires force:true.
Inputs: id (required), force, dry_run.
wp_delete_pageA
Trash a WordPress page, or permanently delete it with force:true.
Inputs: ref (required), force, dry_run.
wp_delete_postA
Trash a WordPress post, or permanently delete it with force:true.
Inputs: ref (required), force, dry_run.
wp_delete_synced_patternC
Permanently delete a synced pattern.
Inputs: id (required), force, dry_run.
wp_delete_tagB
Permanently delete a WordPress tag.
Inputs: id (required), force, dry_run.
wp_delete_widgetA
Remove a widget. force:false moves it to wp_inactive_widgets; force:true permanently deletes it.
Inputs: id (required), force, dry_run.
wp_diff_revisionC
Compare the current raw content of a post/page with one revision.
Inputs: ref (required), revision_id (required), post_type.
wp_elementor_get_shortcode_contentC
Experimental and currently unavailable: Elementor protected meta is not exposed safely by WordPress REST.
Inputs: page_id (required).
wp_elementor_update_shortcode_contentA
Experimental and currently unavailable: direct _elementor_data writes are silently discarded by WordPress REST.
Inputs: page_id (required), new_content (required).
wp_ensure_categoryA
Return an existing category, or create it. Safe to call repeatedly.
Inputs: name (required), slug, parent, dry_run.
wp_ensure_tagA
Return an existing tag, or create it. Safe to call repeatedly.
Inputs: name (required), slug, dry_run.
wp_flush_cacheA
Flush WordPress, Elementor, and page caches. Requires the optional cache helper mu-plugin.
Inputs: dry_run, page_id.
wp_get_block_patternA
Get one registered read-only pattern by its exact namespace/name.
Inputs: name (required), include_content.
wp_get_content_blockA
Get one existing Blocksy Content Block by ID or slug with raw content and ad inventory metadata.
Inputs: ref (required).
wp_get_mediaA
Get a media attachment by ID.
Inputs: id (required).
wp_get_pageA
Get full content of a WordPress page by ID or slug. Returns raw content with shortcodes visible.
Inputs: id, ref, slug.
wp_get_postA
Get full content of a WordPress post by ID. Returns raw content.
Inputs: id, ref.
wp_get_revisionB
Get one post/page revision, including its raw title, excerpt, and content.
Inputs: ref (required), revision_id (required), post_type.
wp_get_settingsA
Read WordPress site settings, including static-front-page configuration.
Inputs: no named parameters.
wp_get_synced_patternA
Get a synced pattern with raw Gutenberg content.
Inputs: id (required).
wp_get_widgetB
Get a widget with rendered output, raw instance, sidebar, and advertisement metadata.
Inputs: id (required).
wp_insert_shortcodeC
Insert new content before or after an existing shortcode in a page.
Inputs: page_id (required), position (required), anchor_tag (required), new_content (required), +4 more.
wp_list_block_patternsB
List registered read-only core, theme, and plugin patterns; optionally filter client-side.
Inputs: search, source, category.
wp_list_categoriesC
List WordPress categories with IDs, slugs, and usage counts.
Inputs: page, parent, search, per_page, +1 more.
wp_list_content_blocksB
List existing Blocksy Content Blocks, including slug/hook clues and structured advertisement inventory. Does not create positioning slots.
Inputs: page, search, status, per_page.
wp_list_mediaA
List media files in the WordPress media library with URLs.
Inputs: page, search, per_page, mime_type, +1 more.
wp_list_pagesB
List WordPress pages with ID, title, slug and status.
Inputs: page, order, parent, search, +3 more.
wp_list_postsB
List WordPress posts with ID, title, slug and status.
Inputs: page, tags, order, author, +5 more.
wp_list_revisionsB
List revisions of a WordPress post or page with pagination.
Inputs: ref (required), page, per_page, post_type.
wp_list_shortcodesC
Parse and list all shortcodes found in a page's content. Useful for understanding page structure.
Inputs: page_id, page_slug, filter_tag.
wp_list_sidebarsA
List registered classic-theme sidebars and their ordered widget IDs.
Inputs: no named parameters.
wp_list_synced_patternsB
List reusable synced patterns stored in wp_block.
Inputs: page, order, search, status, +2 more.
wp_list_tagsB
List WordPress tags with IDs, slugs, and usage counts.
Inputs: page, search, per_page, hide_empty.
wp_list_widgetsB
List widgets, optionally by sidebar, including structured advertisement inventory metadata.
Inputs: sidebar.
wp_move_widgetB
Move and precisely order a widget in a sidebar. position is a zero-based final index.
Inputs: id (required), sidebar (required), position (required), dry_run.
wp_replace_shortcodeC
Find a specific shortcode in a page and replace it with new content. Optionally match an attribute value.
Inputs: tag (required), page_id (required), new_shortcode (required), dry_run, +3 more.
wp_restore_revisionC
Restore a revision. Prefers the optional wp-mcp companion endpoint; otherwise rewrites core REST title, excerpt, and content.
Inputs: ref (required), revision_id (required), dry_run, post_type, +1 more.
wp_set_blocksy_page_layoutB
Set a Blocksy page to a right sidebar, left sidebar, or no sidebar through the optional companion. Reads the current protected page option and supports dry-run.
Inputs: page_id (required), sidebar (required), dry_run.
wp_set_featured_imageB
Assign a media attachment as the featured image of a post or page.
Inputs: ref (required), media_id (required), dry_run, post_type.
wp_site_infoB
Get basic WordPress site information.
Inputs: no named parameters.
wp_update_categoryC
Update a WordPress category.
Inputs: id (required), name, slug, parent, +2 more.
wp_update_content_blockA
Update an existing positioned Blocksy Content Block. Supply exactly one of content or structured ad_creative. Never creates orphan slots.
Inputs: ref (required), content, dry_run, auto_purge, +1 more.
wp_update_mediaC
Update media attachment metadata.
Inputs: id (required), title, caption, dry_run, +2 more.
wp_update_pageB
Update selected fields on a WordPress page by ID or slug.
Inputs: ref (required), slug, title, author, +10 more.
wp_update_page_contentA
Replace the entire raw content of a WordPress page. Read the page first and pass its full replacement content.
Inputs: id (required), content (required), dry_run.
wp_update_postB
Update selected fields on a WordPress post by ID or slug.
Inputs: ref (required), slug, tags, title, +10 more.
wp_update_post_contentA
Replace the entire raw content of a WordPress post.
Inputs: id (required), content (required), dry_run.
wp_update_settingsC
Update WordPress settings. Changing the front page is site-wide and supports dry-run.
Inputs: email, title, dry_run, language, +16 more.
wp_update_synced_patternC
Update synced pattern. Supports dry-run.
Inputs: id (required), slug, title, status, +2 more.
wp_update_tagC
Update a WordPress tag.
Inputs: id (required), name, slug, dry_run, +1 more.
wp_update_widgetA
Update widget content and/or move it to another sidebar. Supply at most one of block_content or ad_creative. Supports dry-run.
Inputs: id (required), dry_run, sidebar, auto_purge, +2 more.
wp_upload_mediaB
Upload media from a local path, URL, or base64 source, then set attachment metadata.
Inputs: source (required), filename (required), post, title, +5 more.
wp_whoamiA
Show the authenticated WordPress user and granted capabilities. Useful for diagnosing 403 errors.
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 80 tools
Tools are generally organized around explicit resource+action pairs, so posts, pages, media, menus, widgets, blocks, patterns, and settings are easy to tell apart. A few edges could confuse an agent: wp_create_category vs wp_ensure_category have overlapping behavior, and the two Elementor tools are listed but marked unavailable. Overall, however, overlapping purposes are rare.
The dominant pattern is wp_verb_noun (wp_list_posts, wp_create_menu, wp_delete_media) and most tools follow it predictably. The wp_blocks_* family breaks the pattern by placing the noun before the verb (wp_blocks_list, wp_blocks_update), and plugin-prefixed tools like wp_elementor_update_shortcode_content add a module prefix. These are readable deviations, not chaotic naming.
80 tools is far beyond the comfortable agent-facing range and imposes heavy selection overhead even though the WordPress domain is broad. Several families (blocks, menus, widgets, patterns) could be consolidated with parameterized operations, and the two unavailable Elementor tools should not be included. As a set, it feels more like a full SDK surface than a curated MCP toolkit.
The content lifecycle is unusually thorough: posts, pages, media, terms, revisions, blocks, patterns, widgets, menus, and settings all have meaningful CRUD coverage. However, WordPress's core comments and user-management surfaces are absent, and the Elementor tools are dead ends because they are explicitly unavailable. That makes the set broad but uneven rather than complete.
Related MCP Connectors
Manage WordPress blogs and WooCommerce shops from Claude, ChatGPT, Cursor and other MCP apps.
Manage your WordPress site from ChatGPT or Claude: posts, WooCommerce, SEO, images and upkeep.
Manage your WordPress site from your AI assistant: posts, pages, media, comments and WooCommerce.
Read, write, translate and sync WordPress and Webflow blog articles from Claude.
Related MCP Servers
- AlicenseBqualityDmaintenanceConnects Claude to WordPress sites through the REST API, enabling AI-assisted content creation, publishing, media management, user administration, and site maintenance tasks through natural language.4723MIT
- AlicenseNot gradedqualityCmaintenanceEnables Claude Code to directly manage WordPress sites via natural language, including posts, pages, categories, tags, media, and multiple site support.MIT
- FlicenseAqualityCmaintenanceEnables Claude to read context, create, and edit pages on WordPress sites via the REST API using Application Passwords.6-
- AlicenseAqualityDmaintenanceEnables direct interaction with WordPress sites via Claude using the REST API, allowing reading, creating, updating, and deleting content securely with application passwords.20MIT