Start by cooking the spaghetti according to package directions.
While the spaghetti is cooking, add all the pesto ingredients to a food
processor or high-speed blender and blend until smooth. Set aside.
Prep the remaining ingredients by chopping the tomatoes and basil, and
draining and rinsing the cannellini beans.
Once the spaghetti is cooked, drain and rinse and add to a large bowl.
Toss with the homemade pesto sauce and fold in the halved tomatoes,
chopped basil, cannellini beans, pine nuts, and mozzarella, if desired.