BackgroundGlycosyltransferase-associated genes play a crucial role in hepatocellular carcinoma (HCC) pathogenesis. This study investigates their impact on the tumor microenvironment and molecular mechanisms, offering insights into innovative immunotherapeutic strategies for HCC.MethodsWe utilized cutting-edge single-cell and spatial transcriptomics to examine HCC heterogeneity. Four single-cell scoring techniques were employed to evaluate glycosyltransferase genes. Spatial transcriptomic findings were validated, and bulk RNA-seq analysis was conducted to identify prognostic glycosyltransferase-related genes and potential immunotherapeutic targets. MGAT1’s role was further explored through various functional assays.ResultsOur analysis revealed diverse cell subpopulations in HCC with distinct glycosyltransferase gene activities, particularly in macrophages. Key glycosyltransferase genes specific to macrophages were identified. Temporal analysis illustrated macrophage evolution during tumor progression, while spatial transcriptomics highlighted reduced expression of these genes in core tumor macrophages. Integrating scRNA-seq, bulk RNA-seq, and spatial transcriptomics, MGAT1 emerged as a promising therapeutic target, showing significant potential in HCC immunotherapy.ConclusionThis comprehensive study delves into glycosyltransferase-associated genes in HCC, elucidating their critical roles in cellular dynamics and immune cell interactions. Our findings open new avenues for immunotherapeutic interventions and personalized HCC management, pushing the boundaries of HCC immunotherapy.