wordpress-mcp
🚀 WordPress Model Context Protocol (MCP) Server
English Documentation | راهنمای فارسی (Persian)
A high-performance, enterprise-grade Model Context Protocol (MCP) server connecting WordPress sites directly to modern AI agents (Claude Code, Cursor, Google Antigravity, Windsurf, etc.).
Designed with a Dual-Engine Architecture and Zero-Trust Security Guard, it allows AI agents to inspect site health, query posts and pages, explore ACF & custom post types, optimize SEO, and manage content safely without exposing your site to hacks or prompt injection vulnerabilities.
🏗 Architecture Overview
┌─────────────────────────────────────────┐
│ AI Agents (Claude Code, Cursor, AGY) │
└────────────────────┬────────────────────┘
│ JSON-RPC / Stdio
▼
┌─────────────────────────────────────────────────────┐
│ wordpress-mcp Server │
│ ┌──────────────────────────────────────────────┐ │
│ │ Zero-Trust Security Guard (Safe Mode) │ │
│ └──────────────────────┬───────────────────────┘ │
└──────────────────────────┼──────────────────────────┘
│
┌───────────────────┴───────────────────┐
▼ ▼
┌───────────────────────┐ ┌───────────────────────┐
│ WpCliEngine │ │ WpRestEngine │
│ (LocalWP / CLI) │ │ (Remote REST + Auth) │
└───────────┬───────────┘ └───────────┬───────────┘
│ │
▼ ▼
[ Local Development ] [ Live Production ]
LocalWP, Docker, Valet WordPress REST APIRelated MCP server: Agent Abilities for MCP
🌟 Key Features
Dual-Engine Flexibility:
Local Engine (
cli): Connects with zero latency to local installations (LocalWP, Valet, Docker, native WP-CLI) with automatic PHP error and notice filtering.Remote Engine (
rest): Securely interfaces with remote production or staging sites over HTTPS via standard WordPress Application Passwords.
Zero-Trust Security Guard:
Read-Only by Default: All state-mutating actions (
wp_create_post,wp_update_post) are blocked unless explicitly allowed via--allow-writeorSAFE_MODE=false.No Raw Eval / No Raw SQL: The AI interacts exclusively through strictly validated, typed Zod schemas.
Input Sanitization: Automatically strips null bytes and malicious control characters.
Audit Logging: Optional audit trail logs every single invocation and argument set with timestamps.
Built-in Interactive Web Playground:
Includes an embedded web playground (
npm run dashboard) running onhttp://localhost:3300for visual verification and multi-site toggling.
🛠 Available Tools
Tool | Description | Safe Mode Status |
| Retrieves site URL, WordPress core version, active theme, name, and security status. | Allowed |
| Searches and filters posts/pages by keyword, post type, status, and pagination. | Allowed |
| Fetches full post content (including Gutenberg blocks), metadata, and custom fields by ID. | Allowed |
| Creates a new post or page with title, body, status, categories, and meta fields. | Blocked in Safe Mode |
| Updates existing post content, title, excerpt, status, or meta fields. | Blocked in Safe Mode |
| Lists installed plugins, active/inactive states, version numbers, and update status. | Allowed |
| Inspects all registered Custom Post Types (CPTs) and Taxonomies. Ideal for coding templates. | Allowed |
| Tails recent errors and warnings from | Allowed (CLI only) |
🚀 Quick Start
1. Installation
git clone https://github.com/am333ni7y/wordpress-mcp.git
cd wordpress-mcp
npm install
npm run build⚙️ Client Configurations
A. Cursor (~/.cursor/mcp.json)
Add the server to your Cursor MCP settings:
For Local Sites (LocalWP / WP-CLI):
{
"mcpServers": {
"wordpress-local": {
"command": "node",
"args": [
"/absolute/path/to/wordpress-mcp/dist/index.js",
"--path", "/path/to/wordpress/site",
"--adapter", "cli"
]
}
}
}For Remote Sites (REST API):
{
"mcpServers": {
"wordpress-live": {
"command": "node",
"args": [
"/absolute/path/to/wordpress-mcp/dist/index.js",
"--adapter", "rest",
"--url", "https://your-site.com",
"--username", "your_admin_user",
"--password", "xxxx xxxx xxxx xxxx"
]
}
}
}How to create an Application Password: In your WordPress admin, go to Users > Profile, scroll to Application Passwords, enter a name (e.g.
Cursor-MCP), and click Add New Application Password.
B. Claude Code CLI
# For Local Sites
claude mcp add wp-local node /absolute/path/to/wordpress-mcp/dist/index.js -- --path "/path/to/site" --adapter cli
# For Remote Sites
claude mcp add wp-live node /absolute/path/to/wordpress-mcp/dist/index.js -- --adapter rest --url "https://your-site.com" --username "your_user" --password "xxxx xxxx xxxx xxxx"C. Google Antigravity
Add to ~/.gemini/config/mcp_config.json:
{
"mcpServers": {
"wordpress": {
"command": "node",
"args": [
"/absolute/path/to/wordpress-mcp/dist/index.js",
"--adapter", "rest",
"--url", "https://your-site.com",
"--username", "your_user",
"--password", "xxxx xxxx xxxx xxxx"
]
}
}
}🎮 Interactive Web Playground
Need to verify tool responses or test connectivity before configuring your AI agent? Run the built-in visual tester:
npm run dashboardThen visit http://localhost:3300 in your browser. You can execute tools with a single click, view raw JSON-RPC responses, switch sites, and toggle Safe Mode interactively.
🔒 Security Architecture
Safe Mode Enforcement:
Out of the box,
wordpress-mcpis read-only.Any attempt to invoke
wp_create_postorwp_update_postreturns a clear security error.To permit write actions, pass
--allow-writein your command args or setSAFE_MODE=false.
Dedicated Credentials:
Use WordPress Application Passwords that can be instantly revoked at any moment.
Audit Trail:
Pass
--audit-log /path/to/audit.logto record every tool call with timestamps and arguments.
🤝 Contributing
Contributions, issues, and feature requests are welcome! Please read our Contributing Guide and Security Policy.
📄 License
This project is licensed under the MIT License.
Created with ❤️ by Amin Zahed (Ameeen).
This server cannot be deployed
Maintenance
Related MCP Connectors
Security-first WordPress MCP server. 129 tools for Claude, ChatGPT, Gemini. Free on wp.org.
Secure MCP Server for WordPress connects AI assistants and agents to WordPress with secure, controlled access. It lets AI interact with WordPress through MCP while helping organizations manage access, enforce policies, protect non-human identities (NHI), and require human approval for sensitive actions. Use it to securely connect tools such as ChatGPT, Claude, and Cursor with WordPress. Marketplace Link: https://wordpress.org/plugins/miniorange-secure-mcp-server/ Official website: https://plugins.miniorange.com/mcp-server-ai-policy-enforcement-wordpress
WordPress MCP server: publish posts, AI images, SEO and full site management, self-hosted
WordPress MCP server: generate SEO posts, AI images, autoblog & WooCommerce on your self-hosted site
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceA Model Context Protocol server that turns WordPress sites into AI-operable surfaces by exposing CRUD primitives for posts, users, comments, and settings. It supports both local STDIO and remote HTTP transports, allowing AI assistants to manage content and site configuration directly.40 npm9MIT
- AlicenseNot gradedqualityAmaintenanceA free WordPress plugin that turns your site into a governed MCP server, exposing 153 curated WordPress abilities (posts, media, users, WooCommerce, ACF, SEO) as tools for AI agents like Claude and Cursor. Every ability is off by default, scoped to a least-privilege user, capability-gated, and logged.3GPL 2.0
- AlicenseNot gradedqualityCmaintenanceA comprehensive WordPress plugin that implements the Model Context Protocol (MCP) to expose WordPress functionality through standardized interfaces, enabling AI models and applications to interact with WordPress sites securely using multiple transport protocols and enterprise-grade authentication.31 npmMIT
- FlicenseNot gradedqualityDmaintenanceA Model Context Protocol (MCP) server that bridges AI assistants to WordPress, enabling natural-language management of posts, pages, media, comments, users, plugins, and settings across multiple sites simultaneously.-