The high penetration of distributed generation (DG) units with their power-electronic interfaces may lead to various power quality problems, such as excessive harmonic distortions and increased non-sinusoidal power losses. In this paper, the probabilistic hosting capacity (PHC) due to the high penetration of photovoltaic units in a non-sinusoidal power distribution system is investigated. A C-type harmonic filter is proposed, to maximize the harmonic-constrained PHC. An optimization problem is formulated by using a Monte Carlo simulation, taking into account various uncertain parameters, such as the intermittent output power of the DGs, background voltage harmonics, load alteration, and the filter parameters’ variations. In addition, different operational constraints have been considered, such as the bus voltage, line thermal capacity, power factor, and individual and total harmonic distortion limits. A swarm-based, meta-heuristic optimization algorithm known as the hybrid particle swarm optimization and gravitational search algorithm (PSOGSA) has been examined for the optimal design of the proposed filter. Besides, other optimization algorithms were examined for validation of the solution. The PHC results obtained are compared with the conventional deterministic HC (DHC) results, and it is found that the PHC levels are higher than those obtained by conservative HC procedures, practical rules of thumb, and the DHC approaches.