Place all pesto ingredients except olive oil and lemon juice in the bowl of a food processor and pulse until chopped. Add ⅓ cup olive oil and lemon juice and pulse until combined. Set aside.
In a large pot, warm 2 tablespoons olive oil over medium-high heat. Add onion and sauté until soft, about five to six minutes. Add the carrot, leek, and celery and cook for another five to six minutes. Add the chicken stock, bring to a simmer, and cook with the lid on until the vegetables are tender, about 30 minutes.
Add the tomatoes and their juice, cabbage, beans, and oregano. Cook until the cabbage is just tender with a bit of crunch, about ten minutes more. Season with salt and pepper. Stir in shredded chicken, if using.
To serve, place soup in bowls and swirl in homemade pesto, as desired.