Peter Stacey, 23, was already wanted by police for shoplifting when he walked into the fast-food restaurant in Harrogate with the ferocious weapon inside his backpack, York CrownCourt heard.
When an officer went into McDonald’s and tried to arrest him, Stacey started “swinging his arms and elbow” at the constable as he resisted arrest, said prosecutor Brooke Morrison.
Stacey was cuffed and charged with possessing an offensive weapon in public, as well as resisting a police constable and stealing over Â£300 of goods from Boots the chemist in Ripon.
He was remanded in custody and appeared for sentence via video link on Thursday knowing that an immediate jail term was all but inevitable.
The court heard that Stacey, of Cedar Close, Ripon, stole an electric razor, Andrex wipes and lip balm worth Â£304 from the Boots store in Market Place on August 29.
The incident at McDonald’s in Cambridge Street, Harrogate, occurred two weeks later, when he walked into the fast-food restaurant on a Friday night with the meat cleaver inside his backpack.
Miss Morrison said that the offences put Stacey in breach of a conditional discharge for possessing heroin and cocaine.
His criminal record included 29 offences ranging from robbery and possessing Class A drugs to a previous conviction for possessing an offensive weapon in 2013, when he was said to have attacked a group of men with a golf club.
Jailing Stacey for 10 months, judge Simon Hickey described the meat cleaver as a “particularly dangerous” weapon and added that the defendant had probably stolen the high-value goods from Boots to fund his drug habit.