The words follow the close of the Lord's Prayer, which follows 1 Chronicles 29:11
“For thine is the kingdom, and the power, and the glory, for ever” is the doxology of the Lord's Prayer — a late addition to Matthew — and the ritual puts it into Hebrew. The verse it most resembles names more sefirot than the ritual uses.
We see by the occult versicle of the Lord's Prayer, which we have cited in our Doctrine, that it was originally made after two manners
It does not appear in the earliest surviving MSS of the Gospel of Matthew, nor in the parallel version of the Lord's Prayer in Luke. It appears only in later MSS of the Byzantine textual tradition. It is probably an interpolation
It is quite likely that the doxology was inspired by a text from the Hebrew Bible, from the First Book of Chronicles
Thine, O LORD, is the greatness, and the power, and the glory, and the victory, and the majesty; for all that is in the heaven and in the earth is Thine; Thine is the kingdom, O LORD, and Thou art exalted as head above all.