Download the PHP package wordpress/mcp-adapter without Composer
On this page you can find all versions of the php package wordpress/mcp-adapter. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download wordpress/mcp-adapter
More information about wordpress/mcp-adapter
Files in wordpress/mcp-adapter
Package mcp-adapter
Short Description Adapter for Abilities API, letting WordPress abilities to be used as MCP tools, resources or prompts
License GPL-2.0-or-later
Homepage https://github.com/wordpress/mcp-adapter
Informations about the package mcp-adapter
MCP Adapter
Part of the AI Building Blocks for WordPress initiative
The official WordPress package for MCP integration that exposes WordPress abilities as Model Context Protocol (MCP) tools, resources, and prompts for AI agents.
Overview
This adapter bridges WordPress's Abilities API with the MCP specification, providing a standardized way for AI agents to interact with WordPress functionality. It includes HTTP and STDIO transport support, comprehensive error handling, and an extensible architecture for custom integrations.
Features
Core Functionality
- Ability-to-MCP Conversion: Automatically converts WordPress abilities into MCP tools, resources, and prompts
- Multi-Server Management: Create and manage multiple MCP servers with unique configurations
- Extensible Transport Layer:
- HTTP Transport: Unified transport implementing MCP 2025-11-25 specification for HTTP-based communication
- STDIO Transport: Process-based communication via standard input/output for local development and CLI integration
- Custom Transport Support: Implement
McpTransportInterfaceto create specialized communication protocols - Multi-Transport Configuration: Configure servers with multiple transport methods simultaneously
- Flexible Error Handling:
- Built-in Error Handler: Default WordPress-compatible error logging included
- Custom Error Handlers: Implement
McpErrorHandlerInterfacefor custom logging, monitoring, or notification systems - Server-specific Handlers: Different error handling strategies per MCP server
- Observability:
- Built-in Observability: Default zero-overhead metrics tracking with configurable handlers
- Custom Observability Handlers: Implement
McpObservabilityHandlerInterfacefor integration with monitoring systems
- Validation: Built-in validation for tools, resources, and prompts with extensible validation rules
- Permission Control: Granular permission checking for all exposed functionality with configurable transport permissions
MCP Component Support
- Tools: Convert WordPress abilities into executable MCP tools for AI agent interactions
- Resources: Expose WordPress data as MCP resources for contextual information access
- Prompts: Transform abilities into structured MCP prompts for AI guidance and templates
- Server Discovery: Automatic registration and discovery of MCP servers following MCP protocol standards
- Built-in Abilities: Core WordPress abilities for system introspection and ability management
- CLI Integration: WP-CLI commands supporting STDIO transport as defined in MCP specification
Architecture
For a full breakdown of the component structure, see the Architecture Overview.
Dependencies
- PHP: >= 7.4
- WordPress: >= 6.9
- php-mcp-schema (
^0.1.0): Typed DTOs for MCP protocol types — installed automatically via Composer
Installation
As a WordPress Plugin (Recommended)
MCP Adapter is designed to be installed as a WordPress plugin. To install you should download the latest stable release from the GitHub Releases page and install it like any other WordPress plugin.
With WP-CLI
With WP-Env
As a Composer Library (for plugin developers)
Plugin developers may wish to install MCP Adapter as a Composer dependency to integrate MCP functionality into their own plugins.
Using Jetpack Autoloader (Highly Recommended)
When multiple plugins use the MCP Adapter, it's highly recommended to use the Jetpack Autoloader to prevent version conflicts. The Jetpack Autoloader ensures that only the latest version of shared packages is loaded, eliminating conflicts when different plugins use different versions of the same dependency.
Then load it in your main plugin file instead of the standard Composer autoloader:
Using MCP Adapter in Your Plugin
Check availability and initialize on plugins_loaded so all plugins are available before the adapter starts:
Basic Usage
The MCP Adapter automatically creates a default server that exposes registered WordPress abilities through a layered architecture. This provides immediate MCP functionality without requiring manual server configuration.
How it works:
- WordPress abilities registered via
wp_register_ability()with themeta.mcp.publicflag set totrueare discoverable and executable on the default server via its built-in adapter tools - On the default server, public abilities are accessed through
mcp-adapter/discover-abilities,mcp-adapter/get-ability-info, andmcp-adapter/execute-abilityrather than being auto-registered individually intools/list - Alternatively, abilities can be explicitly listed when creating a custom MCP server; in that case, they can be exposed directly as MCP tools, resources, or prompts without requiring the
meta.mcp.publicflag - The default server supports both HTTP and STDIO transports and supports multiple MCP protocol versions
- Built-in error handling and observability are included
- Access via HTTP:
/wp-json/mcp/mcp-adapter-default-server - Access via STDIO:
wp mcp-adapter serve --server=mcp-adapter-default-server
Create a new ability (click to expand)
For detailed information about creating WordPress abilities, see the Abilities API developer documentation.
Connecting to MCP Servers
The MCP Adapter supports multiple connection methods. Here are examples for connecting with MCP clients:
STDIO Transport (Local Development)
For local development and testing, you can interact directly with MCP servers using WP-CLI commands:
MCP Client Configuration
Configure MCP clients (Claude Desktop, Claude Code, VS Code, Cursor, etc.) to connect to your WordPress MCP servers.
STDIO Transport Configuration for local sites (click to expand)
HTTP Transport via Proxy (click to expand)
The [`@automattic/mcp-wordpress-remote`](https://www.npmjs.com/package/@automattic/mcp-wordpress-remote) proxy runs locally and translates STDIO-based MCP communication from AI clients into HTTP REST API calls that WordPress understands. Authentication uses [WordPress Application Passwords](https://make.wordpress.org/core/2020/11/05/application-passwords-integration-guide/).Advanced Usage
Creating Custom MCP Servers
For advanced use cases, you can create custom MCP servers with specific configurations:
Custom Transport Implementation
The MCP Adapter includes production-ready HTTP transports. For specialized requirements like custom authentication, message queues, or enterprise integrations, you can create custom transport protocols.
See the Custom Transports Guide for detailed implementation instructions.
Custom Transport Permissions
The MCP Adapter supports custom authentication logic through transport permission callbacks. Instead of the default is_user_logged_in() check, you can implement custom authentication for your MCP servers.
See the Transport Permissions Guide for detailed authentication patterns.
Custom Error Handler
The MCP Adapter includes a default WordPress-compatible error handler, but you can implement custom error handling to integrate with existing logging systems, monitoring tools, or meet specific requirements.
See the Error Handling Guide for detailed implementation instructions.
Custom Observability Handler
The MCP Adapter includes built-in observability for tracking metrics and events. You can implement custom observability handlers to integrate with monitoring systems, analytics platforms, or performance tracking tools.
See the Observability Guide for detailed metrics tracking and custom handler implementation.
Migration
- Migration Guide: v0.5.0 — Breaking changes and upgrade instructions
- Migration Guide: v0.3.0 — Transport, observability, and hook name changes