# imagify/2.3.2/vendor/wp-media/mcp-oauth/inc/Context.php

Imagify Image Optimization: Optimize Images | Compress &amp; Convert to WebP/AVIF, version 2.3.2. 28 lines.

- Page: https://pluginprobe.com/plugins/imagify/2.3.2/code/vendor/wp-media/mcp-oauth/inc/Context.php
- Raw: https://pluginprobe.com/plugins/imagify/2.3.2/raw/vendor/wp-media/mcp-oauth/inc/Context.php
- Modified: 2026-07-29T01:54:18+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/imagify/2.3.2/code/vendor/wp-media/mcp-oauth/inc/Context.php#L10-L20`.

```php
<?php
declare(strict_types=1);

namespace WPMedia\MCP\OAuth;

class Context {
	/**
	 * Determines whether the MCP OAuth server is enabled.
	 *
	 * @return bool True when the OAuth server (rewrite rules, endpoints,
	 *              discovery documents, transport) should be registered; false otherwise.
	 */
	public function is_enabled(): bool {
		$enabled = apply_filters_deprecated( 'rocket_mcp_oauth_server_enabled', [ true ], '1.0.1', 'wpmedia_mcp_oauth_server_enabled' );

		/**
		 * Filters whether the MCP OAuth server is enabled.
		 *
		 * When `false`, the host plugin does not register the OAuth rewrite rules
		 * or respond to any /oauth/* endpoint or /.well-known discovery request,
		 * and does not register the MCP OAuth transport server.
		 *
		 * @param bool $enabled Whether the MCP OAuth server is enabled. Default true.
		 */
		return wpm_apply_filters_typed( 'boolean', 'wpmedia_mcp_oauth_server_enabled', $enabled );
	}
}

```
