Skip to main content
Glama

WordPressMCP Server

Buy Me a Coffee

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

  1. Install dependencies:

npm install
  1. Create a .env file (see .env.example):

WP_URL="https://your-site.example" WP_USER="your-username" WP_APP_PASS="xxxx xxxx xxxx xxxx xxxx xxxx"
  1. Run the server:

npm start

MCP Host Config (config.toml)

If your AI host uses a config.toml to register MCP servers, add an entry like:

[mcp.servers.WordPressMCP] command = "node" args = ["/absolute/path/to/server.mjs"] env = { WP_URL = "https://your-site.example", WP_USER = "your-username", WP_APP_PASS = "xxxx xxxx xxxx xxxx xxxx xxxx" }

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 type or post_type with the CPT slug or REST base. Example: type: "announcement" routes to /wp-json/wp/v2/announcement.

  • create_post also supports status overrides like announcement:draft to target a CPT without a separate type arg.

Sponsorship

If this project helps, consider supporting it:

Project Layout

  • server.mjs: entrypoint, tool registration

  • src/config.mjs: env parsing and validation

  • src/wpClient.mjs: WordPress REST client

  • src/wpUtils.mjs: query/form helpers and post-type parsing

  • src/postTypeResolver.mjs: cached CPT resolver

  • src/tools/: tool registration modules

-
security - not tested
F
license - not found
-
quality - not tested

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/jahzlariosa/wordpress-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server