Preheat the oven to 350°F and line baking sheets with parchment paper.
In a large bowl, whisk together the melted butter, granulated sugar, and brown sugar until smooth and glossy. Add the egg and vanilla and whisk again until fully combined.
In a separate bowl, whisk together the flour, cocoa powder, baking soda, and salt.
Add the dry ingredients to the wet ingredients and fold just until combined. The dough should be thick, rich, and fudgy.
Gently fold in the peanut butter M&M’s, being careful not to overmix so they stay whole.
Scoop the dough into 2-tablespoon portions for bakery-style cookies and place them on the prepared baking sheets.
Bake for 9 to 11 minutes, until the edges are set but the centers still look slightly soft and underbaked.
Let the cookies cool on the pan for about 5 minutes before transferring to a cooling rack. They’ll set as they cool while staying soft in the center.