The closest example that I could find is the Irish Brehon law. The Brehon law according to Wikipedia is the oldest surviving codified legal system in Europe and originally it was handed down through oral tradition. These laws according to
the "Prologue to the Senchas Már", Senchas Már being the largest grouping of such legal texts, were in effect from the time of St. Patrick although scholars consider its compiling closer to the 8th century AD.
These laws determine the hierarchy of the society, social status, right and duties stemming from such status and relationships between lords, clients and serfs. So this part is rather similar to the Magna Carta.
In particular, according to the Brehon Law, the king is ranked at the top, parallel with the Bishops and the highest level of poets.
From the Wikipedia page on the status of kings in the Brehon Law, emphasis mine:
...the king is ranked at the top, parallel with the Bishops and the highest level of poets.... To a certain degree, kings acted as agents of the law. While other kings in Europe were able to promulgate law, such as Alfred the Great and his Doom book, the Irish had very little authority to do so. They could collaborate on law authored by the church. Cáin Adomnáin has the names of many kings attached to it who apparently enacted and enforced the law. Additionally, a king could issue a temporary law in times of emergency. But kings could not, by their own authority, issue permanent law codes. Kings also acted as judges, although the extent of their power compared to that of professional jurists has been debated.
Additionally, on the status of the different hierarchies that existed:
Although the various groups were theoretically on par with each other, the church apparently had supremacy. Críth Gablach states "Who is nobler, the king or the bishop? The bishop is nobler, for the king rises up before him on account of the Faith; moreover the bishop raises his knee before the king."
Generally, the rights and obligation of everyone derived from a complex favor-based hierarchy, that determined the lordship level from the number of clients they had. As a result, gaelic lordship was not conferred by the king.
The levels of lordship were according to the above source were:
- flaith aithig - 'commoner lord' - having 10 clients - but not yet a
lord because 3 generations haven't provided aire ('care') to clients
yet. Also called fer fothlai ('man of withdrawal') because he is
withdrawing from the rank of commoner
- aire déso - 'lord of vassalry' - having 10 clients. Although
translated as 'lord of vassalry', 'aire' literally means 'care' and
'caregiver'. Lords care for their clients. The word 'aire' is also
used for government ministers in modern Irish.
- aire ard - 'high lord - having 20 clients
- aire tuíseo - 'lord of leadership' - having 27 clients
- aire forgill - 'lord of superior pledge' (or superior testimony) -
having 40 clients
Again from Wikipedia:
Much depended on status, and each rank was assigned an honour that was quantified in an honour-price to be paid to them if their honour was violated by certain crimes. The types of food one received as a guest in another's house, or while being cared for due to injury varied based on status. Lower honour-prices limited the ability to act as sureties and as witnesses. Those of higher status could "over-swear" the oaths of those of lower status.
So overall, the Brehon Law was above all, defining the rights of the Church as being above the king, and creating a social hierarchy with defined rights and obligation for everyone, including kings, that could not be changed by said kings unilaterally.