A I would strongly advise a trip to the vet. In all probability it is a minor problem but claw infections can turn nasty if not treated early.
You don’t say in your letter whether your cat has been neutered. If he isn’t, my first thought would be a damaged claw from fighting.
Neutering reduces fighting by 80 per cent but cats still get into scraps. Claw injuries quickly become infected with bacteria at the nail bed, a condition called paronychia.
Left untreated the infection can extend to the underlying joint and become a bigger problem.
Paronychia can also be caused by a common yeast infection called Malassezia, where a blackish discharge can be found at the nail base.
There are two much rarer causes of paronychia: fungal infection and the autoimmune disease pemphigus.
With the latter the discharge is usually cheese-like and cream in colour. I would be careful about inspecting the paw.
Nail damage and infection is invariably painful and you may get bitten. Most paw infections respond to a course of antibiotics and foot soaks, especially when caught early