I think the wording here conjures up images of:
a tongue in a mouth.
I am but a linguist that lives in a cave.
The 'linguist' is the tongue, which is particularly appropriate given that a linguist is an individual who studies language (a key role of the tongue, and also a synonym of 'tongue'). The 'cave' is the mouth.
I talk with visitors from the central city.
The tongue enables a person to talk upon receiving signals ('visitors') from the brain ('the central city').
When the dragon comes, I invite him inside.
The lions stay out, but gain trust and enter.
Merchants and messengers come in to rest.
These lines appear to concern things that might be put into the mouth in some capacity - possibly:
- 'The dragon' is a toothbrush - a large object for which the tongue must move aside ('invite him inside') when brushing one's teeth.
- 'The lions' may well be other slightly smaller items like fingers, allowed inside (to bite nails, suck a thumb, etc.) after a quick check to be sure they are clean (i.e. they need to 'gain trust').
- The 'merchants and messengers' are food, drink, medicines, etc. - things that have something to pass on (nutrients, water, medication, etc.) to the body like how a merchant passes on wares or a messenger their message. Once they come into the mouth they usually proceed on to the stomach and stay ('rest') inside the body to be processed and digested.
Politicians peer outside, but remain indoors.
These 'politicians' are the teeth, sitting in ordered rows surrounding the tongue, like MPs in a Parliament or senators in a Senate. They don't usually leave the mouth (they 'remain indoors').