In the latest snapshot version 1.1.0, the model is unable to send MCP tool call requests
Bug description In the latest snapshot version 1.1.0, the model is unable to send MCP tool call requests。
Environment system:windows version:1.0.0-snapshot jdk:17 framework:Ollama model:llama3.2
Steps to reproduce The official version 1.0.0 can initiate tool calls proactively through the model. However, after switching to version 1.1.0, the model was unable to send requests for tool calls. But I can see the client connection information in the MCP Server logs Based on the response from the model, it seems that the model did not find any tools. Is it a problem with tool configuration?
MCP Server log: 2025-06-11T14:09:29.841+08:00 INFO 26156 --- [mcp-server] [nio-1631-exec-4] i.m.server.McpAsyncServer : Client initialize request - Protocol: 2024-11-05, Capabilities: ClientCapabilities[experimental=null, roots=null, sampling=null], Info: Implementation[name=mcp-client - server1, version=1.0.0]
so the connection is no problem
Correction: The model seems to be able to discover a list of tools, but it will never actually call them
Maybe you need to provide more details or demo for people to locate the problem more easily.I have a demo:MCP client and a demo MCP server which uses the latest 1.1.0-SNAPSHOT version of Spring AI, and in this demo the model calls the tool fine.
也许您需要提供更多详细信息或演示,以便人们更容易地找到问题。我有一个 demo:MCP 客户端和一个使用最新版本的 Spring AI 的演示 MCP 服务器,在这个演示中,模型很好地调用了该工具。
1.1.0-SNAPSHOT
//This is my construction method and the method for calling the model response //This method works fine in version 1.0.0
public AiController(ChatClient.Builder chatClient, List
.content();
return response;
}
I tried to reuse your code as much as I could but still didn't reproduce your problem, this is my code:
...
ChatClient.builder(chatModel).build()
.prompt()
.system("You are a helpful assistant")
.user(" What time is it now?")
.toolCallbacks(new AsyncMcpToolCallbackProvider(mcpClients))
.stream()
.content()
.doOnNext(System.out::print)
.blockLast();
...
this is the model response:
<think>
Okay, the user is asking, "What time is it now?" I need to figure out how to respond. Let me check the tools available. There's a function called spring_ai_mcp_client_server1_getCurrentDateTime that gets the current date and time in the user's timezone. Since the user hasn't specified a timezone, but the function is supposed to handle the user's timezone, I should call that function. The parameters required are none, so I just need to trigger the function. Let me make sure I'm using the correct syntax. The function name is exactly as given, and no arguments are needed. So I'll generate the tool call with that function.
</think>
<think>
Okay, the user asked, "What time is it now?" I used the function spring_ai_mcp_client_server1_getCurrentDateTime to get the current date and time in their timezone. The response from the tool was "2025-06-11T16:07:38.373957+08:.0[Asia/Shanghai]". Let me parse that.
First, the date is June 11, 2025. The time is 16:07:38, which is 4:07 PM in 24-hour time. The timezone is Asia/Shanghai, which is UTC+8. So the current time in Shanghai is 4:07 PM on June 11. I should present this information clearly. The user might be planning something and needs the current time for reference. Maybe they're in Shanghai or need to know the time for an event there. I'll state the date and time, and mention the timezone to confirm it's correct. Let me check if the date and time format is correct. Yes, ISO 8601 format is standard. Alright, I'll reply with the time in a friendly manner.
</think>
The current date and time in your timezone (Asia/Shanghai) is **June 11, 2025 at 4:07:38 PM**. Let me know if you need further assistance!
My Spring AI version is 1.1.0-SNAPSHOT and I'm using the qwen3:4b model through Ollama.
我尝试尽可能多地重用您的代码,但仍然没有重现您的问题,这是我的代码:
... ChatClient.builder(chatModel).build() .prompt() .system("You are a helpful assistant") .user(" What time is it now?") .toolCallbacks(new AsyncMcpToolCallbackProvider(mcpClients)) .stream() .content() .doOnNext(System.out::print) .blockLast(); ...这是模型的响应:
<think> Okay, the user is asking, "What time is it now?" I need to figure out how to respond. Let me check the tools available. There's a function called spring_ai_mcp_client_server1_getCurrentDateTime that gets the current date and time in the user's timezone. Since the user hasn't specified a timezone, but the function is supposed to handle the user's timezone, I should call that function. The parameters required are none, so I just need to trigger the function. Let me make sure I'm using the correct syntax. The function name is exactly as given, and no arguments are needed. So I'll generate the tool call with that function. </think> <think> Okay, the user asked, "What time is it now?" I used the function spring_ai_mcp_client_server1_getCurrentDateTime to get the current date and time in their timezone. The response from the tool was "2025-06-11T16:07:38.373957+08:.0[Asia/Shanghai]". Let me parse that. First, the date is June 11, 2025. The time is 16:07:38, which is 4:07 PM in 24-hour time. The timezone is Asia/Shanghai, which is UTC+8. So the current time in Shanghai is 4:07 PM on June 11. I should present this information clearly. The user might be planning something and needs the current time for reference. Maybe they're in Shanghai or need to know the time for an event there. I'll state the date and time, and mention the timezone to confirm it's correct. Let me check if the date and time format is correct. Yes, ISO 8601 format is standard. Alright, I'll reply with the time in a friendly manner. </think> The current date and time in your timezone (Asia/Shanghai) is **June 11, 2025 at 4:07:38 PM**. Let me know if you need further assistance!我的 Spring AI 版本是 1.1.0-SNAPSHOT,我通过 Ollama 使用该模型。
qwen3:4b
Hello, after my attempts to modify it, I found that reducing the MCP Server version from 1.1.0-SNAPSHOT to 1.0.0 allows the tool to be called normally. This should be a compatibility issue with the version that MCP Server depends on
I found that reducing the MCP Server version from 1.1.0-SNAPSHOT to 1.0.0 allows the tool to be called normally. This should be a compatibility issue with the version that MCP Server depends on
This is so strange, because in my tests both MCP server and client use version 1.1.0-SNAPSHOT, I'm very interested in this issue, and it would be great if you could provide a minimal sample project that could reproduce the issue!
I found that reducing the MCP Server version from 1.1.0-SNAPSHOT to 1.0.0 allows the tool to be called normally. This should be a compatibility issue with the version that MCP Server depends on
This is so strange, because in my tests both MCP server and client use version 1.1.0-SNAPSHOT, I'm very interested in this issue, and it would be great if you could provide a minimal sample project that could reproduce the issue! OK,I will present some content of my MCP Server。 //here my toolcallbackmethod //The rest of the project is just definitions of some tools @Bean public ToolCallbackProvider getToolCallbacks( ToolsService toolsService, WebSearchTool webSearchTool, WeatherTool weatherTool, LocationTool locationTool, SystemTool systemTool){ return MethodToolCallbackProvider.builder().toolObjects(toolsService,weatherTool,locationTool,systemTool).build(); }
//this is part of my pom of MCP Server
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.ai</groupId>
<artifactId>spring-ai-bom</artifactId>
<version>${spring-ai.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
...
</dependencies>
</dependencyManagement>
我发现将 MCP Server 版本从 1.1.0-SNAPSHOT 降低到 1.0.0 可以正常调用该工具。这应该是与 MCP Server 所依赖的版本的兼容性问题
这太奇怪了,因为在我的测试中,MCP 服务器和客户端都使用 1.1.0-SNAPSHOT 版本,我对这个问题非常感兴趣,如果您能提供一个可以重现该问题的最小示例项目,那就太好了!
if you want,you can pull my project: https://github.com/fanxt0218/Local_Helper it's a poor project,please don't laught at me ☹
I tried to pull your project and then modified the Spring AI version on the MCP Server side to 1.1.0-SNAPSHOT and ran it, but everything works fine on my machine, I enabled the MCP button on the web page and then tried to use the weather, time tool, all work fine.
I just made the following changes:
- changed the database configuration to my native configuration
- changed the Spring AI version on the MCP Server side to 1.1.0-SNAPSHOT
- used the qwen2.5:14b model
I tried to pull your project and then modified the Spring AI version on the MCP Server side to 1.1.0-SNAPSHOT and ran it, but everything works fine on my machine, I enabled the MCP button on the web page and then tried to use the weather, time tool, all work fine.
I just made the following changes:
- changed the database configuration to my native configuration
- changed the Spring AI version on the MCP Server side to 1.1.0-SNAPSHOT
- used the qwen2.5:14b model
This is too strange, now I can use it normally even if I switch back to the snapshot version. That's amazing
the issue has been solved