The companies did not disclose financial terms of the deal.
Keurig, based in Waterbury, Vermont, makes at-home brewing machines that let people make cups of coffee one serving at a time. The company is also working on a machine that would let people make cold, carbonated drinks at home, and has partnered with Coca-Cola to let people make various Coke drinks at home.
Kraft had also announced a deal to distribute packaged McDonald's coffee to supermarkets and other retailers. That deal will mean people will also be able to make McCafe drinks with Keurig machines.
Shares of Keurig rose 9 percent to $127.79.