In hepatocellular carcinoma treatment, sorafenib, oxaliplatin, 5-fluorouracil, capecitabine, lenvatinib, and donafenib are first-line drugs; regorafenib, apatinib, and cabozantinib are second-line drugs; and oxycodone, morphine, and fentanyl are commonly used analgesics. However, the high degree of inter- and intra-individual variability in the efficacy and toxicity of these drugs remains an urgent issue. Therapeutic drug monitoring (TDM) is the most reliable technical means for evaluating drug safety and efficacy. Therefore, we developed an ultra-performance liquid chromatography–tandem mass spectrometry (UPLC–MS/MS) method for simultaneous TDM of three chemotherapy drugs (5-fluorouracil, oxaliplatin, and capecitabin), six targeted drugs (sorafenib, donafenib, apatinib, cabozantinib, regorafenib, and lenvatinib), and three analgesics (morphine, fentanyl, and oxycodone). We extracted 12 analytes and isotope internal standards (ISs) from plasma samples by magnetic solid phase extraction (mSPE) and separated them using a ZORBAX Eclipse Plus C18 column with water containing 0.1% formic acid and methanol containing 0.1% formic acid as the mobile phase. The analytical performance of our method in terms of sensitivity, linearity, specificity, carryover, precision, limit of quantification, matrix effect, accuracy, dilution integrity, extraction recovery, stability, and crosstalk of all the analytes under different conditions met all the criteria stipulated by the guidelines of the Chinese Pharmacopoeia and U.S. Food and Drug Administration. The response function was estimated at 10.0–10 000.0 ng/mL for sorafenib, donafenib, apatinib, cabozantinib, regorafenib, and lenvatinib, and 20.0–20 000.0 ng/mL for 5-fluorouracil, oxaliplatin, capecitabin, morphine, fentanyl, and oxycodone, with a correlation of > 0.9956 for all compounds. The precision and accuracy of all analytes were < 7.21% and 5.62%, respectively. Our study provides empirical support for a simple, reliable, specific, and suitable technique for clinical TDM and pharmacokinetics.