Skip to content

CAMEL-27174: camel-mcp-server-starter - serve the Camel routes on the Spring AI server for MCP protocol version 2026-07-28 - #2117

Open
Croway wants to merge 1 commit into
apache:mainfrom
Croway:CAMEL-27174-mcp-modern
Open

Croway wants to merge 1 commit into
apache:mainfrom
Croway:CAMEL-27174-mcp-modern

Conversation

@Croway

@Croway Croway commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

CAMEL-27174

Needs a Camel snapshot with apache/camel#30444 (Spring AI 2.1.0). The modern server API exists only in Spring AI 2.1, so until that snapshot is deployed this build still resolves Spring AI 2.0.2 from the Camel parent and does not compile.

Description

With spring.ai.mcp.server.protocol=MODERN (Spring AI 2.1), Spring AI auto-configures the MCP Java SDK server for protocol version 2026-07-28 instead of an McpSyncServer, so the starter registered nothing: the Camel ai-tool, ai-resource and ai-prompt routes were not served.

  • SpringAiModernMcpServerEngine adds the Camel routes to the in-memory tool, resource and prompt repositories that Spring AI auto-configures, next to the application's own entries. Those repositories tell the clients that listen with subscriptions/listen when a list changes. A route with the name or URI of an entry already served is refused, and resource templates are checked for overlaps, as with the other protocols.
  • CamelMcpServerAutoConfiguration also activates on that server (SYNC type only), and warns when the application defines its own repository, which Camel cannot add to.
  • CamelMcpServerModernTransportAutoConfiguration provides Camel's Origin validation and caller-identity extraction to Spring AI's WebMvcModernServerTransport as beans; those of the application take precedence.
  • Docs: "MCP protocol version 2026-07-28" in the starter usage page. Spring AI serves one protocol per application: with MODERN, clients that open with initialize are not served, unlike Camel Main's camel.server.mcp-protocol-era=dual.

Tests

mvn test -pl components-starter/camel-mcp-server-starter -Dspring-ai-version=2.1.0 -Dspring-boot-version=4.2.0 -Dspring-version=7.1.0: 69 tests pass, including SpringBootMcpServerModernTest (7), CamelMcpServerModernTransportAutoConfigurationTest (4) and the new cases in CamelMcpServerAutoConfigurationTest.

Claude Code on behalf of Croway

… Spring AI server for MCP protocol version 2026-07-28

With spring.ai.mcp.server.protocol=MODERN (Spring AI 2.1), Spring AI auto-configures the MCP Java SDK server for
protocol version 2026-07-28 instead of an McpSyncServer, so the starter registered nothing.

- SpringAiModernMcpServerEngine adds the ai-tool, ai-resource and ai-prompt routes to the in-memory tool, resource and
  prompt repositories Spring AI auto-configures, next to the application's own entries; those repositories tell the
  clients listening with subscriptions/listen when a list changes. A route with the name or URI of an entry already
  served is refused, and resource templates are checked for overlaps, as with the other protocols.
- CamelMcpServerAutoConfiguration also activates on that server (SYNC type only), and warns when the application
  defines its own repository, which Camel cannot add to.
- CamelMcpServerModernTransportAutoConfiguration provides Camel's Origin validation and caller-identity extraction to
  Spring AI's WebMvcModernServerTransport as beans; those of the application take precedence.
- Docs: "MCP protocol version 2026-07-28" in the starter usage page.
@Croway
Croway requested review from gzurowski and oscerd November 19, 2026 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant