An automatically optimized scheme using micro-genetic algorithm (MGA) was proposed to deal with the rapid design of the rectangular patch antenna with zero-index metamaterials. In order to realize this scheme, an automatic computer aided simulation procedure was constructed by using Visual Basic program to call the finite-difference time-domain method (FDTD). The optimized parameters of the antenna were obtained by running this procedure. A prototype of the antenna was fabricated and measured by utilizing the optimized parameters. The measured results coincided with the simulated ones. As results, over 10 dB enhanced gain was achieved by using this zero index metamaterials. The antenna had a 16.2 dBi maximum gain and achieved a fine impedance matching in the frequency range from 11.7 GHz to 12.6 GHz, which were proved that this scheme was effective and reliable.