CAMEL-24331: camel-mcp-server-starter - Spring AI engine for the MCP server bridge - #1871
Draft
Croway wants to merge 2 commits into
Draft
CAMEL-24331: camel-mcp-server-starter - Spring AI engine for the MCP server bridge#1871Croway wants to merge 2 commits into
Croway wants to merge 2 commits into
Conversation
…server bridge Expose ai-tool routes as MCP tools on Spring Boot through the Spring AI 2.x MCP server (CAMEL-24308): - Depends on camel-mcp-server-api (bridge + SPI) and spring-ai-starter-mcp-server-webmvc - NOT the camel-mcp-server Vert.x engine; Spring AI 2.0.0 pins the same MCP Java SDK (2.0.0) as camel. - SpringAiMcpServerEngine maps toolAdded/toolRemoved onto the auto-configured McpSyncServer (list_changed emitted by the SDK). - CamelMcpServerAutoConfiguration with camel.mcp-server.* properties (enabled default true, tags opt-in, tool-timeout 20s); serving concerns are owned by spring.ai.mcp.server.* per the CAMEL-24311 precedence rule; backs off without an McpSyncServer bean. - Tests: auto-configuration conditions + the engine conformance scenarios over WebMVC streamable HTTP with the official MCP SDK client (tag filtering, call success, sanitized errors, timeout, tools list following route stop/start). Requires the camel-mcp-server-api artifact from apache/camel PR #25306. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…coexistence - Usage docs: YAML DSL tool example with parameter types/enum/required, MCP client configuration examples (camel-openai agent + mcp.json), dynamic tools, error handling semantics, and a link to the Spring AI MCP server documentation for the spring.ai.mcp.server.* options. - Prove Spring-defined tools (@mcptool annotation) coexist with Camel ai-tool routes on the same MCP server; compile with -parameters so the annotation scanner derives proper input schemas in tests (Spring Boot applications inherit this from the boot parent). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
CAMEL-24331: camel-mcp-server-starter — Spring AI engine for the MCP server bridge
JIRA: CAMEL-24331, the Spring Boot runtime of CAMEL-24308 (camel-mcp-server).
What this adds
A hand-crafted
camel-mcp-server-starterexposingai-toolroutes as MCP tools on Spring Boot, served through the Spring AI 2.x MCP server (spring-ai-starter-mcp-server-webmvc,spring.ai.mcp.server.protocol=STREAMABLE):camel-mcp-server-api(the runtime-agnostic bridge +McpServerEngineSPI) — deliberately notcamel-mcp-server, which is the Vert.x engine for Camel Main/JBang. Spring AI 2.0.0 pins the same MCP Java SDK (2.0.0) that camel manages, so no version skew.SpringAiMcpServerEngine:toolAdded/toolRemovedmap onto the auto-configuredMcpSyncServerbean'saddTool/removeTool;tools/list_changedis emitted by the SDK.consumesServingConfiguration()stays false — serving (path, protocol, identity, auth) is owned byspring.ai.mcp.server.*, per the precedence rule recorded on CAMEL-24311.CamelMcpServerAutoConfiguration(camel.mcp-server.*):enabled(default true — adding the starter is the opt-in),tags(unset ⇒ nothing exposed, preserving the security default),tool-timeout(20s). Backs off cleanly without anMcpSyncServerbean and honors@ConditionalOnMissingBeanoverrides. The bridge lifecycle is owned by Camel (camelContext.addService).spring-ai-mcp-version) — the inherited${spring-ai-version}is 1.1.7 and the MCP server support needs 2.x (Spring Boot 4.1 baseline, matching this repo).mcp.json-style), dynamic tools, error-handling semantics, and a link to the Spring AI MCP server documentation for thespring.ai.mcp.server.*options.@McpTool-annotated beans (Spring AI annotation scanner) and Camelai-toolroutes serve from the same MCP server — proven by test. Tests compile with-parametersso the scanner derives proper input schemas (Spring Boot apps inherit this from the boot parent).Known limitation
No springboot-catalog
others/entry is generated: the tooling derives the wrapped artifact from the starter name (camel-mcp-server), which is intentionally not a dependency here. Can be added if the tooling learns an override, or accepted as-is like other API-only modules.Testing
CamelMcpServerAutoConfigurationTest— auto-config conditions (default on,enabled=false, back-off withoutMcpSyncServer).SpringBootMcpServerTest— the CAMEL-24313 engine conformance scenarios over WebMVC streamable HTTP with the official MCP SDK client: tag-filtered tools/list (untagged pool excluded), call success, missing required argument, execution error sanitized to a generic message, timeout, tools list following route stop/start. (The camel-mcp-server-api conformance kit manages its own CamelContext and cannot boot inside Spring Boot — the scenarios are mirrored 1:1 instead; noted on CAMEL-24313.)All 10 tests green.
This PR was written by Claude Code on behalf of Federico Mariani (@Croway).
🤖 Generated with Claude Code