Provides tools for managing WordPress content through the REST API, including operations for posts, pages, users, plugins, and custom post types with support for creating, reading, updating, and deleting content.
WordPressMCP Server
Minimal MCP server that exposes WordPress REST tools over stdio. It supports
posts, pages, users, plugins, and dynamic CPT routing via type/post_type.
Requirements
Node.js 18+ (fetch API required)
WordPress Application Password
Setup
Install dependencies:
Create a
.envfile (see.env.example):
Run the server:
MCP Host Config (config.toml)
If your AI host uses a config.toml to register MCP servers, add an entry like:
If your host does not support inline env, configure it to load .env or set
WP_URL, WP_USER, and WP_APP_PASS in the process environment.
Notes
The server uses the stdio transport, so run it under your MCP host.
For custom post types, pass
typeorpost_typewith the CPT slug or REST base. Example:type: "announcement"routes to/wp-json/wp/v2/announcement.create_postalso supportsstatusoverrides likeannouncement:draftto target a CPT without a separatetypearg.
Sponsorship
If this project helps, consider supporting it:
Project Layout
server.mjs: entrypoint, tool registrationsrc/config.mjs: env parsing and validationsrc/wpClient.mjs: WordPress REST clientsrc/wpUtils.mjs: query/form helpers and post-type parsingsrc/postTypeResolver.mjs: cached CPT resolversrc/tools/: tool registration modules