With the rapid development of the x-ray polycapillary optics, there is an increasing demand for an effective simulation tool, considering the real physical process and geometry model, to optimize their performance. In this paper, a Geant4-based Monte Carlo code for X-ray Polycapillary Simulation (GXPS) is developed. Based on the classical electromagnetic theory, an x-ray boundary process is developed using the dielectric model, including total external reflection, Fresnel reflection, and Fresnel refraction. The surface roughness of x-ray polycapillary is taken into account using a classical Gaussian slope distribution model. A new geometry solid for x-ray polycapillary modeling is constructed using a cubic function whose coefficients can be derived based on the parameters of a practical lens. To validate the effectiveness of this code, a point-to-parallel x-ray polycapillary lens is simulated with an x-ray energy of 8.04 keV (Cu K-alpha) and the simulation result is compared with the experiment. Well agreement between the simulation and the experimental result is verified considering the transmission efficiency, the output beam profile, and the divergence angle of the lens. The focusing characteristics of the lens are also demonstrated using this code. The simulation result of the focal spot size agrees well with the predicted value calculated using the empirical relation. Published under license by AIP Publishing.