Costco switched who they partner with close to a decade ago. Pre-2015, they were American Express only. Now they are apparently Visa only in the US, while here in Canada they are Mastercard only
Costco is a weird one. They accept both for payment , but can only refund back to Visa. Source : Me, As I have personally experienced this at Costco in California. Maybe it's just this specific store/region
My Illinois Costco for sure doesn't take a Mastercard Credit card. They do take a Mastercard DEBIT card.
In TN they (last time I tried) didn't take MasterCard at all. The gas pumps are really unhelpful about it, too.
I hated having to use my 'backup' Mastercard for Costco purchases.