The reaction mechanism for the conversion of methanol to hydrocarbons using zeolite catalysts is discussed. In particular, the mechanism of the formation of the initial carbon-carbon bond is considered in terms of the reaction of a surface ylide intermediate with adsorbed methanol. It is suggested that the formation of the initial carbon-carbon bond involves the interaction of the surface-bound ylide intermediate and its associated Bronsted acid site with a methanol molecule. This leads to the formation of a surface ethoxy group from which ethene can be formed by β-elimination. α-Elimination will lead to a higher carbon nucleophile for further reaction with methanol or dimethyl ether. To investigate the suggested scheme, density functional theory calculations are used to discern the nature of the surface ylide species and its interaction with adsorbed methanol. We find that the surface ylide formation step actually results in the insertion of a CH 2 group into the Al-O bond of the cluster representing the zeolite surface. Simple analysis of the wavefunction in terms of atomic charges and bond orders indicates that this CH 2 group has the required nucleophilic character to react with a methanol carbon atom. On the formation of a surface ethoxy group, we find that the Al-O bond is reformed and so the reaction appears to proceed by the formation of transient defects in the zeolite framework. We also suggest that this C-C bond formation will be more facile for clusters of methanol molecules at the active site.