This paper describes the generation of genetically engineered bioluminescent magnetotactic bacteria (BL-MTB) and their integration into a microfluidic analytical device to create a portable toxicity detection system. Magnetospirillum gryphiswaldense strain MSR-1 was bioengineered to constitutively express a red-emitting click beetle luciferase whose bioluminescent signal is directly proportional to bacterial viability. The magnetic properties of these bacteria have been exploited as "natural actuators" to transfer the cells in the chip from the reaction to the detection area, optimizing the chip's analytical performance. A robust and cost-effective biosensor for the evaluation of sample toxicity, named MAGNETOX, based on lens-free contact imaging detection, has been developed. A microfluidic chip has been fabricated using multilayered black and transparent polydimethyl siloxane (PDMS) in which BL-MTB are incubated for 30 min with the sample, then moved by microfluidics, trapped, and concentrated in detection chambers by an array of neodymium-iron-boron magnets. The chip is placed in contact with a cooled CCD via a fiber optic taper to perform quantitative bioluminescence imaging after addition of luciferin substrate. A model toxic compound (dimethyl sulfoxide, DMSO) and a bile acid (taurochenodeoxycholic acid, TCDCA) were used to investigate the analytical performance of the MAGNETOX. Incubation with DMSO and TCDCA drastically reduces the bioluminescent signal in a dose-related manner. The generation of bacteria that are both magnetic and bioluminescent combines the advantages of easy 2D cell handling with ultra sensitive detection, offering undoubted potential to develop cell-based biosensors integrated into microfluidic chips.