Lazy MCP servers loading
J
John
Currently, BoltAI keeps all configured MCP servers running, even when they're not in use. This approach results in numerous active processes and connections, which works well for a few servers but creates excessive load with dozens of servers. A more convenient solution is to load servers on demand.
The proposed solution is:
- Run a server for the first time, cache all the available tools, and then shut it down.
- If a user requests a specific server, we need to run it on demand, but with a time-to-live (TTL) of around 3-5 minutes. If the server hasn't been used for the TTL time, we need to shut it down.