Yes, you can compost coffee.
Moisture is an essential part of the composting process and it can come from things like leftover black coffee – the liquid stuff – as well as water. Leave it to cool a bit before adding it though, so avoid scalding the decomposition microbes.
(Don’t compost milky or creamed coffee – the dairy might attract rats or other unwanted visitors to your heap. The same goes for dairy substitutes like CoffeeMate – the oils might be just as tempting.)
Coffee grounds are also a great addition to compost heaps. Contrary to logic, they’re a “green” – very nitrogen heavy – so great for balancing out carbon-heavy compost heap (ones that include lots of things like cardboard or dried leaves). (That said, if you’re producing a lot of spent grounds, be careful not to overdose your heap – no more than 25% of your heap should be made up of coffee grounds.)
Worms are also said to be coffee-fiends – they love chomping their way through the grounds in wormeries and compost heaps — and that’s always a good thing for composting.
You can compost most coffee filters too – they’re made from paper. (Though ones with a “heat sealed” edge may include a small amount of synthetic materials at the join.)
There is anecdotal evidence that coffee grounds can help made soils more acidic (which is sometimes desirable) and also help protect delicate plants from slugs and snails. Other people pooh-pooh both ideas but as coffee grounds are such a rich nitrogen resource, a soil improver and will rot down pretty quickly in soil, it doesn’t really hurt to try!
For other ideas about what to do with coffee grounds, see the Recycle This article on that very subject…