Hi,
If you can open a browser window from your app then you can authenticate and obtain an access token even with MFA.
If you cannot open a browser window then you can use device flow authentication to get a access token. More info in following acticle:
https://joonasw.net/view/device-code-flow
Hope this helps!