I’d just cut out the things that cause the bloating, problem solved. Leaky gut also has to do with inflammation and coffee is highly inflammatory. If you are eating inflammatory foods, then this is likely causing the bloating by itself. Check out your foods here:
What are you doing to reduce the inflammation?