The second one. 
With this layout you are protecting the microcontroller from damage, and also protecting the input signal from shorting to ground via the TVS when it is clamping a transient.