Gallic acid (GA) is one of the main phenolic components naturally occurring in many plants and foods and has been a subject of increasing interest owing to its antioxidant and anti-mutagenic properties. This study introduces a novel flexible sensor designed for in situ detecting GA in plant leaves. The sensor employs a laser-induced graphene (LIG) flexible electrode, enhanced with MXene and molybdenum disulfide (MoS2) nanosheets. The MXene/MoS2/LIG flexible sensor not only demonstrates exceptional mechanical properties, covering a wide detection range of 1–1000 μM for GA, but also exhibits remarkable selectivity and stability. The as-prepared sensor was successfully applied to in situ determination of GA content in strawberry leaves under salt stress. This innovative sensor opens an attractive avenue for in situ measurement of metabolites in plant bodies with flexible electronics.