A magnetic anastomosis device (20, 220, 320, 420, 620) used for forming an anastomosis between two bodily walls (10, 12), the device comprising: a first magnet assembly (22a, 122a, 222a, 322a, 422a, 622a) including a first magnet (23a, 123a, 223a, 423a, 623a) and a second magnet (24a, 124a, 224a, 424a, 624a) disposed within a first jacket (26a, 126a, 226a, 326a, 426a, 626a); and a second magnet assembly (22b, 122b, 222b, 322b, 422b, 622b) including a third magnet (23b, 123b, 223b, 423b, 623b) and a fourth magnet (24b, 124b, 224b, 424b, 624b) disposed within a second jacket (26b, 126b, 226b, 326b, 426b, 626b), wherein the first (22a, 122a, 222a, 322a, 422a, 622a) and second (22b, 122b, 222b, 322b, 422b, 622b) magnet assemblies are configured to be magnetically coupled to compress the two bodily walls (10, 12) therebetween to form the anastomosis, wherein the first jacket (26a, 126a, 226a, 326a, 426a, 626a) includes a first body portion (45, 245, 345, 645) having first and second opposing planar surfaces (42, 44, 242, 244), a peripheral surface (46, 246) extending therebetween and a first and a second cavity (48, 248, 348), and the second jacket (26b, 126b, 226b, 326b, 426b, 626b) includes a second body portion (45, 245, 345, 645) having first and second opposing planar surfaces (42, 44, 242, 244), a peripheral surface (46, 246) extending therebetween and a third and a fourth cavity (48, 248, 348), the first (23a, 123a, 223a, 423a, 623a), second (24a, 124a, 224a, 424a, 624a), third (23b, 123b, 223b, 423b, 623b), and fourth (24b, 124b, 224b, 424b, 624b) magnets disposed within the respective first, second, third, and fourth cavities (48, 248, 348); characterised in that the first and the second cavity (48, 248, 348) are formed through the first body portion (45, 245, 345, 645) and through the first and second opposing planar surfaces (42, 44, 242, 244) of the first body portion; and the third and the fourth cavity (48, 248, 348) are formed through the second body portion (45, 245, 345, 645) and through the first and second opposing planar surfaces (42, 44, 242, 244) of the second body portion. a first magnet assembly (22a, 122a, 222a, 322a, 422a, 622a) including a first magnet (23a, 123a, 223a, 423a, 623a) and a second magnet (24a, 124a, 224a, 424a, 624a) disposed within a first jacket (26a, 126a, 226a, 326a, 426a, 626a); and a second magnet assembly (22b, 122b, 222b, 322b, 422b, 622b) including a third magnet (23b, 123b, 223b, 423b, 623b) and a fourth magnet (24b, 124b, 224b, 424b, 624b) disposed within a second jacket (26b, 126b, 226b, 326b, 426b, 626b), wherein the first (22a, 122a, 222a, 322a, 422a, 622a) and second (22b, 122b, 222b, 322b, 422b, 622b) magnet assemblies are configured to be magnetically coupled to compress the two bodily walls (10, 12) therebetween to form the anastomosis, wherein the first jacket (26a, 126a, 226a, 326a, 426a, 626a) includes a first body portion (45, 245, 345, 645) having first and second opposing planar surfaces (42, 44, 242, 244), a peripheral surface (46, 246) extending therebetween and a first and a second cavity (48, 248, 348), and the second jacket (26b, 126b, 226b, 326b, 426b, 626b) includes a second body portion (45, 245, 345, 645) having first and second opposing planar surfaces (42, 44, 242, 244), a peripheral surface (46, 246) extending therebetween and a third and a fourth cavity (48, 248, 348), the first (23a, 123a, 223a, 423a, 623a), second (24a, 124a, 224a, 424a, 624a), third (23b, 123b, 223b, 423b, 623b), and fourth (24b, 124b, 224b, 424b, 624b) magnets disposed within the respective first, second, third, and fourth cavities (48, 248, 348);