| 1 |
<?php |
| 2 |
/** |
| 3 |
* MCP Abilities module (specs 041-mcp-abilities, 046-native-mcp-server). |
| 4 |
* |
| 5 |
* Templately's template-library agent capabilities: search, detail, and the three |
| 6 |
* import paths, plus the four account-authentication actions. Nine capabilities |
| 7 |
* in all, contributed to the shared registry in `modules/mcp-core/`. |
| 8 |
* |
| 9 |
* This module owns the capabilities themselves and nothing about how they are |
| 10 |
* served. The transports live elsewhere and read the registry: |
| 11 |
* `modules/mcp-server/` (built in, always) and `modules/wp-abilities-api/` |
| 12 |
* (WordPress Abilities API + the mcp-adapter plugin, both optional). Full-site |
| 13 |
* import capabilities live in their own module, `modules/mcp-fsi/`. |
| 14 |
* |
| 15 |
* Relocated from includes/MCP/ (2026-07-08); narrowed to capabilities-only when |
| 16 |
* the registry, bridges, and native server were split out (2026-07-26). |
| 17 |
* Independent of the dev-only tool registry in modules/developer/mcp-tools/ (FR-011). |
| 18 |
* |
| 19 |
* @package Templately |
| 20 |
*/ |
| 21 |
|
| 22 |
namespace Templately\Modules\McpAbilities; |
| 23 |
|
| 24 |
use Templately\Core\Module_Base; |
| 25 |
|
| 26 |
class Module extends Module_Base { |
| 27 |
|
| 28 |
public function get_name(): string { |
| 29 |
return 'mcp-abilities'; |
| 30 |
} |
| 31 |
|
| 32 |
/** |
| 33 |
* Held back from the 3.8.0 release (2026-09-23) — see Module_Base::deferred_module_enabled(). |
| 34 |
* Delete this override to release it. |
| 35 |
*/ |
| 36 |
public function is_active(): bool { |
| 37 |
return Module_Base::deferred_module_enabled( $this->get_name() ); |
| 38 |
} |
| 39 |
|
| 40 |
/** |
| 41 |
* Declared (not incidental): every ability's descriptor names |
| 42 |
* `McpCore\Registry\ToolDescriptor` for its access level, and `MCP` hands the |
| 43 |
* ability classes to `McpCore\Registry\ToolRegistry`. |
| 44 |
*/ |
| 45 |
public function get_dependencies(): array { |
| 46 |
return [ 'mcp-core' ]; |
| 47 |
} |
| 48 |
|
| 49 |
protected function init_hooks(): void { |
| 50 |
// Registers this module's capabilities and the Google-OAuth key handoff. |
| 51 |
// There is no availability gate: the native server serves these on any |
| 52 |
// supported WordPress, with or without the Abilities API or mcp-adapter. |
| 53 |
MCP::get_instance(); |
| 54 |
} |
| 55 |
} |
| 56 |
|