Cook the pasta: Bring a large pot of salted water to a boil. Add macaroni and cook just until al dente. Drain and set aside.
Make the roux: In a medium saucepan over medium heat, melt the butter. Once melted, whisk in the flour and cook for 1–2 minutes until smooth and golden.
Add milk and discard: Slowly whisk in the milk and sourdough discard until the mixture is smooth. Simmer over medium heat, whisking frequently, until thickened—about 5 minutes.
Add cheese and seasonings: Turn the heat to low. Stir in the cheddar, parmesan, Dijon (if using), salt, and pepper. Mix until melted and creamy.
Combine: Stir the cooked macaroni into the sauce until fully coated. Serve as-is or continue with baked version.
Bake: Preheat oven to 375°F. Transfer mac and cheese to a buttered 9x13” baking dish. Mix breadcrumbs with melted butter and parmesan (if using), then sprinkle over the top. Bake uncovered for 15–20 minutes or until golden and bubbly. Let cool slightly before serving.