PHP code example of wpboilerplate / wpb-mcp-servers-list
1. Go to this page and download the library: Download wpboilerplate/wpb-mcp-servers-list library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
wpboilerplate / wpb-mcp-servers-list example snippets
use WPBoilerplate\McpServersList\McpServersList;
// Option A – one-liner bootstrap (registers the hook automatically)
add_action( 'plugins_loaded', [ McpServersList::class, 'bootstrap' ] );
// Option B – manual hook (more control)
add_action( 'rest_api_init', function () {
McpServersList::instance()->collect();
}, 20 );