Harvey, 27, has appeared in four games this season, pitching 2⅔ scoreless innings. The right-hander was claimed off waivers from San Francisco on March 22.
Ramírez, who turns 32 on May 2, is 33-40 with a 4.37 ERA in 216 career major league games. He pitched seven scoreless innings over five appearances for Rochester.
To make room on the 40-man roster, the Nationals transferred infielder/outfielder Ehire Adrianza (left calf strain) to the 60-day injured list.