jamesnetherton commented on code in PR #8950:
URL: https://github.com/apache/camel-quarkus/pull/8950#discussion_r3705685574


##########
integration-tests-jvm/mcp-server/pom.xml:
##########
@@ -0,0 +1,124 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0";
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.camel.quarkus</groupId>
+        <artifactId>camel-quarkus-build-parent-it</artifactId>
+        <version>3.39.0-SNAPSHOT</version>
+        <relativePath>../../poms/build-parent-it/pom.xml</relativePath>
+    </parent>
+
+    <artifactId>camel-quarkus-integration-test-mcp-server</artifactId>
+    <name>Camel Quarkus :: Integration Tests :: MCP Server</name>
+    <description>Integration tests for Camel Quarkus MCP Server 
extension</description>
+
+    <properties>
+        <mcp-java-sdk.version>2.0.0</mcp-java-sdk.version>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.camel.quarkus</groupId>
+            <artifactId>camel-quarkus-mcp-server</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.camel.quarkus</groupId>
+            <artifactId>camel-quarkus-ai-tool</artifactId>
+        </dependency>
+
+        <!-- test dependencies -->
+        <!-- official MCP Java SDK client, same artifacts camel-openai uses -->
+        <dependency>
+            <groupId>io.modelcontextprotocol.sdk</groupId>
+            <artifactId>mcp-core</artifactId>
+            <version>${mcp-java-sdk.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>io.modelcontextprotocol.sdk</groupId>
+            <artifactId>mcp-json-jackson2</artifactId>
+            <version>${mcp-java-sdk.version}</version>
+            <scope>test</scope>
+        </dependency>

Review Comment:
   Please add these to the dependabot config with the other test dependencies:
   
   https://github.com/apache/camel-quarkus/blob/main/.github/dependabot.yml#L49



##########
integration-tests-jvm/mcp-server/pom.xml:
##########
@@ -0,0 +1,124 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0";
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.camel.quarkus</groupId>
+        <artifactId>camel-quarkus-build-parent-it</artifactId>
+        <version>3.39.0-SNAPSHOT</version>
+        <relativePath>../../poms/build-parent-it/pom.xml</relativePath>
+    </parent>
+
+    <artifactId>camel-quarkus-integration-test-mcp-server</artifactId>
+    <name>Camel Quarkus :: Integration Tests :: MCP Server</name>
+    <description>Integration tests for Camel Quarkus MCP Server 
extension</description>
+
+    <properties>
+        <mcp-java-sdk.version>2.0.0</mcp-java-sdk.version>

Review Comment:
   Please move this property to the root pom.xml with the other test version 
properties:
   
   https://github.com/apache/camel-quarkus/blob/main/pom.xml#L187



##########
pom.xml:
##########
@@ -56,6 +56,7 @@
         
<quarkiverse-freemarker.version>1.3.0</quarkiverse-freemarker.version><!-- 
https://repo1.maven.org/maven2/io/quarkiverse/freemarker/quarkus-freemarker-parent/
 -->
         <quarkiverse-fory.version>1.4.0</quarkiverse-fory.version><!-- 
https://repo1.maven.org/maven2/io/quarkiverse/fory/quarkus-fory-parent/ -->
         <quarkiverse-groovy.version>3.38.0</quarkiverse-groovy.version><!-- 
https://repo1.maven.org/maven2/io/quarkiverse/groovy/quarkus-groovy-parent/ -->
+        
<quarkiverse-mcp-server.version>1.13.1</quarkiverse-mcp-server.version><!-- 
https://repo1.maven.org/maven2/io/quarkiverse/mcp/quarkus-mcp-server-parent/ -->

Review Comment:
   Nitpick - can we keep alphabetical order and move it above the 
`quarkiverse-micrometer.version` property.



##########
integration-tests-jvm/mcp-server/src/test/java/org/apache/camel/quarkus/component/mcp/server/it/McpServerTest.java:
##########
@@ -0,0 +1,138 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.mcp.server.it;
+
+import java.time.Duration;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.TimeUnit;
+import java.util.stream.Collectors;
+
+import io.modelcontextprotocol.client.McpClient;
+import io.modelcontextprotocol.client.McpSyncClient;
+import 
io.modelcontextprotocol.client.transport.HttpClientStreamableHttpTransport;
+import io.modelcontextprotocol.spec.McpSchema;
+import io.quarkus.test.junit.QuarkusTest;
+import jakarta.inject.Inject;
+import org.apache.camel.CamelContext;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.Test;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.awaitility.Awaitility.await;
+
+/**
+ * The engine conformance scenarios (CAMEL-24313) against the 
quarkus-mcp-server engine, driven by the official MCP SDK
+ * client over streamable HTTP. Mirrors {@code 
McpServerConformanceTestSupport} from camel-mcp-server-api, which cannot
+ * be reused as-is here because it manages its own CamelContext outside 
Quarkus.
+ */
+@QuarkusTest
+class McpServerTest {
+
+    @Inject
+    CamelContext camelContext;

Review Comment:
   Instead of @Inject into the test class, can we add a JAX-RS resource class 
that interacts with the Camel context for the tests to interrogate the route 
status etc. It'll make life easier if we promote the extension to native mode 
support. You can get examples from other integration tests.
   



##########
extensions-jvm/mcp-server/runtime/pom.xml:
##########
@@ -0,0 +1,107 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0";
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.camel.quarkus</groupId>
+        <artifactId>camel-quarkus-mcp-server-parent</artifactId>
+        <version>3.39.0-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+
+    <artifactId>camel-quarkus-mcp-server</artifactId>
+    <name>Camel Quarkus :: MCP Server :: Runtime</name>
+    <description>Expose ai-tool routes as MCP tools over streamable 
HTTP</description>
+
+    <properties>
+        <camel.quarkus.jvmSince>3.39.0</camel.quarkus.jvmSince>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.camel.quarkus</groupId>
+            <artifactId>camel-quarkus-core</artifactId>
+        </dependency>
+        <!-- the runtime-agnostic MCP bridge and engine SPI; the serving 
engine is provided
+             by the quarkiverse quarkus-mcp-server extension below (NOT the 
camel-mcp-server
+             Vert.x engine used on Camel Main / JBang) -->

Review Comment:
   Can probably remove this.



-- 
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]

Reply via email to