In this paper, a merging path generation method based on model predictive control (MPC) method is proposed to optimize the merging point, and the merging path of the merging vehicle, while the motion of the main lane vehicle is optimized at the same time. To simplify the optimization problem which is used to generate the merging trajectory, the longitudinal movement of the merging vehicle is related to the lateral movement of it. To reproduce and make full use of the cooperative driving behavior in merging, the motions of the two relevant vehicles are optimized at the same time. A variable which enables the translation of the merging trajectory of the merging vehicle is introduced into the state of the system. So that when it is necessary to translate the merging trajectory of the merging vehicle for some reason, for example, keeping safe distance, the merging trajectory would be translated and thus the merging point can be optimized. In consideration of the upper bounds of the accelerations and lower bounds of the decelerations that actual vehicles can produce, during merging the accelerations and decelerations of both the relevant vehicles are restricted to appropriate ranges. A computer simulation of three typical merging cases, whose initial conditions are set according to the data drawn from actual merging scene, was conducted on a personal computer to verify the effectiveness of the proposed method. It is shown that the computer simulation results for all the three cases are reasonable. The computational time for all of the three cases is much shorter compare to the time step; therefore the proposed method is quite probable to be implemented on actual vehicles.