Foundation is both Space Opera and Science Fiction. The SF was Psychohistory (which is far from magical) and the rest is setting.
Most of the time I'm not the best judge of what's plausible science fiction and what isn't. Most of my understanding of those dividing lines comes from arguments among sci-fi geeks, after all.
On the other hand, I do happen to know enough about history (not a lot, but apparently enough to graduate) to recognize that psychohistory is a lot of hooey. History is an art of hindsight, constructing various and not always contradictory rationales and causes and effects for how events which have already happened unfolded, and why.
Ask ten different historians about the causes of the English Civil War, for example, and you'll get ten different answers. It was either inevitable for decades or avoidable in in the final few years prior to it. The role of social bonds, religion, et cetera. And really there can be multiple causes and effects, cascading just so.
Shit's complicated and a glib reading of Gibbon of history as inexorable forces doesn't mean history can be understood as inexorable forces which can then be micromanaged. Because of this, and because of the ways our theories of history are shifting (and rightly so), sufficient understanding of history does not and cannot translate into the ability to accurately predict historical cause and effect centuries in advance.
Psychohistory is basically nothing more than prophecy given a sci-fi sounding name. It's a nice genre conceit and really the only idea in the Foundation trilogy worth a damn, but that doesn't make it plausible.