It’s possible, but pretty tricky, to do exactly what you’re describing. You’ll need to do some date math using d3-time to compute the middle of the months, intersected with the domain of your data. I’ve compiled a few techniques that might be relevant for you here:
An easier place to start might be to just label the start of the months with a separate axis or a multi-line tick format.