In a large bowl, cream the butter, brown sugar, and granulated sugar until light and fluffy.
Add the egg and vanilla extract and mix until well combined.
In a separate bowl, whisk together flour, cocoa powder, baking soda, and salt.
Add dry ingredients to the wet mixture and mix just until combined.
Fold in the M&M candies, reserving a few for topping.
Chill the dough for 30 minutes for thicker cookies.
Preheat oven to 350°F (175°C) and line a baking sheet with parchment paper.
Scoop dough onto the baking sheet, spacing cookies apart. Press extra M&M’s on top.
Bake for 10–12 minutes, until edges are set and centers look slightly soft.
Cool on the baking sheet for 5 minutes, then transfer to a wire rack.