FX screened the first half of the pilot for its upcoming “Legion” series at New York Comic Con, giving “X-Men” fans their first taste of the eight-episode first season, set to premiere in early 2017.

For the uninitiated, “Legion” is set in the “X-Men” world, following mental patient and mutant David Haller (Dan Stevens). “He doesn’t know what’s real, so you don’t necessarily know what’s real either,” showrunner Noah Hawley told the audience.

The “Legion” cast also includes Aubrey Plaza (“Parks and Recreation”) as David’s batty friend Lenny and Rachel Keller (season 2 of “Fargo”) as Syd Barrett, a mysterious young woman David meets in the Clockwork Psychiatric Hospital.

Unlike Netflix’s Marvel entries, the “Legion” is a far more ephemeral story, a trippy piece that feels period at times, modern at others, with the audience never truly sure of what is and isn’t real — or whether that matters.

“It’s not necessarily racing toward a battle with an enemy as much as dealing with the enemy within,” said Hawley, who is also the creative steward of FX’s “Fargo” franchise.

That doesn’t mean “Legion” takes itself too seriously. “I was drawn to the genre because of the pure creative wonder you can find in it,” Hawley said. “We want the show to be fun.”

But at the same time, it reflects real-life issues that are in the headlines every day. “We live in a world where diversity and uniqueness and whether we fit in or don’t fit in is on our minds 24/7,” said Jeph Loeb, Marvel’s head of TV. “‘The X-Men’ have never been more relevant than they are right now.”

Making a series set in a Marvel world can be a complicated affair, particularly when the rights to the characters lie with Fox through a long-term license even though Disney has owned Marvel since 2009. “Legion” is co-produced by Marvel Television and FX Productions.

“The fact that I’m sitting here is an indication that bridges are being made,” Loeb said. “Marvel heroes at their core are people who are damaged, people that are trying to figure out who they are in life, and that doesn’t matter whether they’re ‘X-Men’ characters or Matt Murdock or Tony Stark or Peter Parker. We’re much more interested in the person that’s inside the mask than the mask or cape.”

That bridge might end up bringing the “Legion” characters into the “X-Men” cinematic world, or vice versa. But for now Hawley has a simpler goal: He’s been a fan of the X-Men world since he was a kid.

“There are a lot of corporations with a lot of agendas,” Hawley said. “All we can do is make the best show possible.”