Nonlinear optical fibres have been employed for a vast number of applications, including optical frequency conversion, ultrafast laser and optical communication1-4. In current manufacturing technologies, nonlinearity is realized by the injection of nonlinear materials into fibres5-7 or the fabrication of microstructured fibres8-10. Both strategies, however, suffer from either low optical nonlinearity or poor design flexibility. Here, we report the direct growth of MoS2, a highly nonlinear two-dimensional material11, onto the internal walls of a SiO2 optical fibre. This growth is realized via a two-step chemical vapour deposition method, where a solid precursor is pre-deposited to guarantee a homogeneous feedstock before achieving uniform two-dimensional material growth along the entire fibre walls. By using the as-fabricated 25-cm-long fibre, both second- and third-harmonic generation could be enhanced by ~300 times compared with monolayer MoS2/silica. Propagation losses remain at ~0.1 dB cm-1 for a wide frequency range. In addition, we demonstrate an all-fibre mode-locked laser (~6 mW output, ~500 fs pulse width and ~41 MHz repetition rate) by integrating the two-dimensional-material-embedded optical fibre as a saturable absorber. Initial tests show that our fabrication strategy is amenable to other transition metal dichalcogenides, making these embedded fibres versatile for several all-fibre nonlinear optics and optoelectronics applications.