We report the first results on a direct search for a new 16.7 MeV boson (X) which could explain the anomalous excess of e+e- pairs observed in the excited Be-8 nucleus decays. Due to its coupling to electrons, the X could be produced in the bremsstrahlung reaction e- Z -> e- Z X by a 100 GeV e- beam incident on an active target in the NA64 experiment at the CERN SPS and observed through the subsequent decay into an e+e- pair. With 5.4times 10^{10} electrons on target, no evidence for such decays was found, allowing to set first limits on the X-e^- coupling in the range 1.3times 10^{-4} < epsilon_e < 4.2times 10^{-4} excluding part of the allowed parameter space. We also set new bounds on the mixing strength of photons with dark photons (A) from non-observation of the decay A->e+e- of the bremsstrahlung A with a mass <~ 23 MeV.