Inhibiting electron-hole recombination and improving the utilization efficiency of photogenerated carriers perform a central role in photocatalysis. Herein, a “ship-in-a-bottle” strategy and an impregnation method were employed to incorporate highly active Co(II,III)-modified carbon dots (Co-CDs) inside or supported on a representative metal–organic framework (i.e., NH2-MIL-125), denoted as Co-CDs-N-MIL and Co-CDs/N-MIL, respectively, for photocatalytic removal of NO and H2 production. Compared with pure NH2-MIL-125, the photocatalytic activities of both Co-CDs-N-MIL and Co-CDs/N-MIL were significantly enhanced but distinctly different, suggesting that the photocatalytic efficiency closely correlates with the Co-CDs location relative to the NH2-MIL-125. A series of characterizations confirmed that Co-CDs-N-MIL shortens the electron transport distance to some extent, which is conducive to the suppression of electron-hole complexation, and thus has a better efficiency than Co-CDs/N-MIL.