Spray a large (12 ounces) mug with nonstick cooking spray. Stir together gluten-free flour, cocoa powder, sugar, and baking powder in the mug. Add egg, oil, and milk. Stir until smooth with a fork or mini whisk. Stir in mini-chocolate chips if using.
Microwave on high for 60-80 seconds or until cake pulls away from the sides of the mug and the top looks dry. Allow cake to cool in the mug. Top warm cake with vanilla ice cream or whipped cream, if desired. Or allow the cake to cool and frost.
For the Oven
Preheat oven to 350 degrees. Follow step one above. Be sure to use an oven-safe mug. Place mug on a baking sheet. Bake until set, about 20 minutes.
For the Frosting
Beat together the butter and powdered sugar until smooth with a spoon. Add milk. Mix until creamy. Spread frosting on cooled cake. If you put the frosting on the hot cake, it will melt.