What about the scnerio when 9V is not connected. I need a low at MCU pin. Shouldnt I be using a 100nF cap at output so that it is low when no load in connected.
A capacitor may smooth spike-y behavior somewhat, but that is not an essential role in what you're doing.
If you wish, you can install a 'bleeder' resistor, which will instantly pull the input wire to 0V when no voltage is applied. The bleeder resistance can be several k-ohms.
When no load is connected, the led's get 22mA. That is too much unless you increase the input resistor.
You need to decide regarding which pieces of equipment are to be detachable from your circuit.