Building envelopes for green buildings should be designed with low energy consumption and low construction costs. A modified competitive search algorithm is used for the optimization of the office building design due to the long runtime of simulation tools such as EnergyPlus and TRNSYS. For the minimization of the cost of construction at the needed energy conservation, the envelope configuration, such as window numbers, walls, glass curtain walls, etc., is optimized. Comparing the proposed algorithm with some others, the cost decreased for the optimum design of the building structure at the needed energy load value. The number of iterations is also reduced by the proposed approach. Moreover, the overall area of the window is increased, which has resulted in the natural ventilation being more proper. Since the ratio of the glass curtain wall is increased, it can result that the indoor lighting being better. Per unit area of the envelope, the value of the energy load is smaller and the total cost is lower for the proposed method in comparison with other algorithms, considering that the opening rate of the window is much the same. The total cost decreased by 37.1% in comparison with the initial design. It can be observed that the MCSA is more efficient than the other compared methods in energy saving of the building in this paper.