An anastomosis device includes a collapsible frame forming a funnel with a wide opening narrowing to a central lumen and a membrane covering the collapsible frame. The collapsible frame and the membrane provide a collapsed configuration suitable for endoluminal delivery to a stomach of a patient, and an expanded configuration suitable for lining an internal surface of a gastric wall of the stomach. The anastomosis device further includes an anastomosis component extending from the central lumen of the collapsible frame and being configured to pass through a first hole in the gastric wall and a second hole in a small intestine of the patient and form a sealed connection between the gastric wall and the small intestine. The funnel is configured to substantially close off the pylorus and direct food entering the stomach into the wide opening, through the funnel and into the small intestine via the anastomosis component.