Control WordPress using WP-CLI, AI, and MCP. https://mcp-wp.github.io/
Find a file
copilot-swe-agent[bot] ca652fc822 Remove AI Services backward compatibility, use only WP AI Client
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
2025-12-07 16:30:25 +00:00
.github Fix workflow config 2025-04-26 11:46:41 +02:00
features Remove AI Services backward compatibility, use only WP AI Client 2025-12-07 16:30:25 +00:00
settings poc scoping 2025-03-16 16:06:01 +01:00
src Remove AI Services backward compatibility, use only WP AI Client 2025-12-07 16:30:25 +00:00
tests Initial PHPStan integration 2025-04-24 15:38:11 +02:00
.distignore Initial commit 2025-02-03 17:30:58 +01:00
.editorconfig Initial commit 2025-02-03 17:30:58 +01:00
.gitignore Initial PHPStan integration 2025-04-24 15:38:11 +02:00
ai-command.php Address code review feedback 2025-12-07 15:09:54 +00:00
behat.yml testing setup, lint fixes 2025-03-10 14:47:11 +01:00
composer.json Remove AI Services backward compatibility, use only WP AI Client 2025-12-07 16:30:25 +00:00
CONTRIBUTING.md Initial commit 2025-02-03 17:30:58 +01:00
LICENSE Clarify license 2025-04-04 12:58:00 +02:00
phpcs.xml.dist Import code from mcp-server / de-duplication (#51) 2025-04-03 23:05:09 +02:00
phpstan.neon.dist PHPStan level 8 2025-04-25 10:03:57 +02:00
phpunit.xml.dist Initial PHPStan integration 2025-04-24 15:38:11 +02:00
README.md Remove AI Services backward compatibility, use only WP AI Client 2025-12-07 16:30:25 +00:00
wp-cli.yml Initial commit 2025-02-03 17:30:58 +01:00

WP-CLI AI Command with MCP support

Commit activity Code Coverage License

This WP-CLI command enables direct AI interactions with WordPress installations during development by implementing the Model Context Protocol (MCP). It not only provides its own MCP server for controlling WordPress sites, but also allows connecting to any other local or remote MCP server.

Read documentation

Installing

Installing this package requires WP-CLI v2.11 or greater. Update to the latest stable release with wp cli update.

Tip: for better support of the latest PHP versions, use the v2.12 nightly build with wp cli update --nightly.

To install the latest development version of this package, use the following command instead:

wp package install mcp-wp/ai-command:dev-main

This package uses the WP AI Client (available in WordPress 7.0+ or via the AI plugin) for AI functionality.

Configuration

Configure credentials for AI providers:

# Configure credentials for AI providers
wp ai credentials set openai sk-proj-YOUR-API-KEY
wp ai credentials set anthropic sk-ant-YOUR-API-KEY
wp ai credentials set google YOUR-GOOGLE-API-KEY

# List configured credentials
wp ai credentials list

Credentials are stored in the WordPress database and can also be managed through the WordPress admin settings screen.

Reporting a bug

Think youve found a bug? Wed love for you to help us get it fixed.

Before you create a new issue, you should search existing issues to see if theres an existing resolution to it, or if its already been fixed in a newer version.

Once youve done a bit of searching and discovered there isnt an open or fixed issue for your bug, please create a new issue. Include as much detail as you can, and clear steps to reproduce if possible. For more guidance, review our bug report documentation.

Creating a pull request

Want to contribute a new feature? Please first open a new issue to discuss whether the feature is a good fit for the project.

Once you've decided to commit the time to seeing your pull request through, please follow our guidelines for creating a pull request to make sure it's a pleasant experience.