When Disney Plus launched with all of “The Simpsons” episodes, the team behind the longest running primetime TV series in history were thrilled.

“It’s a perfect fit and, you know, 100 million subscribers,” says executive producer Al Jean with a chuckle.

But there was one catch: While Disney Plus has specific tiles on its home screen for Pixar, Marvel and Star Wars, “There’s no tile that actually says ‘The Simpsons,'” he says.

So co-creator and executive producer James L. Brooks suggested “The Simpsons” should invade the rest of Disney Plus, through a series of crossover short films.

“It was just the desire that we had to reach out to the viewers [of] the other branches of Disney Plus, to see if they would be interested in us — you know, if they hadn’t seen us as much,” Jean says.

The first short, “The Force Awakens From Its Nap” — which placed Maggie Simpson inside the world of “Star Wars” — premiered on May 4 (i.e. the May the Fourth “Star Wars” holiday). As that film was wrapping up production in April, Jean zeroed in on Marvel Studios’ series “Loki” for their second film — but they had to move with superhuman speed, since that show was premiering in June.

The result is “The Good, The Bart, and the Loki,” with Tom Hiddleston voicing his signature role as the wily god of mischief after he’s banished from Asgard and lands, to his horror, in Springfield.

“They couldn’t have been nicer at Marvel,” says Jean. “They said, ‘Hey, would you like the Avengers music?’ And we said, ‘Would we?! Yes!'”

As Jean revealed in his conversation with Variety, the team behind the film, lead by director David Silverman, leaned into their knowledge of not just past films and series in the Marvel Cinematic Universe, but the upcoming film “Thor: Love and Thunder” — and, for the final post-credits scene, they had just a week to turn it all around.

There’s a great tableau in which a whole bunch of different Simpsons characters appear as the Springfield Avengers, including Barney Gumble as Iron Man and Milhouse as Hawkeye. How did you decide all that?

That was the most fun thing. In the room, we were just putting them together, and it was really fast. It was like, Patty and Selma are the Scarlet Witch and Agnes. My favorite was Ralph as the Hulk and Herman as Captain America — because he wears the Captain America shield on his shirt because he’s a gun store owner. It was about 10 minutes to put that together. We would’ve had more — I mean, there’s 100 Avengers — but we were just trying to make sure that the production got done on time.

When you made Lisa into Thor, was that a tip of the hat that…

…that Natalie Portman is going to be Thor in “Love and Thunder”? Absolutely. And then, to me, it was really funny that, you know, now that Lisa is Thor, she even has that over Bart, so he’s really aggravated. The parallel between Bart and Lisa and Loki and Thor is pretty clear.

Did Marvel have any notes? Or did they just kind of let you do your thing?

They really were great and supportive. The only note we had was we thought we could have a cameo by Stan Lee. We’re putting as many cameos and post-credits sequences into a four minute short as possible. But they said that their policy is that since he passed, they don’t use him in movies anymore, which I understood completely. And we had him on the show three times, so we had our shot.

The final post-credit sequence evokes the “Loki” Disney Plus show completely, down to the production design. How much turnaround time did you have for that?

A week, and it was really a nail biter. Jim Brooks said, ‘Oh, we’ve got to do something with the series now that it’s on,’ because we were coming out July 7. So that was based on the first episode only. I hadn’t seen the other three, and obviously, I have no idea how it ends, either. I suspect Loki is up to no good. That’s my theory.

Wait, so you had a week to write, record, and animate that?

Yep. We recorded Dawnn Lewis as the Judge. David Silverman turned it around that fast. So that whole ending, whatever, minute, is in a week.

The short ends with Lisa unknowingly sending Bart into oblivion and Loki takes over Bart’s life.

Well, in the last short, Maggie dies. She comes back as a force ghost, but she’s dead. This one, Bart doesn’t seem to have very good ending. [Laughs] Homer seems to be eating Flanders at the end of the Loki story, too, so there’s a lot of grim stuff under the surface!

So do you think that you’ll revisit the world of Marvel or the world of Star Wars again?

We definitely want to keep doing these shorts — definitely [with] those two, but also with the other properties, like Pixar and the classic Disney movies. We’ll probably take a little more time on the next one. We haven’t settled on what we’re going to do yet, but there are just so many things that are just so, you know — I mean, as a kid, I was a huge fan of Marvel. I started collecting when I was six. These are the things that we would want to crossover or parody, anyways.