Q:

What is the varna of a Kayastha?

Kayasthas are said to be descendants of Chitragupta, the deity responsible for recording sins or merits of every living being. Kayasthas are usually referred as the scribe class. Their varna however is very disputed. In Bengal however, Kayasthas are said to be separate to of Brahmins as Bengali Brahmins do not consider themselves as Kayasthas. Nevertheless, even this is disputed. So which varna do Kayasthas especially Bengali ones belong to?

A:

Vedic Origin
The Kayasth trace their genealogy from Adi Purush Shri Chitraguptaji Maharaj. It is said that after Lord Brahma had created the four Varnas (Brahmins, Kshatriyas, Vaishyas and Shudras), Yama snonym Dharamraj requested Lord Brahma to help him record the deeds, good and evil, of men, and administer justice.
Lord Brahma went into meditation for 11000 years and when he opened his eyes he saw a man holding pen and ink-pot in his hands and a sword girdled to his waist. Lord Brahma spoke: Thou hast been created from my body (Kaya), therefore shall thy progeny be known as the Kayasthas. Thou hast been conceived in my mind (Chitra) and in secrecy (gupta), thy name shall also be Chitragupta. Brahma then enjoined him to dispense justice and punish those who violated the dharma.

Thus, the Kayasth's were accorded a dual caste, Brahmin as well as Kshatriya.

In the legends of Shree Chitraguptaji Maharaj, he is referred to as the greatest King, while the rest are rajakas or little kings.

चित्र इद राजा राजका इदन्यके यके सरस्वतीमनु ।
पर्जन्य इव ततनद धि वर्ष्ट्या सहस्रमयुता ददत ॥ RIG VEDA 8/21/18

In the Garud Puran, Chitragupta is hailed as the first man to give the script.
“Chitragupta namastubhyam vedaksaradatre”
(Obeisance to Chitragupta, the giver of letters)
ka_yastha, ka_yata a man belonging to the writer-caste; a tribe of bra_hman.as whose employment is writing (Ka.)(Ka.lex.) Sanskrit Dictionary at The Hindu Universe - Hindu Resource Center.
About Bengali Kayasth
According to Wiki:
According to André Wink, another historian, the caste is first referred to around the 5th–6th century CE, and may well have become so identified during the period of the Sena dynasty. Between that time and the 11th–12th century, this category of officials or scribes was composed of "putative" Kshatriyas and, "for the larger majority", Brahmins, who retained their caste identity or became Buddhists.
But there is one more fact (Not Completely sure about this part):
Sage Parshurama wiped off the Kshatriyas twenty one  times from the face of the  world. During his last crusade, a Kshatriya king named Bhadrasen and his pregnant queen took refuge in the Ashram of sage Talavaya who took them in his shelter and did not allow Lord Parshurama to kill them, being his “Sharnagat” guests. An agreement was reached that :

A child born to the queen, if male, will not follow the Dharma of a >Kshatriya, give up the sword and take to pen for his livelihood.

In course of time the queen delivered a son and his descendent's were called Kayasth.
According to a similar version, while Lord Parshuram extirpated all the Kshatriyas, he spared all the pregnant women as an act of mercy with a warning:

that they (now widowed) would not allow their offspring, if male, to touch >sword or act in any way like a Kshatriya.

This was the women’s pledge while the unborn child was still in the mother’s KAYA (body), i.e., in the womb. So, the unborn child was KAYA-ISTITH, i.e, residing in the Kaya, (the mother’s body)  when the pledge was given These children, after birth came to be called as “KAYASTH”, a slightly corrupted form of “Kaya-Isthith”.
**Descendants of King Chandrasen or CKP **, his son Kayastha and Kayastha's son Somraj ruled Kashmir & most of central India. For people these kings were nice & next to god and hence were called as Prabhu. Chandrasen, son of great King Sahastrararjun, was killed by Lord Parshuram (The great warrior, in order to fulfill his wish to kill every Kshtriya on earth). Chandrasen's pregnant wife Ganga / Kamala took asylum with Dalabhya mooni.
Lord Parshuram demanded mooni to hand over Ganga, but the mooni very wisely asked him to spare this pregnant women. Lord Parshuram agreed to Mooni's request and blessed her that the child born from her ' KAYA " would be called KAYASTHA.
Parshuram said as his father's kingdom has been destroyed; he and his ascendant would live with the help of sword and ink (Asijivi/Masijivi).
This is a mythological story but all agree in saying that it means the descendents of the king Chandrasen who was the Kshatriya (warrior by profession) king, the son of Sahastrararjun of the Haiyaya family.
Another point is tribes of kaya province are Kayastha. The province kaya means Ayodhaya.

