Croway commented on code in PR #25306:
URL: https://github.com/apache/camel/pull/25306#discussion_r3710400801
##########
catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/mcp-server.adoc:
##########
@@ -0,0 +1,180 @@
+= MCP Server Component
+:doctitle: MCP Server
+:shortname: mcp-server
+:artifactid: camel-mcp-server
+:description: Expose ai-tool routes as MCP tools over streamable HTTP
+:since: 4.22
+:supportlevel: Preview
+:tabs-sync-option:
+
+*Since Camel {since}*
+
+The camel-mcp-server module exposes Camel routes registered via the
+xref:ROOT:ai-tool-component.adoc[ai-tool] component as tools of a
+https://modelcontextprotocol.io[Model Context Protocol] (MCP) server, served
+over MCP streamable HTTP. No route is needed for the server itself: add the
+dependency, configure which tags to expose, and every matching `ai-tool` route
+becomes an MCP tool that any MCP client (another Camel application, an IDE, a
+coding agent) can discover and call.
+
+Maven users will need to add the following dependency to their `pom.xml`:
+
+[source,xml]
+----
+<dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-mcp-server</artifactId>
+ <version>x.x.x</version>
+ <!-- use the same version as your Camel core version -->
+</dependency>
+----
+
+== Architecture
+
+The module is split in two artifacts:
+
+* `camel-mcp-server-api` — the runtime-agnostic _bridge_ and the small
+ `McpServerEngine` SPI. The bridge owns tool selection (tags), execution via
+ the shared `AiToolExecutor` (per-call timeout, error sanitization) and reacts
+ to `AiToolRegistry` changes when routes start and stop. It has no dependency
+ on the MCP Java SDK.
+* `camel-mcp-server` — the serving engine for Camel Main and Camel JBang,
+ built on the official MCP Java SDK with a Vert.x streamable HTTP transport.
+ The MCP endpoint is registered on the Camel main HTTP server's router, so it
+ serves on the main server port (`camel.server.port`) and inherits its
+ lifecycle, authentication and CORS configuration.
+
+Engine resolution mirrors the platform-http engine: a bean of type
+`McpServerEngine` in the Camel registry wins; otherwise the engine is
+discovered on the classpath. Other runtimes plug native engines through the
+same SPI: on Quarkus the `camel-quarkus-mcp-server` extension serves through
+the Quarkiverse `quarkus-mcp-server` (configured via `quarkus.mcp.server.*`),
+and on Spring Boot the starter serves through the Spring AI MCP server
+(configured via `spring.ai.mcp.server.*`). Bridge behavior — tag selection,
+timeout, sanitization — is identical on every runtime and verified by a shared
+conformance test kit.
+
+== Usage
+
+Define tools as regular `ai-tool` routes and give them tags:
+
+[source,yaml]
+----
+- route:
+ from:
+ uri: "ai-tool:query_db"
+ parameters:
+ description: "Query customer database"
+ tags: "crm"
+ parameter.customerId: string
+ parameter.customerId.description: "The customer id"
+ parameter.customerId.required: "true"
+ steps:
+ - to: "jdbc:dataSource"
+----
+
+Start the MCP server by adding the `McpServerBridge` service to the
+CamelContext, selecting the tags to expose:
+
+[source,java]
Review Comment:
will do in https://github.com/apache/camel/pull/25309
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]