tract: Geometry-morphing Micro Aerial Vehicles (MAVs) are gaining more and more attention lately, since their ability to modify their geometric morphology in-flight increases their versatility, while expanding their application range. In this novel research field, most of the works focus on the platform design and on the low-level control part for maintaining stability after the deformation. Nevertheless, another aspect of geometry morphing MAVs is the association of the deformation with respect to the shape and structure of the environment. In this article, we propose a novel Nonlinear Model Predictive Control (NMPC) structure that modifies the morphology of a quadrotor based on the environmental entrances geometrical shape. The proposed method considers restricted entrances as a constraint in the NMPC and modifies the arm configuration of the MAV to provide a collision free path from the initial position to the desired goal, while passing through the entrance. To the authors' best knowledge, this work is the first to connect the in-flight morphology with the characteristics of environmental shapes. Multiple simulation results depict the performance and efficiency of the proposed scheme in scenarios where the quadrotor is commanded to pass through restricted areas.