A system for treating obesity includes a first instrument (10, 60) containing a first magnet (42, 42') therein, the first instrument insertable into a stomach (S) of a patient and the first magnet deployable into the stomach of the patient and having a first space (43, 43'). A second instrument (12) contains a second magnet (48) therein, the second instrument insertable into a bowel (B) of a patient and the second magnet deployable into the bowel of the patient and having a second space (47). A stent (52) is insertable into the first and second spaces to maintain an opening formed between the stomach and bowel.