The X-Men will not be joining The Avengers anytime soon, but if some sort of deal was made, this could be the best way. My friend and fellow CBM user @JourneyIntoMystery expressed how he would just have Doctor Strange open up a different dimension and get the mutants involved. That would probably be the easiest way, but here is how I would blend the world of the mutants with the world of the heroes.
The Avengers have saved the world numerous times and live in the hearts of citizens around the world. They've been around for a long time and will take to space to tackle Thanos very soon. Say, they don't all make it back or the team is in disarray. Either way, the team is not as it was before. With The Avengers MIA, there's no one to keep watch on The Hulk. Alone again, Bruce Banner gives in to his green side and lives on as The Hulk. Overtime, Hulk gets angrier and starts trouble, causes mayhem, destroys something from time to time. The people have had enough, The Avengers are nowhere to be found, what do they do? They call for help. The government decides to take a page out of the Accords and get help from an organization inside of the law. Department H is called upon and they send in their best soldier, The Wolverine. Department H doesn't know he's a mutant, as he doesn't leave a trace of his target once he's done. He doesn't reveal his methods and nobody cares as long as the job is done. Wolverine tracks down and finds The Hulk. They fight it out for a while until Wolverine eventually goes full berserker rage and goes crazy on more than just The Hulk. The military, giving Wolverine a hand with Hulk, gets caught in the crossfire and becomes a target for Wolverine. Memories of the Weapon X experiments haunt and mess with Wolverine leading him to attack them. Eventually Wolverine is neutralized and Hulk gets away. Everything going downhill, they look into the claws that came out of Wolverine's hands. They declare Wolverine dangerous and classify him as a mutant. Believing he's not he only one out there, the public see mutants as threats. After giving mutants a bad name, Charles Xavier feels outraged enough to show the good that can come from his students. He assembles The X-Men to rescue Wolverine and teach him how to control his rage and properly use his powers. With The Avengers gone, a big threat comes to New York, with the X-Men the only people capable of taking on the challenge. Then, they can prove themselves and show the world what mutants can do.
There you have it, The X-Men in the Marvel Cinematic Universe. Just by going off this rough concept, what do you think? Let me know in the comments below!