| 1 |
<?php |
| 2 |
declare(strict_types=1); |
| 3 |
|
| 4 |
namespace WPMedia\MCP\OAuth; |
| 5 |
|
| 6 |
class Context { |
| 7 |
/** |
| 8 |
* Determines whether the MCP OAuth server is enabled. |
| 9 |
* |
| 10 |
* @return bool True when the OAuth server (rewrite rules, endpoints, |
| 11 |
* discovery documents, transport) should be registered; false otherwise. |
| 12 |
*/ |
| 13 |
public function is_enabled(): bool { |
| 14 |
$enabled = apply_filters_deprecated( 'rocket_mcp_oauth_server_enabled', [ true ], '1.0.1', 'wpmedia_mcp_oauth_server_enabled' ); |
| 15 |
|
| 16 |
/** |
| 17 |
* Filters whether the MCP OAuth server is enabled. |
| 18 |
* |
| 19 |
* When `false`, the host plugin does not register the OAuth rewrite rules |
| 20 |
* or respond to any /oauth/* endpoint or /.well-known discovery request, |
| 21 |
* and does not register the MCP OAuth transport server. |
| 22 |
* |
| 23 |
* @param bool $enabled Whether the MCP OAuth server is enabled. Default true. |
| 24 |
*/ |
| 25 |
return wpm_apply_filters_typed( 'boolean', 'wpmedia_mcp_oauth_server_enabled', $enabled ); |
| 26 |
} |
| 27 |
} |
| 28 |
|