PARP7 plays a crucial role in cancer immunity. The inhibition of PARP7 has shown potential in boosting the immune response against cancer, making it an attractive target for cancer immunotherapy. Herein, we employed a rigid constraint strategy (reduction in molecular flexibility) to design and synthesize a series of novel indazole-7-carboxamide derivatives based on the structure of RBN-2397. Among these derivatives, (S)-XY-05 was identified as the most promising PARP7 inhibitor (IC 50 : 4.5 nM). Additionally, (S)-XY-05 showed enhanced selectivity toward PARP7 and improved pharmacokinetic properties (oral bioavailability: 94.60%) compared with RBN-2397 (oral bioavailability: 25.67%). In the CT26 syngeneic mouse model, monotherapy with (S)-XY-05 displayed a strong antitumor effect (TGI: 83%) by activating T-cell-mediated immunity within the tumor microenvironment. Collectively, we confirmed that (S)-XY-05 has profound effects on tumor immunity, which paves the way for future studies of PARP7 inhibitors that could be utilized in cancer immunotherapy.