Await session.call_tool(tool_name, arguments=tool_args) not working in the process query

Hi All,

I inspired myself from the MCP client code to build a streamlit chatbothat would connect to the following mcp servers.

  • SQLITE
  • BRAVE SEARCH
  • FILE SYSTEM

Everything seems to work but whenever I write a prompt int he chatbot e.g how many tables do we have in our database I hangs and run forever. when I checked in the terminal I can see it calls the tools without parameters and when I debug I found out it is stuck at result = await session.call_tool(tool_name, arguments=tool_args) , I haven’t been able to find the solution till now and would be grateful for any help. Attached is the app.py(where the streamlit application is implemented) and the mcp_service.py where the (ChatbotClass is implemented) to test it you need to have a brave_search api key and the sqlite DB is available in my repo under the data folder.

here is the my GitHub repo if want a global view :
mcp_service.py (4.7 KB)
app.py (2.4 KB)

https://github.com/Sulmon/mcp_analyst_app/tree/main

here is how the app looks in the browser and it is stuck “Thinking..” for hours

And this is how it looks in the terminal (also stuck at calling tool ‘list_tables with args:{}’)

where I identified the problem to be (line code 103 , red dot)