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.

7 min read • View on GitHub • More from WordPress

A vintage telephone switchboard being upgraded with fiber optic cables, representing WordPress adapting to modern AI protocols.
The mcp-adapter replaces legacy API endpoints with a unified protocol, turning the CMS into a programmable node for AI agents.
Key Takeaways

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.

A mechanical typewriter feeding binary code instead of paper, illustrating the low-level standard I/O communication bridge.
The StdioServerBridge bypasses the web server entirely, allowing local AI models to converse directly with the WordPress core via the command line.

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.

A flow diagram showing transport switching in the WordPress MCP Adapter. Start with "WordPress Core" in the center. Branch left to a "Cloud/HTTP" node representing remote clients via REST API. Branch right to a "Terminal/STDIO" node representing local AI agents via CLI. Show a JSON-RPC request packet entering from the Terminal

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.

— Pascal Birchler, Developer Relations at Google (Source)

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.

— Varun Dubey, WordPress Product Business Owner (Source)

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.

A classical Greek temple constructed of server racks, projecting beams of light to external pedestals.
By acting as both a server and a client, WordPress transforms from a static content repository into an active orchestrator of AI tools.

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.