Are coffee tree berries edible? According this legend, somebody called Sheik Omar chewed on coffee berries when living in exile. It is mentioned he found them too bitter at the time. But is it possible to eat them?

Also, according wikipedia: "The caffeine in coffee "beans" is a natural plant defense against herbivory, i.e., a toxic substance that protects the seeds of the plant."

But clearly that does not poison us humans.
TL;DR Yes, they are edible and non-toxic to humans.

Coffee cherries, as they are properly called, are a thin papery skin and attached mucilage (what we think of as the flesh of the fruit). Coffee cherries are consumed as a drink, cascara, by coffee farmers in Latin America. 

Coffee cherries contain more caffeine than coffee, on average, as they do not go though a roasting process. Depending on the green processing / pulping / milling process the coffee went through, coffee cherries often have a bitter and gamy flavor.