Claus Ibsen created CAMEL-25076:
-----------------------------------
Summary: camel-mcp-server - stdio: adding a tool fails when stdin
is closed, which breaks StdioMcpServerEngineTest
Key: CAMEL-25076
URL: https://issues.apache.org/jira/browse/CAMEL-25076
Project: Camel
Issue Type: Bug
Components: camel-mcp-server
Reporter: Claus Ibsen
With the stdio transport (StdioMcpServerEngine), adding an ai-tool route fails
once stdin has been closed (the client went away): McpSyncServer.addTool
registers the tool and then notifies the client that the tool list changed, and
that notification fails with RuntimeException: Failed to enqueue message, as
the SDK closes the outbound side of the session when stdin ends. The exception
fails CamelContext startup or the added route.
StdioMcpServerEngineTest uses an empty stdin, so it races with this and now
fails consistently (it breaks CI of PRs that build camel-mcp-server).
Fix: the tool is registered either way, so a failed notification is logged as a
WARN instead of failing the route. Invalid tools
(IllegalArgumentException/IllegalStateException) still fail.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)