Motivation: The identification of T-cell epitopes has many profound translational applications in the areas of transplantation, disease diagnosis, vaccine/therapeutic protein development and personalized immunotherapy. While data-driven methods have been widely used for the prediction of peptide binders with notable successes, the structural modeling of peptide binding to MHC molecules is crucial for understanding the underlying molecular mechanism of the immunological processes. Results: We developed GradDock, a structure-based method for the rapid and accurate modeling of peptide binding to MHC Class I (pMHC-I). GradDock explicitly models diverse unbound peptides in vacuo and inserts them into the MHC-I groove through a steered gradient descent with a topological correction process. The simulation process yields diverse structural conformations including native-like peptides. We completely revised the Rosetta score terms and developed a new ranking function specifically for pMHC-I. Using the diverse peptides, a linear programming approach is applied to find the optimal weights for the individual Rosetta score terms. Our examination revealed that a refinement of the dihedral angles and a modification of the repulsion can dramatically improve the modeling quality. GradDock is five-times faster than a Rosetta-based docking approach for pMHC-I. We also demonstrate that the predictive capability of GradDock with the re-weighted Rosetta ranking function is consistently more accurate than the Rosetta-based method with the standard Rosetta score (approximately three-times better for a cross-docking set). Availability and implementation: GradDock is freely available for academic purposes. The program and the ranking score weights for Rosetta are available at http://bel.kaist.ac.kr/research/GradDock. Contact: firstname.lastname@example.org Supplementary information: Supplementary data are available at Bioinformatics online.