WordPress MCP Adapter

WordPress MCP Adapter

Official WordPress MCP adapter exposing WordPress abilities as MCP tools, resources, and prompts.

316
Stars
54
Forks
2
Releases

Overview

The MCP Adapter bridges WordPress's Abilities API with the Model Context Protocol, providing a standardized way for AI agents to interact with WordPress functionality. It converts WordPress abilities into MCP components—tools, resources, and prompts—exposing them through MCP servers that can be discovered, configured, and invoked by clients. The adapter supports multiple transport methods, including HTTP for MCP-compliant communication and STDIO for local development and CLI workflows, with a design that allows custom transports via a McpTransportInterface. It includes built-in WordPress-compatible error handling, plus extensible server-specific error handlers, and built-in observability with zero-overhead metrics and pluggable handlers for monitoring. Validation is applied to tools, resources, and prompts, ensuring conformance to MCP schemas, and granular permission control via transport permissions. The architecture intentionally separates concerns (core management, transport, handlers, and domain components) and provides CLI integration through WP-CLI, automatic server discovery, and REST API integration. Jetpack Autoloader is recommended to manage dependencies in multi-plugin environments.

Details

Owner
WordPress
Language
PHP
License
GNU General Public License v2.0
Updated
2025-12-07

Features

Ability-to-MCP Conversion

WordPress abilities are automatically converted into MCP tools, resources, and prompts for AI agent interactions.

Multi-Server Management

Create and manage multiple MCP servers with unique configurations for different namespaces, routes, and descriptions.

Extensible Transport Layer

Supports HTTP and STDIO transports, plus custom transports via McpTransportInterface, with multi-transport configuration across servers.

Error Handling

Built-in WordPress-compatible error handling with optional custom handlers and server-specific strategies.

Observability

Built-in observability with zero-overhead metrics and pluggable McpObservabilityHandlerInterface-based handlers.

Validation

Built-in validation for tools, resources, and prompts with extensible validation rules.

Permission Control

Granular permission checks for all exposed functionality with configurable transport permissions.

CLI Integration

WP-CLI commands supporting STDIO transport for development, testing, and server control.

Audience

WordPress plugin authorsExpose WordPress abilities as MCP tools, resources, and prompts via servers.
AI developersConnect to MCP servers to discover and invoke WordPress abilities via MCP.
WP-CLI usersInteract with MCP adapters through WP-CLI and STDIO transport.

Tags

MCPModel Context ProtocolWordPressAbilities APIToolsResourcesPromptsServer DiscoveryHTTP TransportSTDIO TransportWP-CLIObservabilityError HandlingValidationPermissionsJetpack AutoloaderREST API