In a small bowl, whisk together 2 tablespoons (16 g) all-purpose flour, 1/4 teaspoon baking powder, and 1/8 teaspoon salt. Set the dry mixture aside.
In a separate bowl, whisk 1 tablespoon (14 g) melted unsalted butter with 2 tablespoons (21 g) granulated sugar until combined. Whisk in 1 egg yolk and 1/8 teaspoon vanilla extract until smooth.
Add the flour mixture to the wet mixture and stir to combine. Stir in 1 1/2 tablespoons (3/4 ounce) milk until the batter is uniform. Fold in 1 teaspoon (5 g) rainbow sprinkles, if using. The batter will be thick.
Lightly spray a microwave-safe mug or ramekin (at least 7 oz) with nonstick cooking spray. Pour or spoon the batter into the prepared mug.
Microwave on high for about 1 minute. Test doneness by inserting a toothpick into the center — it should come out with just a few moist crumbs. If it needs more time, microwave in additional 10–15 second increments until done.
Let the mug cake cool for a couple of minutes before eating.
Notes
All microwaves cook differently so your cake might take a little less time or a little more time depending on how it cooks.