The Oak Brook, Ill., company is hoping that the coffee giveaway will bring in new customers. It's also a way to get existing customers to come in more frequently. And it's likely that those stopping by for a free coffee will be tempted to pick up a breakfast sandwich or other items while there.



Read MoreHow to get the best caffeine buzz for your buck

Breakfast is an important component of McDonald's business, comprising about 20 percent of its U.S. sales.

The announcement comes as Taco Bell rolls out ads to promote its new breakfast menu, which includes a waffle taco. The ads star everyday men that happen to be named Ronald McDonald, the same name as McDonald's mascot.

Chains like McDonald's, Taco Bell and Starbucks—which recently revamped its sandwiches—are all fighting for a piece of the breakfast market because people are increasingly buying breakfast on the go.