Adding any organic matter is good.
The thing about coffee grounds is they are free.
I have heard that they are acidic so that might be something to take into consideration.
Add the coffee grounds along with leaves, green manure, and wood chips, and there in my opinion would be no problem.
I have been adding them for almost ten years in different parts of my property.
I have also heard that they help with ant problems.
Chris said,
I mean, I know that fresh, unused coffee grounds are acidic enough that if you top an ant hill with them and water them in, the resultant acid coffee will be enough to burn off their little legs, so I imagine that if the grounds are too fresh, only lightly brewed with, that they might negatively affect the microbiome.
He also said they are worm candy:
Chris said, But I know it's worm candy. Personally, I would get a worm bin started and process at least some through there. It would also act as a worm breeder, so that when you empty the coffee-grounds-turned-worm-castings out onto your garden beds, some eggs and small worms will go with it, and they will take care of any fresh coffee ground additions.
https://permies.com/t/124185/Coffee-grounds-confused-good-bad