It is a very cool Idea,
I have converted your javascript to Python,
It is a simple Loop + LiteLLM + MCP
https://github.com/askbudi/tinyagent
I thought it would be cool if anyone could personalize their own Tinyagent based on what they need, for example adding memory layer, or storage in PG.
And here it is possible to chat with this repo and add functionality you need for your specific project