By definition it's not 2FA but it is better than no 2FA. An attacker can know your passwords but they can't get in unless they also have access to the password manager where your 2fa codes are stored.
You could get the device for the 2FA key for your password manager account. Then the device will also be the key to all your other 2FA codes, kind of achieving what you want.
Bitwarden premium ($10 per year) has good 2FA support and a good reputation.