Some, but definitely not all. Big touristy attractions and popular hotels will accept cards, but it's a good idea to carry cash. If you're looking to eat Mexican City street food, you'll want to have cash. Similarly, a lot of non-touristy activities in Mexico City will require cash.