VOOZH about

URL: https://deepwiki.com/WordPress/mcp-adapter/2.1-installation

⇱ Installation | WordPress/mcp-adapter | DeepWiki


Loading...
Menu

Installation

This document covers installation methods for the MCP Adapter, including Composer package installation, WordPress plugin installation, and dependency management. For setting up the development environment with wp-env and testing infrastructure, see Development Environment.

Installation Methods

The MCP Adapter can be installed in two ways: as a Composer package (recommended) or as a traditional WordPress plugin. Both methods require the WordPress Abilities API as a dependency.

Installation Method Comparison

MethodUse CaseDependency ManagementActivation
Composer PackagePlugin/theme integrationJetpack Autoloader recommendedAutomatic via McpAdapter::instance()
WordPress PluginStandalone installationComposer install requiredWordPress admin or WP-CLI

Composer Package Installation (Recommended)

The primary installation method uses Composer to install the MCP Adapter as a library dependency:


This method is defined in composer.json1-7 which specifies the package name as wordpress/mcp-adapter with type library and requires PHP 7.4 or higher composer.json73

Autoloading Configuration

The package uses PSR-4 autoloading with the namespace WP\MCP\ mapped to the includes/ directory composer.json60-64:

WP\MCP\ => includes/

For basic usage, load the Composer autoloader in your plugin:


Sources: docs/getting-started/installation.md1-35 composer.json60-74

WordPress Plugin Installation

Alternatively, install as a standalone WordPress plugin:


Installation Steps:

  1. Clone the repository to wp-content/plugins/:

    
    
  2. Install Composer dependencies:

    
    
  3. Activate the plugin:

    
    

The plugin file at mcp-adapter.php20 handles initialization automatically when activated as a WordPress plugin.

Sources: docs/getting-started/installation.md143-167

Dependency Management with Jetpack Autoloader

Multi-Plugin Conflict Resolution

When multiple plugins use the MCP Adapter, version conflicts can occur. The Jetpack Autoloader resolves this by loading the latest compatible version of shared dependencies.


Installation:


The Jetpack Autoloader is configured as an allowed plugin in composer.json36-41:


Usage in Plugin:

Replace the standard Composer autoloader with Jetpack's autoloader:


This ensures that only the latest compatible version of each package is loaded, preventing fatal errors from duplicate class declarations.

Sources: docs/getting-started/installation.md15-40 composer.json36-41

Using MCP Adapter in Your Plugin

Plugin Integration Pattern


Dependency Checks:

docs/getting-started/installation.md66-76 demonstrates checking for required dependencies:


Hook Integration:

The plugin uses two WordPress hooks:

The complete example at docs/getting-started/installation.md47-141 shows the full integration pattern including ability registration and server creation.

Sources: docs/getting-started/installation.md42-141

Verifying Installation

Verification Methods

MethodCommand/LocationExpected Result
WordPress AdminPlugins → Installed Plugins"MCP Adapter" listed as active
WP-CLIwp plugin status mcp-adapterStatus: Active
REST APIcurl https://yoursite.com/wp-json/MCP routes listed
PHP Class Checkclass_exists('WP\MCP\Core\McpAdapter')Returns true

REST API Endpoint Test


Test the default MCP server endpoint docs/getting-started/installation.md180-189:


The default server endpoint is created automatically at /wp-json/mcp/mcp-adapter-default-server docs/getting-started/installation.md167

PHP Class Verification

Add this code temporarily to verify MCP Adapter is loaded docs/getting-started/installation.md195-203:


Sources: docs/getting-started/installation.md169-203

Troubleshooting

Common Installation Issues

IssueDiagnosisSolution
Plugin not foundNot in wp-content/plugins/mcp-adapter/Clone repository or install via Composer
Plugin inactiveNot activatedActivate via WordPress admin or wp plugin activate mcp-adapter
Autoloader missingvendor/autoload.php doesn't existRun composer install in plugin directory
Abilities API unavailablewp_register_ability() not definedInstall and activate WordPress Abilities API
REST API not respondingPermalinks set to "Plain"Change permalink structure in Settings → Permalinks

Debug Mode Configuration

Enable WordPress debug logging in wp-config.php docs/getting-started/installation.md231-235:


This enables logging to wp-content/debug.log for troubleshooting initialization issues.

Composer Autoloader Issues

If classes are not loading properly:

  1. Verify vendor/autoload.php exists docs/getting-started/installation.md223-225
  2. Check PSR-4 autoload configuration in composer.json60-64
  3. Run composer dump-autoload to regenerate autoloader
  4. Consider using Jetpack Autoloader for multi-plugin environments

Sources: docs/getting-started/installation.md205-237

Dependencies

Required Dependencies


Minimum Requirements:

DependencyVersionDefined In
PHP>= 7.4, <= 8.4composer.json73 phpstan.neon.dist17-19
WordPress>= 6.8docs/getting-started/installation.md251
WordPress Abilities APILatestdocs/getting-started/installation.md252

The composer.json30-31 file explicitly sets the platform PHP version to 7.4 to ensure compatibility:


PHPStan configuration at phpstan.neon.dist17-19 analyzes code compatibility across PHP 7.4 to 8.4:


Optional Dependencies

DependencyPurposeUsage
Jetpack AutoloaderVersion conflict resolutionMulti-plugin environments
WP-CLICommand-line testingDevelopment and STDIO transport

WP-CLI stubs are included as a development dependency composer.json77 and loaded in PHPStan configuration phpstan.neon.dist22

Sources: docs/getting-started/installation.md247-258 composer.json29-74 phpstan.neon.dist17-22

Automatic Initialization

When installed as a WordPress plugin, the MCP Adapter initializes automatically through mcp-adapter.php20 This creates a default MCP server accessible at:

/wp-json/mcp/mcp-adapter-default-server

The default server is configured with:

  • Server ID: mcp-adapter-default-server
  • HTTP transport enabled
  • ErrorLog error handler
  • All public abilities exposed (filtered by meta.mcp.public flag)

For custom server configuration and multi-server setups, see Server Configuration.

Sources: docs/getting-started/installation.md167-258