wp-mcp-server
Connects to any WordPress site via its REST API (authenticated with Application Passwords) to list, retrieve, create, and update pages, and — with the bundled wp-mcp-theme-bridge plugin — inspect a page path's real rendered theme name, stylesheets, scripts, inline CSS/JS, and fetch the raw content of same-origin CSS/JS assets.
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., "@wp-mcp-server inspect my homepage's rendered CSS and update the page to match the theme"
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.
wp-mcp-server
An MCP (Model Context Protocol) server that lets an AI design agent connect to any WordPress site, inspect its real rendered CSS/JS/theme, and create/update pages. It is a standalone, reusable server — nothing in it is tied to a specific WordPress install; the target site is configured entirely through environment variables at runtime.
It combines two things:
WordPress's native REST API (
wp/v2/pages), authenticated with Application Passwords.A small companion plugin,
wp-mcp-theme-bridge(bundled in this repo underwordpress-plugin/wp-mcp-theme-bridge/), that exposes two extra read-only routes (wp-mcp-bridge/v1/theme-stylesandwp-mcp-bridge/v1/asset-content) so the agent can see exactly which CSS/JS a page actually renders — theme-agnostic, since it parses the real rendered HTML instead of relying ontheme.json(many themes, including Astra, resolve colors at PHP runtime, not in static files).
Prerequisites
Node.js >= 18 (for global
fetch)A WordPress site with:
Application Passwords enabled (WordPress core, no plugin needed for the page tools)
The
wp-mcp-theme-bridgeplugin installed and activated, if you wantget_theme_styles/get_asset_contentto work (see below)
Related MCP server: wp-mcp
Installing the WordPress-side plugin
get_theme_styles and get_asset_content need wp-mcp-theme-bridge running on the target
WordPress site — it's a regular plugin (not a must-use/mu-plugins one), so it needs manual
activation like any other plugin:
Copy
wordpress-plugin/wp-mcp-theme-bridge/from this repo into that site'swp-content/plugins/directory (git, SFTP, your host's file manager — whatever you already use to deploy). The folder must keep its name (wp-mcp-theme-bridge/) withwp-mcp-theme-bridge.phpdirectly inside it.In
wp-admin → Plugins, find WP MCP Theme Bridge and activate it.Verify it:
curl -H "Authorization: Basic <base64 user:app-password>" "https://your-site.com/wp-json/wp-mcp-bridge/v1/theme-styles?path=/"should return JSON, not a 404.
The four page tools (list_pages, get_page, create_page, update_page) work without this
plugin — it's only required for the two theme-inspection tools.
Install & build
cd mcp-server
npm install
npm run buildThis compiles src/ to dist/. npm start runs the built server (dist/index.js) directly over
stdio — this is what an MCP client will actually spawn.
Generating a WordPress Application Password
Log into
wp-adminas a user with theedit_pagescapability (e.g. an Editor or Administrator).Go to Users → Profile.
Scroll to Application Passwords, give it a name (e.g.
wp-mcp-server), and click Add New Application Password.Copy the generated password immediately — WordPress only shows it once. It's fine to keep the spaces WordPress displays it with; Basic Auth works either way.
Configuration (environment variables)
Variable | Description |
| Base URL of the WordPress site, no trailing slash (e.g. |
| WordPress username to authenticate as |
| The Application Password generated above |
Copy .env.example to .env and fill it in for local development (.env is git-ignored and is
not read automatically by the built server — it's there for your own tooling/reference; pass
the variables through your process environment or your MCP client's env config, as shown below).
The server validates these three variables at startup and exits with a clear error message if any is missing.
Registering with an MCP client
From a local checkout (development)
{
"mcpServers": {
"wordpress": {
"command": "node",
"args": ["/absolute/path/to/wp-mcp-server/dist/index.js"],
"env": {
"WORDPRESS_URL": "http://localhost:8080",
"WORDPRESS_USERNAME": "your-wp-username",
"WORDPRESS_APP_PASSWORD": "your-application-password"
}
}
}
}Point args at the built dist/index.js for the WordPress site you want this instance of the
server to manage. To manage a different site, register another entry with different env values
— the server itself is stateless and reusable.
Straight from GitHub (no local checkout, no npm registry)
This package isn't published to the npm registry. Any MCP client that can run a command can still
add it directly from the git repository — npx clones it, installs dependencies, runs prepare
(which builds dist/), then runs the bin entry, all in one shot:
{
"mcpServers": {
"wordpress": {
"command": "npx",
"args": ["-y", "github:eimon/wp-mcp"],
"env": {
"WORDPRESS_URL": "https://your-site.example.com",
"WORDPRESS_USERNAME": "your-wp-username",
"WORDPRESS_APP_PASSWORD": "your-application-password"
}
}
}
}With the Claude Code CLI specifically:
claude mcp add wordpress-<site-name> \
-e WORDPRESS_URL=https://your-site.example.com \
-e WORDPRESS_USERNAME=your-wp-username \
-e WORDPRESS_APP_PASSWORD='xxxx xxxx xxxx xxxx xxxx xxxx' \
-- npx -y github:eimon/wp-mcpPin to a tag or commit (github:eimon/wp-mcp#v0.1.0) once you cut a release, so a client's config
doesn't silently pick up unreleased changes from the default branch.
Available tools
Tool | Description |
| List/search WordPress pages ( |
| Fetch a single page by ID |
| Create a new page ( |
| Update an existing page by ID (same fields as create, all optional) |
| Inspect a page path's real rendered theme name, stylesheets, scripts, inline CSS/JS |
| Fetch the raw text content of a same-origin CSS/JS asset URL |
Verifying it works: the smoke test
There's no human clicking through this — scripts/smoke-test.ts is the verification. It spawns
the built server as a child process using the official MCP SDK's Client + StdioClientTransport,
calls tools/list, then exercises get_theme_styles and list_pages against a real WordPress
instance:
npm run build
WORDPRESS_URL=http://localhost:8080 \
WORDPRESS_USERNAME=your-wp-username \
WORDPRESS_APP_PASSWORD=your-application-password \
npm run smoke-testIt exits non-zero and prints the failure if any tool errors or an expected shape isn't found.
Troubleshooting
Silent rest_not_logged_in / 401 errors despite correct credentials
On a non-HTTPS WordPress site, Application Passwords are silently disabled unless
wp_get_environment_type() returns 'local' — WordPress core requires
is_ssl() || wp_get_environment_type() === 'local' before it will accept them
(wp_is_application_passwords_supported()). If you point this server at your own local
(non-HTTPS) WordPress install and get 401 rest_not_logged_in even though the username and
Application Password are correct, this is almost certainly the cause.
Fix it by setting the environment type to local, e.g. in wp-config.php:
define( 'WP_ENVIRONMENT_TYPE', 'local' );(or the equivalent WORDPRESS_CONFIG_EXTRA env var if you're running the official
wordpress Docker image.)
get_theme_styles / get_asset_content return 404
These two tools depend on the wp-mcp-theme-bridge plugin (bundled in this repo under
wordpress-plugin/) being installed and activated on the target site — see "Installing the
WordPress-side plugin" above. If it isn't, only the four page tools (list_pages, get_page,
create_page, update_page) will work.
403 / capability errors
Both bridge routes and the page-write routes require the authenticated user to have the
edit_pages capability (Editor role or above). Application Passwords authenticate as that
WordPress user, so permissions follow normal WordPress role rules.
Available Tools
6 toolscreate_pageCreate a WordPress pageA
Create a new page via POST /wp-json/wp/v2/pages. content is an HTML string. Requires edit_pages capability on the authenticated user.
Inputs: title (required), content (required), meta, status.
get_asset_contentGet the raw content of a theme CSS/JS assetA
Fetch the raw text content of a CSS or JS asset URL discovered via get_theme_styles. The URL must belong to the same host as the connected WordPress site (enforced server-side as a basic SSRF guard). Calls the site-local wp-mcp-bridge/v1 REST route.
Inputs: url (required).
get_pageGet a WordPress pageA
Fetch a single page by ID via GET /wp-json/wp/v2/pages/?context=edit. Returns both content.rendered (compiled HTML/output) and content.raw (the actual stored source — e.g. real Fusion Builder shortcodes on an Avada site, or Gutenberg block markup) — use content.raw to learn a site's real authoring syntax before writing new content.
Inputs: id (required).
get_theme_stylesGet a page's real rendered theme stylesA
Inspect the actual rendered HTML of a page path on the connected WordPress site and return its theme name plus the stylesheet URLs, script URLs, inline CSS and inline JS it really loads. Theme-agnostic: works by parsing the rendered HTML rather than relying on theme.json, so it reflects what a browser truly receives (colors resolved by PHP at runtime, page-builder output, etc). Calls the site-local wp-mcp-bridge/v1 REST route.
Inputs: path.
list_pagesList WordPress pagesA
List/search pages on the connected WordPress site via GET /wp-json/wp/v2/pages. Supports search, pagination and status filtering.
Inputs: page, search, status, per_page.
update_pageUpdate a WordPress pageA
Update an existing page via POST /wp-json/wp/v2/pages/. Only the fields provided are sent; omit a field to leave it unchanged.
Inputs: id (required), meta, title, status, +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Each tool targets a distinct resource and action: list/get/create/update for pages, and get_theme_styles/get_asset_content for inspecting page-rendered assets. There is no overlap or ambiguity between any of the six tools.
All tool names follow a consistent verb_noun pattern: list_pages, get_page, create_page, update_page, get_theme_styles, get_asset_content. Naming conventions are uniform and predictable.
Six tools is a well-scoped size for this server's purpose, covering page operations and theme asset inspection without redundancy. Each tool earns its place and the set is not too thin or bloated.
The page CRUD covers list, get, create, and update, but notably omits delete_page, which is a significant gap in lifecycle management. The theme style and asset tools cover their niche well, but the missing delete operation prevents full page lifecycle management.
Maintenance
Related MCP Connectors
Manage a WordPress site from your AI assistant: read, search, propose edits, Search Console data.
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.
Related MCP Servers
- AlicenseCqualityDmaintenanceEnables AI agents to manage WordPress sites with 190+ tools for content management, theme/plugin customization, file system operations, WooCommerce, and complete site control through natural language.10029 npm56MIT
- AlicenseNot gradedqualityDmaintenanceConnects WordPress sites to AI agents, enabling content management through natural language commands via the WordPress REST API.20 npm2MIT
- FlicenseNot gradedqualityDmaintenanceEnables AI agents to manage WordPress sites via ~74 capabilities including content, media, plugins, themes, and more.-
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to manage WordPress sites through the WordPress REST API, supporting content, media, users, settings, and Elementor management with safety policies for production use.MIT