Repository navigation
CAMEL-26360: camel-mcp-server-starter - apply transport customizers, refuse features the server cannot serve, fix the docs - #2129
Conversation
… the OAuth audience and the property descriptions in the docs
…rs and keep Spring AI's transport for an ASYNC server
… server cannot serve instead of failing or evicting application entries
|
The red The quick docs build looks up manual pages in https://camel.apache.org/site-manifest.json. That file was last updated on 22 Nov, so it doesn't list the new page yet, and #2126 failed with the same four errors. A re-run should pass once camel.apache.org is republished. Claude Code on behalf of Federico Mariani |
|
Yeah just fixed the website build |
|
a new build is running now |
davsclaus
left a comment
There was a problem hiding this comment.
TL;DR
Approve: application transport customizers are now applied to Camel's Streamable and stateless transports, an ASYNC server keeps Spring AI's transport and logs a warning, features of a missing capability are refused instead of failing startup, and MODERN removes only the route's own resource or template. The docs are fixed too.
Blockers: None
Other findings: 1 suggestion (inline).
What I checked
- Customizers: Spring AI 2.1.0's
McpServerStreamableHttpWebMvcAutoConfigurationandMcpServerStatelessWebMvcAutoConfigurationtake the sameObjectProvider<McpServerCustomizer<...Builder>>and apply it last, so Camel's beans now behave like Spring AI's. An application customizer can replace Camel's Origin validator. That is the application's own choice, andusage.adocdocuments it. - MODERN removal: in
InMemorySyncResourceRepository(spring-ai-mcp 2.1.0),findchecks the exact resource map before any template,findTemplateis an exact key lookup, andremoveclears both maps. So the identity checks againstregistration.handler()andregistration.template()are sound, andhasResourcehandles a template's handler matching its own literal URI template. Dropping theresources != nullguard is safe, because the tracking maps stay empty when there is no repository. - Schema check:
JsonSchemaValidator.assertConforms(mcp-core 2.2.0) returns early on a null schema and throwsIllegalArgumentException, whichtoolAddedalready turns intoMcpServerRefusedException. A tool without an output schema is not affected. - ASYNC: every nested branch of
OnSpringAiMcpServerConditionandCamelMcpServerTransportConditionnow uses the same SYNC rule (matchIfMissing, case-insensitive). The warning's stdio check matchesMcpServerStdioDisabledCondition. - Tests: no
Thread.sleepor fixed ports (server.port=0; the:8080strings are only Origin header values). Thecheck-docfailure comes from the Camel website xref, not from this PR.
This review does not replace specialized review tools or static analysis.
Claude Code on behalf of davsclaus
This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying.
…ring AI version only in the snippet
|
new website published |
Summary
Follow-up to the MCP parity review for CAMEL-26360, done while reviewing the Quarkus engine (apache/camel-quarkus#9509). It covers the defects found in
camel-mcp-server-starter(Spring AI 2.1 / MCP SDK 2.2). All the code involved is unreleased (4.24.0).camel.mcp-server.tagswas set, Camel's Streamable and stateless transports ignored the application'sMcpServerCustomizer<...Builder>beans: its own security validator, context extractor,maxSessions,sessionIdleTimeout. Reproduced: without tags,customizer calls=1 maxSessions=7; with tags,calls=0 maxSessions=100000. They are now applied after Camel's settings, the same order as MODERN, so an application customizer can still override Camel's Origin check or caller extractor.spring.ai.mcp.server.type=ASYNC, the bridge backed off without any log while Camel still replaced the transport. Now the tags-driven transport default and every bridge branch require a SYNC server, and a WARN is logged when tags are set with ASYNC. An explicitcamel.mcp-server.transport-enabled=truestill installs Camel's transport, so its Origin check is kept.spring.ai.mcp.server.capabilities.tool=false, a single taggedai-toolroute failed application startup on SSE, STREAMABLE and STATELESS. Tools, resources, templates and prompts of a missing capability are now refused withMcpServerRefusedException, which names the property; the route keeps running and the other features are served.ai-resourceroute deleted an application resource template with the same key, becauseInMemorySyncResourceRepository.remove(key)removes both kinds. A resource with a template's key, or a template with a resource's URI, is now refused, and removal only removes the route's own registration.spring-ai-starter-mcp-server2.0.0, and startup failed withTypeNotPresentException: io.modelcontextprotocol.modern.server.feature.McpSyncToolRepository. It now uses 2.1.0, and I checked it end to end over stdio.issuer-uri, so tokens issued for another API by the same issuer were accepted. It now setsspring.security.oauth2.resourceserver.jwt.audiences. It also explains that thesecurityMatcherscope covers only the MCP paths, so the application's own chain must be ordered after it.{@code}, the protocols each option applies to, and timeout defaults now shown. The metadata and the docs page are regenerated.Tests
CamelMcpServerTransportCustomizerTest,CamelMcpServerAsyncTypeTest,SpringAiModernMcpServerEngineTest,SpringBootMcpServerToolCapabilityDisabledTest(SSE, STREAMABLE, STATELESS, MODERN) andMcpServerConfigurationPropertiesTest. More cases inSpringAiMcpServerEngineTest.camel-mcp-server-starter: 106 tests, 0 failures.Not in this PR
camel.mcp-server.enabled=offstill enables the starter. That is how@ConditionalOnPropertytreats a value other thanfalse, and changing it would breakenabled=on.Claude Code on behalf of Federico Mariani