The sequence of enzymatic reactions by which the mRNA 5' cap structure, an inverted 7-methylguanosine linked via a 5'-5' triphosphate bridge (
m7G(5')ppp(5')X) to the first transcribed residue, is added to a nascent transcript. Additional methylation can occur on the ribose sugars of the first and second nucleotides adjacent to the
m7G nRNA cap. These methylations are often referred to as N6,2'-O-dimethyladenosine (
m6,2A) and N6,2'-O-dimethylguanosine (
m6,2G), respectively.