Using the material node compositor, I need to translate the x and y of the uvs of a mesh (assuming they are ranged from 0 to 1), to the red and green color value of a material.
In principle, just plugging the "UV" outlet of the "Texture Coordinate" node into the "Color" property of your shader should work. This is because, by chance, your choice of colors (red, green) matches the R, G, B order.
A more elegant and controllable way is in the node setup below. The three nodes in the middle are MixRGB nodes, using the "Mix" and "Add" blend modes. Note: the Fac: value for "Add" must be 1.0.
You may want to swap red ↔ black and green ↔ black, as currently higher X/Y values give lower red/green intensities.