Prussian blue analogues have shown promise as cathode materials competing with sodium ion batteries, while the presence of water molecules severely affects their performance in batteries. Based on density functional theory, the effect of water molecules on the diffusion of alkali ions is revealed by employing CuHCF (copper hexacyanoferrate) as a cathode. The diffusions of alkali ions in CuHCF with or without inserted water molecules are investigated. It was found that Li