But it occurs to me now that ST:TMP has a whole lot in common with a first-season Space: 1999 episode: "Ring Around the Moon."
Here is a summary that covers both stories pretty evenly:
A giant computer brain travels across the universe, seeking knowledge, on a mission that is no longer relevant.
It attacks human ships and destroys them.
It teleports a key female crew member away and returns her as an automaton in order to gather more information from the humans' computer, potentially at the cost of her human life.
It uses force field projections/tractor beams to push away and pull in a human ship.
It is finally defeated by revealing to it the truth of its mission, even though it doesn't want to believe the truth and tries at first to resist receiving that knowledge.
As an addendum, I'd point out another episode in that first season of 1999 dealt with the massive danger when a Voyager spacecraft from Earth returns, thinking it is doing good but actually causing great destruction. Sounds familiar, eh?
A direct ripoff? Probably not. But a strong argument can be made that the '79 Trek film borrowed at least as much, by accident if not on purpose, from good old Commander Koenig and Space: 1999.
Van Allen Plexico is an award-winning SF/adventure novelist and non-fiction writer and podcaster, as well as an associate professor of Political Science and History.
You can read Van's own interstellar saga of politics, religion and cosmic warfare in "The Shattering" from White Rocket Books, available here. The third volume of the Legion trilogy recently won Novel of the Yearin the 2015 Pulp Factory Awards.
He's on Facebook as Van Allen Plexico.
Follow him on Twitter: @vanallenplexico
The White Rocket Podcast and White Rocket TV can be accessed at http://www.whiterocketbooks.com