Preheat the oven to 350°F (175°C). Grease a 9x9-inch baking dish (or similar) and set aside.
Bake or boil the sweet potatoes: Pierce whole sweet potatoes with a fork and bake on a sheet at 400°F for 45–60 minutes until very tender, or peel and cube then simmer in boiling water until fork-tender (about 15–20 minutes). Drain well.
Mash the sweet potatoes: Place the hot sweet potatoes in a large bowl and mash until mostly smooth. Add the butter, brown sugar, cinnamon, nutmeg, salt, vanilla, milk (or cream), and the egg. Stir until fully combined and creamy. Taste and adjust seasoning or sweetness.
Transfer to the baking dish: Spoon the sweet potato mixture into the prepared baking dish, smoothing the top with a spatula.
Make the streusel (optional): In a small bowl combine chopped pecans, flour, 2 tbsp brown sugar, pinch of salt, and 2 tbsp melted butter. Mix until coarse crumbs form. Sprinkle evenly over the sweet potato layer.
Top with marshmallows: Evenly distribute the mini marshmallows over the top (place them on top of the streusel if using, or directly on the sweet potatoes if skipping streusel).
Bake: Place the casserole in the preheated oven and bake for 20–25 minutes, until the filling is heated through and the marshmallows are puffed and golden. If marshmallows need extra browning, set the oven to broil for 1–2 minutes while watching closely to avoid burning.
Cool briefly and serve: Remove from oven and let rest for 5–10 minutes before serving so the casserole sets slightly. Serve warm.