Plants operate under a wide range of pH conditions, which makes it difficult to achieve breakthroughs when developing sensors for the in vivo monitoring of bioactive molecules in plants. Herein, we report a highly sensitive and long-life plant sensor for the in situ detection of melatonin (MT) and vitamin B 6 (pyridoxine, PN) in plants. A CuO−poly(L-lysine)/graphene-sensing electrode is the core component of the electrochemical sensor, in which CuO and poly(L-lysine) are mainly responsible for identifying MT and PN, and the three-dimensional (3D) graphene layer amplifies the catalytic current to improve sensitivity. According to differential pulse voltammetry (DPV), the oxidation potential of MT ranges from −0.1 to 0.5 V, while the optimum oxidation potential of PN is about 0.6 V. To adapt to the large differences in plant pH values, a series of linear regression equations were established in the pH range 5.8−7.4, which is convenient for the in situ detection of analytes in plants and their direct detection in puree. Current−time curves reveal a linear concentration range of 0.016−1110 μM for MT, with an average sensitivity of 0.076 μA μM −1 cm −2 , while the linear concentration range for PN is 3−2076 μM, with an average sensitivity of 0.230 μA μM −1 cm −2 (pH 6.8−7.4). The plant sensor is suitable for the in situ determination of MT and PN levels in various fruits; hence, it has important applied value for monitoring growth processes in plants and analyzing components in agricultural products. In addition, this detection strategy can be used to establish the detection modes of other sensors.