Paul Monaghan, who won the Caithness, Sutherland and Easter Ross seat from Liberal Democrat John Thurso, retweeted and praised the Twitter user - who goes under the name Claire Robertson and carries the SNP logo on their account - prior to the general election on May 7.
Among her posts was a video of a storm flooding Barmouth in Wales, accompanying which she wrote: “pity it cant hit birmingham then we could get rid of all the pakis.”
She also posted a picture of a person hanging from a gibbet with the words: “typical No voter after sep 18.”
Ms Robertson, who is on her second account after the first was closed down by Twitter, also made sexual comments about acting Scottish Labour leader Jackie Baillie, former Scottish Labour leader Johannn Lamont and the Queen.
After Ms Robertson’s original account was closed down, Dr Monaghan followed her new account and praised her.
He said: “We all have different roles in this. You fulfil yours spectacularly well. I mean it. Keep it up.”
He tweeted her: “I enjoy all your posts and your sense of humour. Keep it up.”
Last week the SNP admitted it had failed to take action against 45 Twitter trolls identified as party members in a Labour dossier. In a televised discussion on bullying on Thursday, former First Minister Alex Salmond suggested anyone posting offensive remarks on social media should identify themselves.
Labour’s shadow Scottish Secretary Ian Murray said: “Just last week Alex Salmond was on TV calling for online trolls to be named and shamed. But it appears that the calls from the SNP leadership to deal with online abuse is not matched by their actions or their own MPs.
“Mr Monaghan has chosen to not only follow but admire and encourage somebody who has professed deeply racist views, makes gratuitous comments about women in public life and appears to have been urging violence against supporters of Scotland staying in the UK.
“Nicola Sturgeon should live up to her word and take action. This is not the kind of behaviour Scots would see as acceptable from someone who is in elected office. People across Scotland expect better.”
An SNP spokesman said: “Dr Monaghan firmly holds the view that the online debate must be respectful at all times, as the First Minister has made very clear, and of course he both accepts and adheres to that position.
“The SNP will take appropriate action on members whose behaviour falls below the standards we expect. We fully expect other parties to do the same – everyone has a responsibility to maintain a positive level of political debate online and elsewhere.”