Michael McCabe, 37, of no fixed address, pleaded guilty to racially aggravated criminal damage and two other counts of criminal damage.
Mobile phone footage shared on social media showed him damaging cars near St Margaret's Way in Leicester, during the afternoon rush hour on 4 August.
McCabe was also convicted of two assaults at Glenfield Hospital.
Leicester Magistrates' Court heard that McCabe started shouting racial abuse at a couple in one of the vehicles and as the driver tried to drive away slowly, he punched the windscreen and damaged the wipers.
The couple said the language he used "scared" them.
McCabe jumped on to two other cars, hitting their windscreens, before police arrived.
The court heard he kicked out at officers and there was a scuffle on the floor before he was taken into custody.
Magistrate Paul Forrester-Brown was told McCabe quickly admitted causing criminal damage and said he could not remember much of what happened as he had drunk one and a half litres of vodka and beer.
The nine week sentence was given for what were described by Mr Forrester-Brown as "unprovoked assaults".
McCabe, who appeared via video link from Lincoln Prison, was also found guilty of punching a patient and a nurse at the Bradgate Mental Health Unit at Glenfield Hospital on 13 August.
A man who was filmed jumping on to a moving car and punching its windscreen has been jailed for nine weeks.