For a multiclass classification problem, how do we find the cohen kappa score?

So I have a multiclass classification problem and I have found the Matthews Correlation Coefficient of that (https://scikit-learn.org/stable/modules/model_evaluation.html#matthews-correlation-coefficient). Now I want to find the Cohen kappa score for the problem. How do I formulate the Cohen kappa score with respect to a multiclass confusion matrix? What are the equations that form TP, TN, FP, and FN?