mirror of
https://github.com/mark3labs/kit.git
synced 2026-06-14 03:30:26 +00:00
7e54710d4a
Load MCP server tools in the background so the UI appears immediately instead of blocking until all servers connect. The first LLM call automatically waits for tools to be ready before proceeding. Key changes: - NewAgent() starts MCP loading in a background goroutine and returns immediately with core/extension tools only - GenerateWithLoop() calls ensureMCPTools() to lazily wait and rebuild the fantasy agent with full tool set before first LLM call - Parallelize LoadTools() across all configured MCP servers - Add WaitForMCPTools() and MCPToolsReady() for status checking - Refactor SetModel/SetExtraTools to use shared rebuildFantasyAgent() - Expose async MCP status methods in public SDK