The methylaion of 4-methyl-1H-indole-2-carboxylic acid (I) with NaH and methyl iodide in DMF gives of 1,4-dimethylindole-2-carboxylic acid methyl ester (II), which is condensed with guanidine at 130 C, and treated with methanesulfonic acid in isopropanol.
2-Indolecarboxylic acid (I) was esterified with MeOH and SOCl2 to provide methyl ester (II). Subsequent N-alkylation of (II) using methyl iodide and NaH afforded N-methyl indole (III). Guanidine, liberated by treatment of the hydrochloride salt with NaOMe, was finally condensed with indole ester (III) at 130 C to produce the corresponding acylguanidine, which was isolated as the mesylate salt.