This paper presents how one can adjust the McNemar’s test for the analysis of clustered matched-pair data. A McNemar’s-like table for K clusters of matched-pair data is used.
McCarthy, William F., "Adjustment to the McNemar’s Test for the Analysis of Clustered Matched-Pair Data" (July 2007). COBRA Preprint Series. Working Paper 29.