Automattic\WooCommerce\Internal\MCP

MCPAdapterProvider{} │ WC 1.0

Deprecated since 1.3.0. It is no longer supported and may be removed in future releases. Use MCP Adapter plugin to access WooCommerce abilities over MCP instead.

Formerly provided the WooCommerce MCP endpoint (woocommerce/mcp).

Kept so existing callers don't fatal. The methods do nothing except report incorrect usage.

No Hooks.

Usage

$MCPAdapterProvider = new MCPAdapterProvider();
// use class methods

Methods

  1. public __construct()
  2. public initialize_mcp_server( $adapter )
  3. public is_initialized()
  4. public static is_mcp_request()
  5. public maybe_initialize()

Changelog

Deprecated since 11.3.0 The WooCommerce MCP endpoint was removed. Use the MCP Adapter plugin to access WooCommerce abilities over MCP.

MCPAdapterProvider{} code WC 11.3.0

class MCPAdapterProvider {

	/**
	 * Namespace of the removed WooCommerce MCP endpoint.
	 *
	 * @var string
	 */
	const MCP_NAMESPACE = 'woocommerce';

	/**
	 * Route of the removed WooCommerce MCP endpoint.
	 *
	 * @var string
	 */
	const MCP_ROUTE = 'mcp';

	/**
	 * Constructor.
	 *
	 * @deprecated 11.3.0
	 */
	public function __construct() {
		McpEndpointRemoval::doing_it_wrong( __METHOD__ );
	}

	/**
	 * Formerly initialized the MCP adapter when the WooCommerce MCP feature was enabled.
	 *
	 * @deprecated 11.3.0
	 */
	public function maybe_initialize(): void {
		McpEndpointRemoval::doing_it_wrong( __METHOD__ );
	}

	/**
	 * Formerly created the WooCommerce MCP server.
	 *
	 * @deprecated 11.3.0
	 *
	 * @param object $adapter MCP adapter instance. Ignored.
	 */
	public function initialize_mcp_server( $adapter ): void {
		unset( $adapter ); // Kept for backward compatibility.
		McpEndpointRemoval::doing_it_wrong( __METHOD__ );
	}

	/**
	 * Formerly reported whether the MCP adapter was initialized.
	 *
	 * @deprecated 11.3.0
	 *
	 * @return bool Always false.
	 */
	public function is_initialized(): bool {
		McpEndpointRemoval::doing_it_wrong( __METHOD__ );
		return false;
	}

	/**
	 * Formerly reported whether the current request was for the WooCommerce MCP endpoint.
	 *
	 * @deprecated 11.3.0
	 *
	 * @return bool Always false.
	 */
	public static function is_mcp_request(): bool {
		McpEndpointRemoval::doing_it_wrong( __METHOD__ );
		return false;
	}
}