Jonathan Bell harassed SNP politician Carol Monaghan between January and April 2019. Prosecutors stated the 35-year-old lead the Glasgow North West MP to believe she was at risk of serious harm.
She and her family were taken to a police safe house as a result.
The crime included Bell contacting Crimestoppers saying that her "life was in danger".
He also smeared tomato sauce on the door and window of the Miss Monaghan's constituency office in the city's Partick.
The ketchup was initially feared to have been blood.
Bell, of the city's Broomhill, also posted photos of this on social media alongside an offensive comment.
He tweeted the MP at one stage: “Carol Monaghan why are people saying your life is in danger?”
Bell also stated in reference to Brexit: “SNP MP is going against democracy.”
He then left a concerning voicemail message on Miss Monaghan’s office phone.
Bell pleaded guilty to a charge of engaging in a course of conduct which caused Miss Monaghan fear or alarm.
Paul Hannah, defending, said: "There was opposition to leave the EU and Miss Monaghan was one such public figure who borrowed words from the publicity to stop Brexit.
"Mr Bell in response had a Twitter account called 'Democracy is threat to free speech 19'.
"A number of people online expressed the view that the decision having been made should be accepted and implemented.
"He saw something online which he took to be a statement of threat against Miss Monaghan.
"He contacted Crimestoppers to report that and then posted a message on his own Twitter account saying 'Carol Monaghan why are people saying your life is in danger?'
"The MP was in Westminster and having regard to the way the message was interpreted she flew back to Glasgow and was escorted home by police.
"She was also told not to walk home from her constituency office."
The court also heard Bell made admissions to police after his arrest and stated he was "awfully sorry" for his actions.
Sheriff Martin Jones QC ordered Bell to do 180 hours of unpaid work and put under supervision for two years. He was also tagged for six months keeping him indoors between 7pm and 7am.
A non-harassment order was also granted restricting Bell from contacting the MP for five years.
The sheriff said: "Let me make this clear, your behaviour was disgraceful and can't be condoned.
"You cannot behave in this way and the court will take a very serious view of that.
"These are means of objecting in political debate but you must not intimidate members of parliament, do you understand?"
Bell replied: "Yes."
Ms Monaghan was on the Westminster committee in May who quizzed ex-Downing Street adviser Dominic Cummings on the Government's handling of the Covid crisis.