We have synthesized an organic–inorganic polyaniline–halloysite nanotube composite by an in situ polymerization method. This nanocomposite is immobilized on a stainless-steel wire and can be used as a fiber coating for solid-phase microextraction. It was found that our new solid-phase microextraction fiber is an excellent adsorbent for the extraction of some volatile organic compounds in aqueous samples in combination with gas chromatography and mass spectrometry. The coating can be prepared easily, is mechanically stable, and exhibits relatively high thermal stability. It is capable of extracting phenolic compounds from water samples. Following thermal desorption, the phenols were quantified by gas chromatography with mass spectrometry. The effects of extraction temperature, extraction time, sample ionic strength, stirring rate, pH, desorption temperature and desorption time were studied. Under optimal conditions, the repeatability for one fiber (n = 5), expressed as the relative standard deviation, is between 6.2 and 9.1%. The detection limits range from 0.005 to 4 ng/mL. The method offers the advantage of being simple to use, with a shorter analysis time, lower cost of equipment and higher thermal stability of the fiber in comparison to conventional methods of analysis