WordPress/mcp-adapter: The Universal Translator for the Agentic Web
How the world's most popular CMS is becoming the primary interface for autonomous AI agents.
- The adapter translates the WordPress conceptual model into a standardized language for autonomous AI agents.
- A specialized bridge allows local AI models to communicate directly with the WordPress core through terminal input and output.
- The SchemaTransformer dynamically converts PHP metadata into strict JSON definitions that LLMs can use to execute tools.
- WordPress is evolving from a static content repository into an orchestrator that can both serve and query other AI tools.
Your website is no longer just a destination for human readers. It is a database waiting to be queried by autonomous agents. For over two decades, WordPress optimized for the human experience with visual builders and REST APIs designed for frontend consumption. That paradigm is shifting.
The Model Context Protocol (MCP) introduced a standard way for AI models to connect to external data sources. The WordPress/mcp-adapter bridges the gap between a 25-year-old PHP monolith and this new standard. It does not just expose a few endpoints. It translates the entire conceptual model of a WordPress site into a language that Claude, ChatGPT, and local LLMs can execute natively.
The Terminal is the New Browser
The most surprising technical feat in the adapter is not its HTTP implementation. It is the StdioServerBridge.php. This component allows a local LLM to communicate with a live WordPress environment entirely through a terminal pipe.
Instead of spinning up a web server and managing OAuth tokens, an AI agent can execute a WP-CLI command. The adapter takes over standard input and output channels. It reads JSON-RPC requests directly from STDIN, processes them through the WordPress core, and flushes the formatted response to STDOUT.
This requires absolute discipline at the protocol level. Any stray PHP warning or WP-CLI success message would corrupt the JSON-RPC stream and crash the LLM's parser. The adapter solves this by redirecting internal logs to STDERR, keeping the primary communication channel pristine.
Mapping "Abilities" to "Tools"
WordPress is built on a massive, sprawling hook system. To make this chaotic ecosystem discoverable by AI, the adapter relies on the proposed WordPress Abilities API. An "Ability" is a registered capability, like publishing a post or reading a user profile.
The magic happens in the SchemaTransformer. An LLM cannot read a PHP array. It requires a strict JSON Schema definition to understand what parameters a tool accepts. The adapter dynamically unwraps PHP metadata and translates it into MCP-compliant JSON.
If a WordPress Ability expects a single string, the transformer wraps it in an object format required by the MCP specification. It extracts labels, annotations, and destructive warnings, mapping them to MCP hints like readOnlyHint. This means developers can write standard PHP, and the adapter handles the complex schema generation automatically.
Translates WordPress abilities into Model Context Protocol format, allowing AI assistants like Claude and ChatGPT to discover and invoke WordPress capabilities as tools, resources, and prompts.
The Architecture of Discovery
The adapter utilizes a decoupled architecture. The McpAdapter acts as a global registry managing multiple McpServer instances. A single WordPress installation can host multiple MCP servers simultaneously, each with different permission boundaries.
You might have one server exposed via HTTP for a customer service chatbot with read-only access to public FAQs. You might have another server exposed via STDIO for your local IDE, possessing full administrative capabilities to modify theme files. The HttpTransport layer handles the former, mapping JSON-RPC to standard REST endpoints while enforcing strict capability checks.
| The Old Way (REST APIs) | The MCP Way |
|---|---|
| Custom endpoints for every new feature. | Automatic tool discovery via JSON-RPC. |
| Manual API keys managed per external tool. | Protocol-level security and context boundaries. |
| Hardcoded JSON structures. | Dynamic JSON Schema generation from PHP. |
| Brittle, point-to-point integrations. | Interoperable with any MCP client natively. |
MCP servers changed that. Not by making Claude smarter, but by giving Claude access to my actual systems, so instead of describing what is in my database, I ask Claude to check it.
From Server to Orchestrator
The initial goal was to make WordPress readable by AI. The broader vision turns it into an orchestrator. Recent architectural shifts allow the CMS to act as an MCP Client as well as a Server.
This bidirectional flow means WordPress can reach out to other MCP servers. A publishing workflow could automatically query a local vector database for related content, pull data from a remote GitHub repository, and synthesize a draft directly within the Gutenberg editor.
By adopting the Model Context Protocol at the core level, the ecosystem avoids a fragmented future of thousand-off API wrappers. It standardizes the interface between human content and machine intelligence, securing the platform's relevance in an agent-driven web.
Explore the source code and documentation in the official WordPress/mcp-adapter repository.