Initially, I wondered if you might be mixing up MongoDB Compass with another part of the MongoDB server platform. However, if you are indeed using the Compass source code, it’s important to note that Compass itself is licensed under the SSPL. This means that if your app incorporates Compass code, the SSPL requires you to open-source the entire GUI application as well.
Your original question isn’t entirely clear, though. Could you share a bit more about what you’re aiming to do? That way, we can provide more specific guidance.