Since the Kraft Company put it in a box in 1937 every American kid grew up with macaroni and cheese. There can be no doubt that its ultimate origins are Italian, as one finds macaroni and cheese recipes from the late thirteenth century in southern Italy. The anonymous Liber de coquina, written in Latin by someone familiar with the Neapolitan court then under the sphere of Charles II of Anjou (1248-1309) has a recipe called de lasanis which we can call the first “macaroni and cheese” recipe. It was a macaroni, in this case, lasagne sheets made from fermented dough and cut into two-inch squares that were cooked in water and tossed with grated cheese, probably Parmesan. The author suggests using powdered spices and layering the sheets of lasagne, just like today, with the cheese if desired.
But the American macaroni and cheese has two main lines of ancestry claimed. In the first, it is thought that macaroni and cheese was a casserole that had its beginnings at a New England church supper. In southeastern Connecticut it was known long ago as macaroni pudding. In the second, and more famous story, and more than likely the original story, it is said that the classic American macaroni and cheese returned with Thomas Jefferson to Virginia after his sojourn in Italy. Jefferson had brought back a pasta machine from Italy. His daughter Mary Randolph became the hostess of his house after Jefferson’s wife died and she is credited with inventing the dish using macaroni and Parmesan cheese. Later, the Parmesan was replaced with cheddar cheese. Anyway, that's one story. It is more likely that Jefferson encountered the dish in Italy and brought back the recipe.