CAMEL-24369: camel-mcp-server-starter: publish MCP tool annotations, fix json-schema-validator resolution - #1881
Merged
davsclaus merged 1 commit intoAug 7, 2026
Conversation
…nd fix json-schema-validator resolution SpringAiMcpServerEngine now maps the ai-tool annotation hints (title, readOnlyHint, destructiveHint, idempotentHint, openWorldHint) to the MCP tool, mirroring the Vert.x engine; unset hints are not published. This required promoting the starter's camel-ai-tool dependency from test to compile scope (the direct test-scope declaration overrode the transitive compile scope from camel-mcp-server-api). Also declare the Jackson3-based com.networknt:json-schema-validator 3.0.0 required by the MCP SDK's mcp-json-jackson3 tool-argument validation: without it, nearest-wins resolution can pick the Jackson2-based 2.0.x line and the application fails at startup with NoSuchMethodError: Schema.validate(tools.jackson.databind.JsonNode). Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
davsclaus
approved these changes
Aug 7, 2026
davsclaus
left a comment
Contributor
There was a problem hiding this comment.
Clean, well-scoped PR that fixes two real bugs in the MCP server starter.
Highlights:
applyAnnotationsis a line-for-line match of the Vert.x engine in camel core — verified againstVertxMcpServerEngine.java. The conformance gap between runtimes is eliminated: unset hints are omitted (not defaulted),titlemaps to the tool's top-level title- Scope fix for
camel-ai-toolis correct:camel-mcp-server-apialready declares it at compile scope, so the starter's explicit<scope>test</scope>was winning by nearest-declaration and hidingAiToolAnnotationsfrom the compile classpath json-schema-validator3.0.0 pin is pragmatic — the MCP SDK'smcp-json-jackson3needs the Jackson3-based 3.x line, while Camel manages 2.0.x for other components. The comment explains the problem clearly- Tests are well-targeted: one verifying hints are published for an annotated tool, one verifying that a hint-less tool has null annotations — conformance assertions against the MCP client view
This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
JIRA: CAMEL-24369 — companion PRs: apache/camel#25404 and one in apache/camel-quarkus.
Two fixes found by running the same ai-tool + mcp-server application on Camel Main, Spring Boot and Quarkus:
MCP tool annotation hints were dropped.
SpringAiMcpServerEngine.toolAdded()published only name/description/inputSchema;title,readOnlyHint,destructiveHint,idempotentHint,openWorldHint— which the Vert.x engine publishes and the ai-tool/mcp-server docs promise are passed to the engine — were silently lost. The engine now maps them exactly like the Vert.x engine (unset hints are not published). This required promoting the starter'scamel-ai-tooldependency from test to compile scope: the direct test-scope declaration overrode the transitive compile scope fromcamel-mcp-server-api.Startup failure with the documented BOM setup (
camel-spring-boot-bom+spring-boot-dependencies): the Spring AI MCP server validates tool arguments throughmcp-json-jackson3, which requires the Jackson3-basedcom.networknt:json-schema-validator:3.0.x; nearest-wins resolution picked a 2.0.x (Jackson2 API) instead, failing withNoSuchMethodError: Schema.validate(tools.jackson.databind.JsonNode). The starter now declares 3.0.0 directly so applications resolve it out of the box.Two new conformance tests cover the annotations (published hints + no annotations for hint-less tools); the full starter suite passes (13 tests).
Claude Code on behalf of Croway (Federico Mariani)
🤖 Generated with Claude Code