Skip to content

Conversation

@marcochiesi
Copy link
Collaborator

This update includes adding a selection of WP CLI commands as MCP Tools.
Commands already covered by REST API integration were excluded on purpose.
By the way, the implementation is similar to the one made for REST API.

Currently supported commands:

  • cache
  • config
  • core
  • maintenance-mode
  • profile
  • rewrite

Examples of prompts that are currently working as expected:

  • Enable maintenance mode
  • Disable maintenance mode
  • Flush the cache
  • Flush the rewrite rules
  • Set rewrite structure to /custom/%postname%/ and category base to cat and tag base to tag
  • What is the WordPress version
  • Update WordPress core

Current limitations:

  • Commands with 2 levels of subcommands (i.e. wp language core install) are not covered (need some refactoring)
  • Parameters handling not always working properly
  • Not all commands and scenarios were properly tested

Related to #15

@swissspidy swissspidy merged commit 4e09208 into main Mar 23, 2025
2 checks passed
@swissspidy swissspidy deleted the feature/wp-cli-commands-as-tools branch March 23, 2025 12:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants