Last time I added coffee to a porter, I coarsely cracked the beans, put them in a nylon hop bag and added them to the keg. I don't recall the amount of coffee, but I could look it up. Previously, I've dosed the keg with espresso, which is obviously not cold extraction.
The beans directly into the keg gave a smoother coffee flavor.