Background: Improving physical activity, especially in combination with optimizing protein intake, after surgery has a potential positive effect on recovery of physical functioning in patients after gastrointestinal and lung cancer surgery. The aim of this randomized controlled trial is to evaluate the efficacy of a blended intervention to improve physical activity and protein intake after hospital discharge on recovery of physical functioning in these patients. Methods: In this multicenter single-blinded randomized controlled trial, 161 adult patients scheduled for elective gastrointestinal or lung cancer surgery will be randomly assigned to the intervention or control group. The purpose of the Optimal Physical Recovery After Hospitalization (OPRAH) intervention is to encourage self-management of patients in their functional recovery, by using a smartphone application and corresponding accelerometer in combination with coaching by a physiotherapist and dietician during three months after hospital discharge. Study outcomes will be measured prior to surgery (baseline) and one, four, eight, and twelve weeks and six months after hospital discharge. The primary outcome is recovery in physical functioning six months after surgery, and the most important secondary outcome is physical activity. Other outcomes include lean body mass, muscle mass, protein intake, symptoms, physical performance, self-reported limitations in activities and participation, self-efficacy, hospital readmissions and adverse events. Discussion: The results of this study will demonstrate whether a blended intervention to support patients increasing their level of physical activity and protein intake after hospital discharge improves recovery in physical functioning in patients after gastrointestinal and lung cancer surgery. Trial registration: The trial has been registered at the International Clinical Trials Registry Platform at 14–10-2021 with registration number NL9793. Trial registration data are presented in Table 1.