spring-projects / spring-projects/spring-ai

MCP tool not invoked when using streaming with .content()

Open
#4,207 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status: waiting-for-triage
Dominant language
Java
Stars
9.5k
Forks
2.9k
Avg merge
1d 7h
Merged PRs (30d)
6

Description

When using streaming Q&A with the following code:

public Flux chat_v1(String chatId, String userMessageContent) {
return this.chatClient.prompt()
.user(userMessageContent)
.advisors(
).stream()
.content();
}

the MCP tool is triggered, but it does not actually execute.
Instead, the output looks like this:

<|pos_agent|>

Action : spring_ai_mcp_client_server1_simpleNl2Sql

Action Input : {"input":"查询 用户 人数"} <|eoc|>

The tool is recognized, but no real call is made.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The report provides no repository file or test; start from the chat_v1 entry point and trace the streaming .stream().content() path when the MCP action is emitted. Compare that path with the non-streaming tool-call flow, and verify completion when the MCP tool executes and returns its result instead of only printing the action text.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring
Domain
ai, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.