Put the potatoes in a pot and cover with the chicken broth. Bring to a low boil over medium-high heat. Reduce the heat to low, partially cover and simmer until the potatoes are fork-tender, 15 to 20 minutes.
Preheat the oven to 375 degrees F. Coat a baking dish with nonstick cooking spray.
While the potatoes are cooking, heat the butter in a skillet over medium heat. Add the shallots and cook until translucent and tender, 7 to 8 minutes. Stir in the garlic and cook an additional minute.
Transfer the potatoes and chicken broth to a large mixing bowl. Add the butter mixture and half-and-half. Use a handheld electric mixer or a potato masher to mash the potatoes until smooth and creamy. Stir in the salt, 1 cup of the Gruyere and 1/2 cup Parmesan.
Transfer the mixture to the prepared baking dish and top with the remaining 1 cup Gruyere and 1/2 cup Parmesan. (The dish can be prepared to this point, covered and refrigerated until ready to bake.)
Bake until the cheese is golden and bubbly, about 30 minutes.