Facing large-scale, intensive offshore wind farms in wide and deep sea areas, total inspection energy consumption (TIEC) optimization is a key issue to be addressed in unmanned aerial vehicle (UAV) inspection. This paper focuses on the TIEC optimization of UAV automatic inspection of offshore wind farms based on the assistance of mobile edge computing (MEC). To tackle this issue, a system model using a UAV to inspect offshore wind farms automatically and an energy consumption model of UAV assisted by MEC servers and near-earth orbiting satellites for inspecting wind turbines are proposed. Based on this, a combinatorial optimization problem based on the distance-constrained capacitated vehicle routing problem (DCVRP) for minimizing the TIEC of UAV inspection was constructed. To solve the optimization problem, an improved hybrid heuristic algorithm is proposed based on the K-means clustering, smallest enclosing circle (SEC), and Lin-Kernighan-Helsgaun (LKH-3) algorithms. The algorithm solves the optimum location and number of automated UAV airports and minimizes the TIEC for UAV inspection. The simulation experimental results show that in an offshore wind farm with 86 wind turbines, compared with other existing schemes, this scheme requires only four automated UAV airfields and can save at most 51.8% of the TIEC.