Start by preheating your oven to 375 degrees F. Using a sharp knife, cut off the tops of the garlic heads and the bottoms of the shallots.
Place the heads of shallots and garlic on a sheet of foil, then drizzle with olive oil, and season with a pinch of salt.
Wrap the foil tightly around the shallots and garlic, then transfer to the oven to roast for 1 hour or until soft.
In a mixing bowl, squeeze the heads of roasted shallots and garlic out of their skins, then mash them around with a fork to form a paste consistency.
Add in the softened cream cheese and sour cream, then mix well before sprinkling in 1/2 cup shredded mozzarella, grated parmesan, chopped parsley, salt, pepper and red pepper flakes. Mix to combine.
Transfer the dip an 8 or 9-inch pie plate, spread into an even layer, and top with remaining shredded mozzarella cheese.
Lower your oven to 350 degrees F then bake the dip for 20-25 minutes or until golden brown and bubbly.
Garnish with more fresh parsley and red pepper flakes before serving alongside bagel chips, toasted bread, or pita chips for dipping!