Skip to content

Commit e740f48

Browse files
committed
Move enable/register MCP server gate
1 parent f784fec commit e740f48

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

includes/mcp/class-convertkit-mcp.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,6 @@ public static function get_server_url() {
7777
*/
7878
public function __construct() {
7979

80-
// Bail if the MCP server isn't enabled.
81-
$settings = new ConvertKit_Settings_MCP();
82-
if ( ! $settings->enabled() ) {
83-
return;
84-
}
85-
8680
// Register the ability category.
8781
add_action( 'wp_abilities_api_categories_init', array( $this, 'register_abilities_category' ) );
8882

@@ -265,6 +259,12 @@ public function register_abilities() {
265259
*/
266260
public function register_mcp_server( $adapter ) {
267261

262+
// Bail if the MCP server isn't enabled.
263+
$settings = new ConvertKit_Settings_MCP();
264+
if ( ! $settings->enabled() ) {
265+
return;
266+
}
267+
268268
// Get abilities.
269269
$abilities = convertkit_get_abilities();
270270

0 commit comments

Comments
 (0)