Federico Mariani created CAMEL-24369:
----------------------------------------
Summary: camel-ai-tool/camel-mcp-server: cross-runtime fixes
(dependency alignment, engine parity, self-referential MCP client)
Key: CAMEL-24369
URL: https://issues.apache.org/jira/browse/CAMEL-24369
Project: Camel
Issue Type: Bug
Components: camel-openai
Reporter: Federico Mariani
Testing the new ai-tool + mcp-server components (4.22.0-SNAPSHOT) with the same
application on Camel Main, Spring Boot and Quarkus surfaced five issues:
1. *Camel Main fails to start* with {{camel-bom}}: the MCP Java SDK pins
{{jackson-annotations:2.20}} which wins over the 2.22 needed by
{{jackson-databind:2.22.1}} -> {{NoClassDefFoundError: JsonSerializeAs}} in
{{VertxMcpServerEngine.doStart}}. Fix: direct aligned {{jackson-annotations}}
dependency in {{camel-mcp-server}}.
2. *Spring Boot fails to start* with the documented BOM setup: MCP
tool-argument validation ({{mcp-json-jackson3}}) requires the Jackson3-based
{{com.networknt:json-schema-validator:3.0.x}}, resolution picks 2.0.x ->
{{NoSuchMethodError: Schema.validate(tools.jackson.databind.JsonNode)}}. Fix:
direct dependency in {{camel-mcp-server-starter}} (plus {{camel-ai-tool}}
test->compile scope).
3. *MCP tool annotations dropped on Spring Boot and Quarkus*: {{title}},
{{readOnlyHint}}, {{destructiveHint}}, {{idempotentHint}}, {{openWorldHint}}
are published by the Vert.x engine but silently lost by
{{SpringAiMcpServerEngine}} and {{QuarkusMcpServerEngine}}, contradicting the
ai-tool/mcp-server docs.
4. *Quarkus advertises an empty inputSchema for argSchema tools* (and drops
{{enum}} constraints of flat parameters): the engine rebuilds the schema from
flat {{addArgument}} calls instead of publishing the bridge's
{{inputSchemaJson()}}. Fix: {{ToolDefinition.setInputSchema}}.
5. *Self-referential MCP client fails startup on Quarkus*:
{{openai:chat-completion?mcpServer.x.url=<own /mcp>}} initializes its MCP
client eagerly during route warm-up; on Quarkus the HTTP server only accepts
connections after startup -> route fails, taking the app down (Main works;
Spring Boot degrades to 0 tools and self-heals via {{mcpToolRefresh}}). Fix in
{{camel-openai}}: a server unreachable at endpoint start is logged as WARN and
its initialization is deferred and retried on first use, reusing the reconnect
path. Invalid configuration still fails fast. This aligns all runtimes and
matches the server-side behavior of annotated tools (quarkiverse {{@Tool}} /
Spring AI {{@McpTool}}), which register in-process and cannot hit this ordering
problem.
All five verified with an identical order-desk application on the three
runtimes (27/27 MCP conformance scenario checks each after the fixes). PRs
follow for apache/camel, apache/camel-spring-boot and apache/camel-quarkus.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)