Current simulation models considerably underestimate local-scale, short-duration extreme precipitation induced by tropical cyclones (TCs). This problem needs to be addressed to establish active response policies for TC-induced disasters. Taking Shanghai, a coastal megacity, as a study area and based on the observations from 192 meteorological stations in the city during 2005–2018, this study optimized the parameterized Tropical Cyclone Precipitation Model (TCPM) initially designed for TCs at the national scale (China) to the local or regional scales by using machine learning (ML) methods, including the random forest (RF), extreme gradient boosting (XGBoost), and ensemble learning (EL) algorithms. The TCPM-ML was applied for multiple temporal scale hazard assessment. The results show that: (1) The TCPM-ML not only improved TCPM performance for simulating hourly extreme precipitations, but also preserved the physical meaning of the results, contrary to ML methods; (2) Machine learning algorithms enhanced the TCPM ability to reproduce observations, although the hourly extreme precipitations remained slightly underestimated; (3) Best performance was obtained with the XGBoost or EL algorithms. Combining the strengths of both XGBoost and RF, the EL algorithm yielded the best overall performance. This study provides essential model support for TC disaster risk assessment and response at the local and regional scales in China.