Harmonics have been considered as one of the major issues in future power grids. With the increasing demand in advanced control functions, power electronic converter interfaced distributed generators (DGs) are expected to perform harmonic compensation when necessary. It has been demonstrated in a number of studies that DG converters operating in voltage-controlled mode can be easily configured to realize voltage harmonic compensation utilizing naturally embedded voltage control loop. While for DGs operating in current-controlled mode (CCM), such function was rarely studied. Considering that CCM is commonly used in renewable energy based generators and energy storage systems, it has certain significance to achieve the same function with CCM converters. Aiming at such objectives, this paper proposes a voltage detection based harmonic compensator (HC) for CCM converters. The novelty and main advantages of the proposed method include the following. It realizes seamless interface of HC with inner fundamental current control loop. Compared with a conventional active power filtering method, it does not require remote load harmonic current measurement since it is local voltage detection based. Compared with a conventional voltage detection based method, it offers better performance because of directly harmonic voltage regulation. Experimental results are presented to demonstrate the effectiveness of the method.