The insufficient abundance and weak activity of tumour-infiltrating lymphocytes (TILs) are two important reasons for the poor efficacy of PD-1 inhibitors in hepatocellular carcinoma (HCC) treatment. The combined administration of tanshinone IIA (TSA) and astragaloside IV (As) can up-regulate the abundance and activity of TILs by normalising tumour blood vessels and reducing the levels of immunosuppressive factors respectively. For enhancing the efficacy of PD-1 antibody, a magnetic metal–organic framework (MOF) with a homologous tumour cell membrane (Hm) coating (Hm@TSA/As-MOF) is established to co-deliver TSA&As into the HCC microenvironment. Hm@TSA/As-MOF is a spherical nanoparticle and has a high total drug-loading capacity of 16.13 wt%. The Hm coating and magnetic responsiveness of Hm@TSA/As-MOF provide a homologous-magnetic dual-targeting, which enable Hm@TSA/As-MOF to counteract the interference posed by ascites tumour cells and enhance the precision of targeting solid tumours. Hm coating also enable Hm@TSA/As-MOF to evade immune clearance by macrophages. The release of TSA&As from Hm@TSA/As-MOF can be accelerated by HCC microenvironment, thereby up-regulating the abundance and activity of TILs to synergistic PD-1 antibody against HCC. This study presents a nanoplatform to improve the efficacy of PD-1 inhibitors in HCC, providing a novel approach for anti-tumour immunotherapy in clinical practice.