This study aimed to investigate the molecular mechanisms underlying ulcerative colitis (UC)-associated colorectal cancer (CRC) development and identify potential therapeutic targets through integrated multi-omics analysis. Mendelian randomization (MR) analysis, combined with bioinformatics approaches including differential gene expression analysis, protein-protein interaction network construction, gene set enrichment analysis, and single-cell RNA sequencing, was employed. Data were obtained from GEO, TCGA, and genome-wide association study (GWAS) databases. Drug prediction and molecular docking were performed using DSigDB and AutoDockTools. A total of 48 shared genes were identified between UC and CRC, with MMP1 emerging as a significant protective factor (OR = 0.766; 95% CI = 0.593-0.989, P = 0.041). MMP1 demonstrated strong diagnostic potential (AUC = 0.927, 95% CI = 0.895-0.959) and was functionally associated with immune regulation and metabolic pathways. Single-cell analysis revealed predominant MMP1 expression in fibroblasts and immune cells, while immune infiltration analysis showed significant correlations with CD8⁺ T cells and NK cells. Mediation MR analysis indicated that 63.33% of MMP1's protective effect was mediated through naive-mature B cells. Drug prediction identified ilomastat as a potential MMP1 inhibitor with strong binding affinity (binding energy = -7.17 kcal/mol). These findings provide evidence for MMP1's protective role in UC-associated CRC through immune microenvironment modulation, highlighting its potential as a diagnostic biomarker and therapeutic target. The identification of ilomastat as a potential MMP1 inhibitor offers new avenues for targeted therapy in inflammation-associated cancers.