Preheat oven to 350F
Add the butter to a medium skillet over medium heat; once the butter is melted, add the onions and mushrooms. Cook until softened, but not browned, about 6 to 8 minutes. Add the garlic and tarragon and season with salt and pepper. Cook 2-3 minutes more, stirring constantly. Remove from heat and stir in the cream.
Pour the mixture into 4 individual-sized oven-safe gratin dishes and layer the sliced cheese on top (add as much as you'd like!). Make a well in the center of each dish, cracking an egg into each one.
Bake until the cheese is melted and the eggs are cooked just how you like them (I like mine with set whites and runny yolks, which takes about 10 minutes). Then dig in!