As far as I know there's no built-in way of achieving your goal. As long as MkDocs allows you to use Markdown extensions, you could use one of these in order to number your figures. But alas, there's also no plugin for figure numbering that I'm aware of.
One possibility to at least number your images would be to extend yafg (a Markdown extension allowing you to automatically create <figure>
and <figcaption>
tags) to support figure numbering. I'm the author of it and would gladly provide that feature if needed. Just let me know.
Still, this wouldn't fulfill your need for code listing numbering. Alas, I cannot provide any help in this regard.
I know that this is rather a comment than a full-fledged answer but since I don't have enough reputation, I'm not allowed to comment. Thus, please excuse the brevity of the answer.