In the 17th century when coffee was introduced in Western Europe, Rabbi Yaakov Reischer was asked if coffee can be used on Pesach or if it is considered kitniot (a category of legumes that are not permissible on Pesach for Ashkenazic Jews). After doing some research and seeing that the coffee “bean” grows on a tree in a manner similar to a fruit or berry and is in fact not a bean at all, he permitted it. Rabbi Reischler added that even if coffee were kitniot, the fact that it is roasted and burned before the holiday makes it unfit to be considered food and therefore permits it.
Rabbi Yosef ben David of Breslaum on the other hand forbade coffee on Pesach and said that it was in the category of kitniot.
The HIDA, Rabbi Haim David Yosef Azulai explains that coffee indeed comes from the fruit of a tree and therefore rabbis who thought that it was kitniot were mistaken as it was unclear to them exactly how it was grown.
In the 19th century, Rabbi Chaim Moshe Mordechai Margaliot wrote in his commentary, Shaarei Tshuva that there are some foods that were almost considered to be kitniot but in the end they were permitted. One example is coffee which they were afraid may have gotten mixed with grains or beans. According to Rabbi Margaliot, coffee is allowed but it is best to roast the beans before Pesach so that there are no concerns. Today the coffee is processed before the holiday, so it should not be an issue.
In the early 20th century, many new immigrants from Eastern Europe arrived in America and assumed that coffee “beans” were kitniot. To rectify the situation, Joseph Jacobs from a New York advertising agency checked with rabbinic authorities to see if coffee is considered kitniot. The rabbis ruled that coffee is not kitniot and certified Maxwell House coffee for Passover. Maxwell House took out ads in the Yiddish Forward starting in 1923 and in 1932 they began to print the Maxwell House Haggada which was distributed free in supermarkets throughout the United States. Maxwell House coffee became associated with Pesach and the question of whether coffee was kosher for Pesach never came up again.