We report strong cosmological constraints on the Brans-Dicke ( BD ) theory of gravity using Cosmic Microwave Background data . We consider two types of models . First , the initial condition of the scalar field is fixed to give the same effective gravitational strength G _ { eff } today as the one measured on the Earth , G _ { N } . In this case the BD parameter \omega is constrained to \omega > 177 at the 95 \% confidence level , improving by a factor of two over previous constraints . In the second type the initial condition for the scalar is a free parameter leading to a somewhat stronger constrain of \omega > 288 while G _ { eff } is constrained to 0.97 < G _ { eff } / G _ { N } < 1.22 at the 95 \% confidence level . We argue that these constraints have greater validity than for the BD theory and are valid for any Horndeski theory which approximates BD on cosmological scales . In this sense , our constraints place strong limits on possible modifications of gravity that might explain cosmic acceleration .