It was certainly published as by Twain back in 1916 but much of it had been written by his literary executor, Albert Bigelow Paine, who omitted a quarter of the text and invented the character of the astrologer. Project Gutenberg notes this in a prefatory note:
"The Mysterious Stranger" was written in 1898 and never finished. The editors of Twain's "Collected Works" completed the story prior to publication. At what point in this work Twain left off and where the editor's began is not made clear in the print copy used as the basis of this eBook.
That's a bit of an over simplification since Twain rewrote the manuscript a couple of times, with the third and final version being called No. 44, the Mysterious Stranger: Being an Ancient Tale Found in a Jug and Freely Translated from the Jug. That version was finally published in 1982 as part of The Mark Twain Library Series. It's considered the definitive edition, and is probably what Twain would have published himself.
So if you have read the bogus Paine version of the work you might want to head to the library and get the restored version to get an idea of what Twain really had in mind. After you read Fred's essay, of course.