Here, a viologen-functionalized metal-organic framework (MOF), MIL-125-RV2+, was obtained by modification of MIL-125-NH2 with viologen molecules. MIL-125-RV2+, the first viologen-based MOF for photocatalytic CO2RR, exhibited excellent photocatalytic activity and high selectivity for HCOO-. The strategy of using photo-responsive color-changing organics to functionalize the MOF is significant for achieving efficient CO2RR.