I've never done this before, but I would toast the pecans in the oven for like 10 minutes, then crush them and add them to the mash. This just seems like the best way to do it. I wouldn't boil them, seems odd to me and might not taste right in the finished beer, and if you kept them whole, you wouldn't extract as much flavor.
Haven't done the coffee thing, don't know about the caffeine. Seems a reasonable hypothesis to keep them whole to minimize the caffeine if you want to try that.