In this paper, a computational framework for patient-specific preoperative planning of Robotics-Assisted Minimally Invasive Cardiac Surgery (RAMICS) is presented. It is expected that preoperative planning of RAMICS will improve the success rate by considering robot kinematics, patient-specific thoracic anatomy, and procedure-specific intraoperative conditions. Given the significant anatomical features localized in the preoperative computed tomography images of a patients thorax, port locations and robot orientations (with respect to the patients body coordinate frame) are determined to optimize qualities such as dexterity, reachability, tool approach angles and maneuverability. To address intraoperative geometric uncertainty, the problem is formulated as a Generalized Semi-Infinite Program (GSIP) with a convex lower-level problem to seek a plan that is less sensitive to geometric uncertainty in the neighborhood of surgical targets. It is demonstrated that with a proper formulation of the problem, the GSIP can be replaced by a tractable constrained nonlinear program that uses a multi-criteria objective function to balance between the nominal task performance and robustness to collisions and joint limit violations. Finally, performance of the proposed formulation is demonstrated by a comparison between the plans generated by the algorithm and those recommended by an experienced surgeon for several case studies.