Exotic charmonium-like states have been targeted by various experiments in the last 15 years, but their nature still is unknown. Photo-(muo)production is a new promising instrument to study them. COMPASS, a fixed target experiment at CERN, analyzed the full set of the data collected with a muon beam between 2002 and 2011, covering the range from 7 GeV to 19 GeV in the centre-of-mass energy of the (virtual)photon-nucleon system. Production of the X(3872) state in the reaction $mu^+~N rightarrow mu^+(J/psipi^+pi^- )pi^{pm} N$ has been observed with a statistical significance of around 5 $sigma$. The shape of the $pi^+pi^-$ mass distribution from the decay $X(3872)rightarrow J/psipi^+pi^-$ shows disagreement with previous observations. The product of the cross section and the branching fraction of the $X(3872)$ decay into $J/psipipi$ is estimated as 71$pm$28(stat)$pm$39(syst) pb. The results obtained for the production of the $Z_c^{pm}(3900)$ are also reported as well as future perspectives.