The generation of high levels of ammonia in industries, agricultural sectors, and water treatment plants has triggered the necessity to detect high ammonia concentrations in a flexible way to ensure proactive measures for protecting humans and the environment. Therefore, it is essential to develop highly sensitive multifunctional sensors that have long-term stability, high durability, and a large stretch range. In our work, a novel approach was developed for fabricating flexible sensors consisting of polyurethane (PU) yarn and the loaded Ti3C2Tx/CeO2/TiO2 (abbreviated as MTCe) nanocomposites. The structures and morphology of the yarn-shaped sensors were analysed using X-ray diffraction (XRD), X-ray photoelectron spectroscopy (XPS), scanning electron microscopy (SEM), and other characterisation methods. In addition, gas and strain responses were recorded and analysed using an AES-4SD flexible electronic device. The response of the yarn-shaped sensors to 100 ppm NH3 was 42.9 % at room temperature (25 °C), indicating its excellent gas sensitivity. In addition, the sensors exhibited some key advantages, such as a large stretch range (60 %), high sensitivity (up to 385.285), and good durability (200 stretches/releases at 20 % stretch), which may be considered a remarkable achievement in the field of flexible sensor manufacturing for multiple applications.