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 and milk. 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.