In Calibre You can select several books at once, and hit convert. It is an old feature, described on the official blog:
Bulk convert: Calibre allows you to convert books in bulk. You can
select a set of books, all of which may or may not be in the same
format, and convert them all in bulk to a different format. So say you
have a kindle and you have ...
You could also use Pandoc in conjunction with the kindlegen command-line tool.
Converting your HTML files to Markdown files is not necessary but if done will allow (easier) conversion to other formats should the need arise later on.
The table of contents can be automatically generated using Pandoc. Pandoc can export to the epub format which in turn can be ...
There are many ways to skin a cat. Calibre is one such way, but not the only way.
is there any software available to directly write in mobi format?
Some things to thing about:
Would it not be easier to produce an epub file and convert it to mobi using Kindle Previewer?
Sigil is other software for creating epub -- which might let you export to mobi or ...