Lobelia inflata L. is a medicinally important species that contains numerous piperidine alkaloids. The main alkaloid lobeline is used as a respiratory stimulant. Recently, there have been studies that report on its effect on the central nervous system, drug abuse, and multidrug resistance. We have studied the piperidine alkaloid formation of in vitro cultivated L. inflata on solid Murashige and Skoog medium. With the aim of increasing the anti-addictive lobeline production, we have investigated the effect of changing MgSO 4 levels of the medium. The compounds (−)-lobeline, norlobelanine, lobelanidine-(−)-8-ethyl-10-phenyl-norlobelionol, (−)-8-ethyl-10-phenyl-lobelionol, norlobeline, lobelidine, and lobelanine were identified by HPLC-tandem mass spectrometry (MS/MS). We studied the effect of changing the MgSO 4 levels on the content of lobeline and its derivatives for in vitro cultivated L. inflata. The highest lobeline content was measured in roots cultured on 185 mg L −1 MgSO 4 -containing medium; this value was 2.5 times higher (232.4 μg g −1 ) than in the control cultures. The greatest (fourfold) increase was observed in lobelidine (71.61 μg g −1 ). Addition of MgSO 4 at 740 mg L −1 resulted in the highest lobeline contents in the herba (aerial tissues; 267.8 μg g −1 ), whereas maximum lobeline production was achieved by a further increase in the MgSO 4 level (1,480 mg L −1 ), due to an intensive increase in biomass production. A slight increase was observed in the amount of lobeline derivatives in the herba grown in 740 mg L −1 MgSO 4 -containing medium. The most significant increase (25%) was recorded in the level of norlobelanine.