Total thoracoscopic valve replacement (TTVR) is a minimally invasive alternative to traditional open-heart surgery. However, some patients undergoing TTVR experience prolonged mechanical ventilation (PMV). Predicting PMV risk is crucial for optimizing perioperative management and improving outcomes. We conducted a retrospective cohort study of 2,319 adult patients who underwent TTVR at a tertiary care center between January 2017 and May 2024. PMV was defined as mechanical ventilation exceeding 72 h post-surgery. A Fine-Gray competing risks regression model was developed and validated to identify predictors of PMV. Significant predictors of PMV included cardiopulmonary bypass time, ejection fraction, New York Heart Association grading, serum albumin, atelectasis, pulmonary infection, pulmonary edema, age, need for postoperative dialysis, hemoglobin levels, and PaO2/FiO2. The model demonstrated good discriminative ability, with areas under the receiver operating characteristic curves of 0.747 in the training set and 0.833 in the validation set. Calibration curves showed strong agreement between predicted and observed PMV probabilities. Decision curve analysis indicated clinical utility across a range of threshold probabilities. Our predictive model for PMV following TTVR demonstrates strong performance and clinical utility. It helps identify high-risk patients and tailor perioperative management to reduce PMV risk and improve outcomes. Further validation in diverse settings is recommended.