It’s a bad mortgage credit repair idea
I would strongly advise against it. It’s usually a bad idea to make ANY changes to your credit habit a few months prior to applying for a mortgage.
To start with, applying for a new credit card may harm your credit. Even a few point here and there can make a difference when lenders consider your application for a mortgage.
Closing credit cards is especially bad idea because you lower your available credit, so your balance to credit ratio goes up. Further more, you make your credit history younger, and that actually lowers your credit.
Ask any mortgage officer or advices and you’re bound to get the same answer.
See keeping-a-good-credit-score.html for some credit score Do’s and Don’t.