spring-ai
spring-ai copied to clipboard
Problems with DefaultTools overloading, and SyncMcpToolCallbackProvider cannot be injected automatically
trafficstars
Env:
When I configure the MCP client side using the Auto configuration, only List < McpClients > can find the bean and inject it; but SyncMcpToolCallbackProvider shows that the bean class is not found, unlike a reference archive (although ToolCallBackProvider types of beans can be injected).
In addition, if I use mcpclient's listTools () directly, the overload of .defaultTools() will also choose the parameter Object, causing the tool to fail. The solution is that .defaultTools ()/.tools () must pass parameters of the form ToolCallback