Thank you for your interest in contributing to the MCP Adapter canonical plugin! This contains all the documentation for getting started and contributing to the plugin and will eventually be a part of the AI Team Handbook.
Please report (non-security) issues and open pull requests on GitHub. See below for information on reporting potential security/privacy vulnerabilities.
Join the #core-ai channel on WordPress Slack (sign up here).
In general, all code must follow the WordPress Coding Standards and best practices. All code in the MCP Adapter must follow these requirements:
- WordPress: 6.9+
- PHP: 7.4+
We include several tools to help ensure your code meets these standards.
-
As with all WordPress projects, we want to ensure a welcoming environment for everyone. With that in mind, all contributors are expected to follow our Code of Conduct.
-
All WordPress projects are licensed under the GPLv2+, and all contributions to Gutenberg will be released under the GPLv2+ license. You maintain copyright over any contribution you make, and by submitting a pull request, you are agreeing to release that contribution under the GPLv2+ license.
Please see SECURITY.md.
- Node.js: 22.x (NVM recommended)
- Docker
- Git
- Composer: (if you prefer to run the Composer tools locally)
You can use Docker and the wp-env tool to set up a local development environment, instead of manually installing the specific testing versions of WordPress, PHP, and Composer. For more information, see the wp-env documentation.
-
Clone the repository:
git clone https://github.com/WordPress/mcp-adapter.git
-
Change into the project folder and install the development dependencies:
## If you're using NVM, make sure to use the correct Node.js version: nvm use ## Then install the NPM dependencies: npm install # If you are using Composer locally, also run: composer install
-
Start the local development environment:
npm run wp-env start
The WordPress development site will be available at http://localhost:8888 and the WP Admin Dashboard will be available at http://localhost:8888/wp-admin/. You can log in to the admin using the username admin and password password.
composer install: Install PHP dependencies.npm install: Install JavaScript dependencies.
npm run wp-env start: Start the local development environment.npm run wp-env stop: Stop the local development environment.npm run wp-env:cli -- YOUR_CMD_HERE: Run WP-CLI commands in the local environment.
For more information on using wp-env, see the wp-env documentation.
npm run lint:php: Runs PHPCS linting on the PHP code.npm run lint:php:fix: Autofixes PHPCS linting issues.npm run lint:php:stan: Runs PHPStan static analysis on the PHP code.npm run format: Formats non-PHP files using Prettier.
PHPUnit tests can be run using the following command:
npm run test:phpFor detailed testing instructions including running specific tests, generating coverage reports, and troubleshooting, see the Testing Guide.
To build the plugin for distribution, you can use the following command:
# IMPORTANT!: Make sure you've cleaned up any dev-dependencies from Composer first:
composer install --no-dev
npm run plugin-zip