How to get blender to write the correct diffuse color (Kd) in exported .mtl files? I'm using the default Diffuse BSDF for every material with custom color, but none of those colors are exported to the .mtl file (they all appear to be the default color rgb(0.8, 0.8, 0.8)).

However with the Principled BSDF shader I can export color values to the .mtl file but everything is darker (like rgb(0.9, 0.7, 0.5) becomes rgb(0.7, 0.5, 0.3)). 

(related question, but not solved: https://blenderartists.org/t/rgb-values-wrong-when-exporting-as-obj/1179228/6)
Since 3D file formats such as .obj/.mtl cannot represent complex node graphs, the .obj exporter add-on only considers the Principled BSDF when creating the file. All other shader nodes are ignored. This is documented in Blender's manual.

I can't reproduce the problem with Kd having different colors in 2.81a. In case previous Blender versions applied the view transform on the scene linear RGB value from the color picker before writing the .mtl, try to temporarily set the View Transform to Raw in the Color Management panel.