Spray a 12-ounce microwave-safe mug with cooking spray or lightly grease with butter to prevent sticking.
Add the peanut butter to the mug and microwave for 10-15 seconds until softened and easy to stir.
Crack the egg directly into the mug with the peanut butter and whisk vigorously with a fork until completely smooth with no streaks.
Add the sugar, milk, and vanilla extract to the mug and stir until well combined and the sugar begins to dissolve.
Add the flour, baking powder, and salt, then gently stir just until no dry flour pockets remain, being careful not to overmix.
Microwave on high power for 60-90 seconds, watching carefully. The cake is done when the top looks mostly set with just a slight jiggle in the center.
Let the mug rest for 1 minute to allow the texture to set and cool slightly before eating. Top with your favorite additions and enjoy with a spoon directly from the mug.