Bring a large pot of lightly salted water to a boil. Add potatoes, and cook until tender but firm, about 15 minutes; drain.
In a large bowl, mash potatoes with the butter. With a hand mixer, beat in cream cheese and onion. In a small bowl, beat the egg with a little bit of the mashed potatoes. Stir into potatoes, and season with salt and pepper. Transfer to a 2 quart casserole dish.
Bake 1 hour in the preheated oven, or until puffy and lightly browned.
10 minutes before they're done, top with grated cheddar cheese.