Previous studies have suggested that the gut microbiota (GM) is closely associated with the development of autoimmune cholestatic liver disease (ACLD), but limitations, such as the presence of confounding factors, have resulted in a causal relationship between the gut microbiota and autoimmune cholestatic liver disease that remains uncertain. Thus, we used two-sample Mendelian randomization as a research method to explore the causal relationship between the two. Pooled statistics of gut microbiota from a meta-analysis of genome-wide association studies conducted by the MiBioGen consortium were used as an instrumental variable for exposure factors. The Pooled statistics for primary biliary cholangitis (PBC) and primary sclerosing cholangitis (PSC) were obtained from the R9 version of the FinnGen database (https://r9.finngen.fi/). Inverse-variance Weighted (IVW), cML-MA, MR-Egger regression, Weighted median (WME), Weighted mode (WM), and Simple mode (SM) were used to detect the association between intestinal flora and the causal relationship between intestinal flora and ACLD, in which IVW method was dominant, was assessed based on the effect indicator dominance ratio (odds ratio, OR) and 95% confidence interval (CI). Sensitivity analysis, heterogeneity test, gene pleiotropy test, MR pleiotropy residual sum and outlier test (MR-PRESSO) were combined to verify the stability and reliability of the results. Reverse Mendelian randomization analysis was performed on gut microbiota and found to be causally associated with ACLD. The IVW results showed that the relative abundance of the genus Clostridium innocuum group, genus Butyricicoccus, and genus Erysipelatoclostridium was negatively correlated with the risk of PBC, that is, increased abundance reduced the risk of PBC and was a protective, and the relative abundance of the genus Eubacterium hallii was positively correlated with the risk of PSC, which is a risk factor for PSC. Family Clostridiaceae1 and family Lachnospiraceae were negatively correlated with the risk of PSC, which is a protective factor for PSC. This study found a causal relationship between gut microbiota and ACLD. This may provide valuable insights into gut microbiota-mediated pathogenesis of ACLD. It is necessary to conduct a large-sample randomized controlled trial (RCT) at a later stage to validate the associated role of the relevant gut microbiota in the risk of ACLD development and to explore the associated mechanisms.