The production of $$J/\psi $$ J/ψ mesons in p+p and p+Pb collisions is studied in the framework of color-glass condensate together with a simple color evaporation model. Considering the nuclear effects with the Glauber–Gribov approach, we calculate the cross section and the nuclear modification factor of forward $$J/\psi $$ J/ψ production in p+Pb collisions at $$\sqrt{s}=5.02$$ s=5.02 TeV. Then, the backward $$J/\psi $$ J/ψ production in p+Pb collisions at $$\sqrt{s}=8.16$$ s=8.16 TeV is also analyzed. In our calculation, the phenomenology KLR-AdS/CFT model and the rcBK approach, which are valid at a small x, are used to calculate the three-point function. It is shown that the theoretical results fit well with the experimental data from ALICE and LHCb.