This study shows that microbiome changes induced by bariatric surgery prevent diet-induced obesity and NAFLD by altering GIP signaling. This evidence concerns the gene GIP and obesity due to melanocortin 4 receptor deficiency.