"The local congregation is meant, whether in formal assembly for meeting or through its board of elders" (Daniel J. Harrington (S.J.), The Gospel of Matthew [Sacra Pagina Series], Collegeville, The Liturgical Press, 1991, page 269).
He supplements this observation about EKKLHSIA with these words:
"Against this common Near Eastern tendency toward social hierarchy Matthew forbids the use of titles and the exercise of highly authoritative roles (23:8-12) . . . The resistance to hierarchically structured roles and emphasis on equality is typical of sects in the first generation. All the members have begun a new life together and are to participate fully and equally in the emerging community" (Harrington, op. cit., page 323).
"Neither be ye called masters: for one is your master,[even] the Christ" (Matthew 23:10 ASV).
While I do not agree with Harrington's assessment of Matthew's Gospel and his historical-critical presuppositions, his exegesis of Mt 23:8-12 seems correct and his view of the reference for ecclesia (Mt 18:17) is plausible.
On the other hand, Meyer's NT Commentary insists:
Τῇ ἐκκλησίᾳ] is not to be understood of the Jewish synagogue (Beza, Calvin, Fritzsche), which is never called by this name, and any reference to which would be contrary to the meaning of Jesus; but it is to be taken as referring to the community of believers on Jesus (comp. note on Matthew 16:18), which is, as yet, regarded as one body with the apostles included (Matthew 18:18). There is here no allusion to individual congregations in different localities, since these could come into existence only at a later period; neither, for this reason, can there be any allusion to presbyters and bishops (Chrysostom), or to those whom they may have invested, as their representatives, with spiritual jurisdiction (Catholic writers, comp. besides, Döllinger).