The studies around joint pain and coffee are contradictory, with some indicating that coffee can increase the risk of developing arthritis, while others note that coffee seems to reduce the risk of gout (a painful form of arthritis that involves uric acid crystals in the joints). However, coffee definitely contains inflammation-fighting polyphenols.
If you already drink coffee, there is no reason to stop. Your morning brew may be helping to reduce your knee and joint pain. Just keep your consumption to 4 or fewer cups per day, as most studies find no ill-effects on joints before that level.