Preheat the oven to 350°F. Spray a 12-cup muffin tin with cooking spray. Place some breadcrumbs in the bottoms of the pan to prevent the mac and cheese from sticking. Set aside.
Cook the macaroni according to the package instructions until al dente. Drain and set aside.
In a saucepan over medium heat, melt butter. Stir in flour and cook for 2 minutes, stirring constantly.
Slowly whisk in the milk until smooth. Continue cooking, stirring constantly, until the mixture thickens, about 5 minutes.
Remove saucepan from heat. Stir in cheddar cheese until melted. Season with salt and pepper.
In a large bowl, mix the cooked macaroni, cheese sauce, and beaten egg until well combined.
Spoon the macaroni mixture evenly into the prepared muffin tin.
Sprinkle breadcrumbs evenly on macaroni cups if using.
Bake for 25-30 minutes, or until the tops are golden brown and the centers are set.
Let the mac and cheese cups cool in the muffin tin for at least 10 minutes before removing them. Serve warm.