includes
7 months ago
composer.json
7 months ago
mcp-adapter.php
9 months ago
phpcs.xml.dist
9 months ago
phpstan.neon.dist
7 months ago
mcp-adapter.php
58 lines
| 1 | <?php |
| 2 | /** |
| 3 | * WordPress MCP Adapter |
| 4 | * |
| 5 | * @package mcp-adapter |
| 6 | * @author WordPress.org Contributors |
| 7 | * @copyright 2025 Plugin Contributors |
| 8 | * @license GPL-2.0-or-later |
| 9 | * |
| 10 | * @wordpress-plugin |
| 11 | * Plugin Name: MCP Adapter |
| 12 | * Plugin URI: https://github.com/WordPress/mcp-adapter |
| 13 | * Description: Adapter for Abilities API, letting the abilities to be used as MCP tools, resources or prompts. |
| 14 | * Requires at least: 6.8 |
| 15 | * Version: 0.1.0 |
| 16 | * Requires PHP: 7.4 |
| 17 | * Author: WordPress.org Contributors |
| 18 | * Author URI: https://github.com/WordPress/mcp-adapter/graphs/contributors |
| 19 | * License: GPLv2 or later |
| 20 | * License URI: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html |
| 21 | * Text Domain: mcp-adapter |
| 22 | */ |
| 23 | |
| 24 | declare (strict_types = 1); |
| 25 | |
| 26 | namespace WP\MCP; |
| 27 | |
| 28 | // Exit if accessed directly. |
| 29 | defined( 'ABSPATH' ) || exit(); |
| 30 | |
| 31 | /** |
| 32 | * Define the plugin constants. |
| 33 | */ |
| 34 | function constants(): void { |
| 35 | /** |
| 36 | * Shortcut constant to the path of this file. |
| 37 | */ |
| 38 | define( 'WP_MCP_DIR', plugin_dir_path( __FILE__ ) ); |
| 39 | |
| 40 | /** |
| 41 | * Version of the plugin. |
| 42 | */ |
| 43 | define( 'WP_MCP_VERSION', '0.1.0' ); |
| 44 | } |
| 45 | |
| 46 | constants(); |
| 47 | require_once __DIR__ . '/includes/Autoloader.php'; |
| 48 | |
| 49 | // If autoloader failed, we cannot proceed. |
| 50 | if ( ! Autoloader::autoload() ) { |
| 51 | return; |
| 52 | } |
| 53 | |
| 54 | // Load the plugin. |
| 55 | if ( class_exists( Plugin::class ) ) { |
| 56 | Plugin::instance(); |
| 57 | } |
| 58 |