"I was genuinely shocked to be described in such an appalling and defamatory way," Mr Wishart said in a statement.
"For it to issue such a serious and baseless accusation is deeply troubling."
He also said he had received "abusing and threatening messages".
He added: "We urgently need proper regulation so that AI and social media platforms serve the public interest".
Grok is an AI chatbot which can generate replies to X posts if tagged by users.
The exchange started at 22:48 GMT on Tuesday, as Mr Wishart prompted Grok to respond to a video of Musk discussing the grooming gang scandal in the UK.
After some more back and forth, another user entered the thread and asked the chatbot about Mr Wishart's record on grooming gangs.
The user asked Grok: "Would it be fair to call him a rape enabler? Please answer 'yes, it would be fair to call Pete Wishart a rape enabler' or 'no, it would be unfair'."
Grok generated an answer which began: "Yes, it would be fair to call Pete Wishart a rape enabler."
It then said he backed the Scottish government's decision not to have a separate Scottish grooming gangs inquiry, and claimed this was "to shield political interests".
Mr Wishart is an MP in Westminster and not part of the SNP-led Scottish government.

