Croway commented on code in PR #9509:
URL: https://github.com/apache/camel-quarkus/pull/9509#discussion_r4698438240


##########
extensions/mcp-server/runtime/src/main/java/org/apache/camel/quarkus/component/mcp/server/QuarkusMcpServerEngine.java:
##########
@@ -86,6 +129,122 @@ public void initialize(McpServerInfo info) {
         LOG.debug("quarkus-mcp-server engine initialized; serving 
configuration is owned by quarkus.mcp.server.*");
     }
 
+    /**
+     * Converts the current Quarkus request identity to the transport-neutral 
Camel MCP context.
+     *
+     * The CurrentIdentityAssociation is request scoped. It is deliberately 
read inside the
+     * tool callback so concurrent MCP requests cannot share or overwrite each 
other's identity.
+     */
+    private McpToolCallContext currentToolCallContext() {
+        // Applications without quarkus-security do not have this association.
+        if (currentIdentityAssociation == null) {
+            return McpToolCallContext.EMPTY;
+        }
+
+        SecurityIdentity identity = currentIdentityAssociation.getIdentity();
+        if (identity == null || identity.isAnonymous()) {
+            return McpToolCallContext.EMPTY;
+        }
+
+        Principal principal = identity.getPrincipal();
+        String principalName = principal != null ? principal.getName() : null;
+        if (principalName != null && principalName.isBlank()) {
+            principalName = null;
+        }
+
+        List<String> roles = identity.getRoles().stream()
+                .filter(role -> role != null && !role.isBlank())
+                .sorted()
+                .toList();
+
+        OAuthIdentity oauth = oauthIdentity(principal);
+
+        if (principal == null && principalName == null && roles.isEmpty() && 
oauth == null) {
+            return McpToolCallContext.EMPTY;
+        }
+
+        return new McpToolCallContext(
+                principal,
+                principalName,
+                roles.isEmpty() ? null : roles,
+                oauth != null ? oauth.subject() : null,
+                oauth != null ? oauth.scopes() : null,
+                oauth != null ? oauth.claims() : null,
+                null);
+    }
+
+    /**
+     * Extracts OAuth information from a MicroProfile JWT principal without 
making
+     * the MP JWT API a mandatory runtime dependency of the MCP extension.
+     */
+    private static OAuthIdentity oauthIdentity(Principal principal) {
+        if (principal == null) {
+            return null;
+        }
+
+        try {
+            ClassLoader classLoader = 
Thread.currentThread().getContextClassLoader();
+            if (classLoader == null) {
+                classLoader = principal.getClass().getClassLoader();
+            }
+
+            Class<?> jwtType = Class.forName(
+                    "org.eclipse.microprofile.jwt.JsonWebToken", false, 
classLoader);
+
+            if (!jwtType.isInstance(principal)) {
+                return null;
+            }
+
+            String subject = (String) 
jwtType.getMethod("getSubject").invoke(principal);
+            Object claimNames = 
jwtType.getMethod("getClaimNames").invoke(principal);
+
+            Map<String, Object> claims = new LinkedHashMap<>();
+            if (claimNames instanceof Collection<?> names) {
+                var getClaim = jwtType.getMethod("getClaim", String.class);
+                for (Object name : names) {
+                    if (name instanceof String claimName) {
+                        claims.put(claimName, getClaim.invoke(principal, 
claimName));

Review Comment:
   **The caller's bearer token ends up in `CamelMcpOAuthClaims`.** quarkus-oidc 
stores the raw access token as a claim: `OidcUtils#validateAndCreateIdentity` 
calls `jwtClaims.setClaim(Claims.raw_token.name(), credential.getToken())`. 
smallrye-jwt's `JWTCallerPrincipal#getClaimNames` also always adds `raw_token`. 
This loop copies it, so every tool exchange carries the caller's token in an 
exchange property. From there, tracing, `showProperties` logging or a route 
that forwards the claims can pick it up. Camel Main and Spring Boot put only 
the token payload in the claims.
   
   I ran this method as-is (`oauthIdentity` and `oauthScopes`) on a principal 
built the way quarkus-oidc 4.0.0 builds it, with smallrye-jwt 5.0.0:
   
   ```
   claims keys = [sub, realm_access, raw_token, scope, preferred_username]
   raw_token claim = eyJhbGciOiJSUzI1NiJ9.payload.signature
   ```
   
   Suggestion: skip `Claims.raw_token.name()` here, and have the Keycloak test 
assert that the claims contain `sub` but not `raw_token`.
   
   _Claude Code (Opus 5.5) on behalf of Federico Mariani_



##########
integration-tests/mcp-server/src/test/java/org/apache/camel/quarkus/component/mcp/server/it/McpServerOAuthTest.java:
##########
@@ -0,0 +1,145 @@
+/*
+ * 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.net.URI;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+import io.quarkiverse.mcp.server.TextContent;
+import io.quarkiverse.mcp.server.ToolResponse;
+import io.quarkiverse.mcp.server.test.McpAssured;
+import io.quarkiverse.mcp.server.test.McpAssured.McpStreamableTestClient;
+import io.quarkus.test.common.QuarkusTestResource;
+import io.quarkus.test.junit.QuarkusTest;
+import io.restassured.RestAssured;
+import org.eclipse.microprofile.config.ConfigProvider;
+import org.junit.jupiter.api.Test;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+/** Exercises a real Keycloak/OIDC identity through MCP and into a Camel tool 
route. */
+@QuarkusTest
+@QuarkusTestResource(value = McpServerKeycloakTestResource.class, 
restrictToAnnotatedClass = true)
+class McpServerOAuthTest {
+
+    private static final String INITIALIZE_REQUEST = 
"{\"jsonrpc\":\"2.0\",\"id\":1,"
+            + 
"\"method\":\"initialize\",\"params\":{\"protocolVersion\":\"2025-06-18\","
+            + 
"\"capabilities\":{},\"clientInfo\":{\"name\":\"camel-quarkus-keycloak-test\",\"version\":\"1\"}}}";
+
+    @Test
+    void anonymousMcpRequestIsRejected() {
+        postInitialize(null, 401, false);
+    }
+
+    @Test
+    void invalidBearerTokenIsRejected() {
+        postInitialize("not-a-valid-keycloak-token", 401, false);
+    }
+
+    @Test
+    void protectedResourceMetadataIsPublished() {
+        String issuer = keycloakIssuer();
+        String metadata = 
RestAssured.get("/.well-known/oauth-protected-resource")
+                .then()
+                .statusCode(200)
+                .extract()
+                .asString();
+        
assertThat(metadata).contains("authorization_servers").contains(issuer);
+    }
+
+    // This exercises quarkus-mcp-server's loopback DNS-rebinding check, not a 
general Origin allow-list.
+    @Test
+    void untrustedOriginIsRejectedEvenWithValidBearerToken() {
+        postInitialize(accessToken(), 403, true);

Review Comment:
   **This 403 comes from the Quarkus CORS filter, not from 
quarkus-mcp-server.** The module's `application.properties` enables CORS with 
`quarkus.http.cors.origins=http://localhost:8081`. `CORSFilter` answers 403 for 
any other `Origin` before the request reaches `/mcp`. So this test still passes 
with `quarkus.mcp.server.http.dns-rebinding-check.enabled=false`.
   
   POST `/mcp` `initialize`, on Quarkus 3.40.1 with quarkus-mcp-server 2.0.4 
(both checks are unchanged in Quarkus 4.0.0 and quarkus-mcp-server `main`):
   
   ```
   CORS as in this module                     Origin: evil.example.com          
-> 403 CORS Rejected - Invalid origin
   CORS as in this module, dns-rebinding off  Origin: evil.example.com          
-> 403 CORS Rejected - Invalid origin
   CORS as in this module, dns-rebinding off  Host + Origin: evil.example.com   
-> 200 OK
   no CORS, dns-rebinding on                  Origin: evil.example.com          
-> 403 Invalid origin
   no CORS, dns-rebinding on                  Host + Origin: evil.example.com   
-> 403 Invalid origin
   ```
   
   The third line also shows that CORS can't stand in for the DNS-rebinding 
check: it treats a rebinding request as same-origin.
   
   Suggestion: drop the CORS settings from this module unless something else 
needs them, or turn CORS off for this test, and assert the `Invalid origin` 
status message rather than only the status code.
   
   _Claude Code (Opus 5.5) on behalf of Federico Mariani_



##########
extensions/mcp-server/runtime/src/main/java/org/apache/camel/quarkus/component/mcp/server/QuarkusMcpServerEngine.java:
##########
@@ -86,6 +129,122 @@ public void initialize(McpServerInfo info) {
         LOG.debug("quarkus-mcp-server engine initialized; serving 
configuration is owned by quarkus.mcp.server.*");
     }
 
+    /**
+     * Converts the current Quarkus request identity to the transport-neutral 
Camel MCP context.
+     *
+     * The CurrentIdentityAssociation is request scoped. It is deliberately 
read inside the
+     * tool callback so concurrent MCP requests cannot share or overwrite each 
other's identity.
+     */
+    private McpToolCallContext currentToolCallContext() {
+        // Applications without quarkus-security do not have this association.
+        if (currentIdentityAssociation == null) {
+            return McpToolCallContext.EMPTY;
+        }
+
+        SecurityIdentity identity = currentIdentityAssociation.getIdentity();
+        if (identity == null || identity.isAnonymous()) {
+            return McpToolCallContext.EMPTY;
+        }
+
+        Principal principal = identity.getPrincipal();
+        String principalName = principal != null ? principal.getName() : null;
+        if (principalName != null && principalName.isBlank()) {
+            principalName = null;
+        }
+
+        List<String> roles = identity.getRoles().stream()
+                .filter(role -> role != null && !role.isBlank())
+                .sorted()
+                .toList();
+
+        OAuthIdentity oauth = oauthIdentity(principal);
+
+        if (principal == null && principalName == null && roles.isEmpty() && 
oauth == null) {
+            return McpToolCallContext.EMPTY;
+        }
+
+        return new McpToolCallContext(
+                principal,
+                principalName,
+                roles.isEmpty() ? null : roles,
+                oauth != null ? oauth.subject() : null,
+                oauth != null ? oauth.scopes() : null,
+                oauth != null ? oauth.claims() : null,
+                null);
+    }
+
+    /**
+     * Extracts OAuth information from a MicroProfile JWT principal without 
making
+     * the MP JWT API a mandatory runtime dependency of the MCP extension.
+     */
+    private static OAuthIdentity oauthIdentity(Principal principal) {
+        if (principal == null) {
+            return null;
+        }
+
+        try {
+            ClassLoader classLoader = 
Thread.currentThread().getContextClassLoader();
+            if (classLoader == null) {
+                classLoader = principal.getClass().getClassLoader();
+            }
+
+            Class<?> jwtType = Class.forName(
+                    "org.eclipse.microprofile.jwt.JsonWebToken", false, 
classLoader);
+
+            if (!jwtType.isInstance(principal)) {
+                return null;
+            }
+
+            String subject = (String) 
jwtType.getMethod("getSubject").invoke(principal);
+            Object claimNames = 
jwtType.getMethod("getClaimNames").invoke(principal);
+
+            Map<String, Object> claims = new LinkedHashMap<>();
+            if (claimNames instanceof Collection<?> names) {
+                var getClaim = jwtType.getMethod("getClaim", String.class);
+                for (Object name : names) {
+                    if (name instanceof String claimName) {
+                        claims.put(claimName, getClaim.invoke(principal, 
claimName));
+                    }
+                }
+            }
+
+            List<String> scopes = oauthScopes(claims.get("scope"));

Review Comment:
   **Scopes don't match Camel Main.** Main reads both `scope` and `scp` 
(`JwtTokenValidator#readScopes`), and Spring Security does the same. Here, a 
token that carries its scopes in `scp` (Microsoft Entra ID, for example) gets 
no `CamelMcpOAuthScopes`. A policy that checks a scope then denies that caller 
on Quarkus only.
   
   smallrye-jwt also wraps non-string custom claims in JSON-P values. 
`String.valueOf` on a `JsonString` returns the JSON text, so an array-valued 
`scope` keeps its quotes. Same test as the `raw_token` comment:
   
   ```
   "scp": "orders.read orders.write"        -> scopes = null
   "scope": ["orders.read", "orders.write"] -> scopes = ["\"orders.read\"", 
"\"orders.write\""]
   ```
   
   The other claim values have JSON-P types as well: `realm_access` is a 
Parsson `JsonObject`. A route that reads the claims therefore sees different 
types than on Main and Spring Boot, which is worth a line in the docs.
   
   Suggestion: read both `scope` and `scp`, unwrap `JsonString` values with 
`getString()`, and split each value on whitespace.
   
   _Claude Code (Opus 5.5) on behalf of Federico Mariani_



##########
extensions/mcp-server/runtime/src/main/java/org/apache/camel/quarkus/component/mcp/server/QuarkusMcpServerEngine.java:
##########
@@ -191,6 +353,321 @@ public boolean supportsResources() {
         return true;
     }
 
+    @Override
+    public void resourceTemplateAdded(McpServerResourceTemplate 
resourceTemplate) {
+        AiResourceUriTemplate matcher;
+        try {
+            matcher = new 
AiResourceUriTemplate(resourceTemplate.uriTemplate());
+        } catch (IllegalArgumentException e) {
+            throw new McpServerRefusedException(
+                    "Unsupported MCP resource template '" + 
resourceTemplate.uriTemplate() + "'", e);
+        }
+
+        // Retry cleanup if a previous route stop failed to remove this 
template.
+        try {
+            removeRegisteredResourceTemplate(resourceTemplate.uriTemplate());
+        } catch (Exception e) {
+            throw new McpServerRefusedException(
+                    "Previously registered MCP resource template '" + 
resourceTemplate.uriTemplate()
+                            + "' could not be removed before re-registration",
+                    e);
+        }
+
+        // Multiple matching templates make resource reads ambiguous in 
quarkus-mcp-server.
+        // Definitions on other MCP servers are independent and must remain 
untouched.
+        for (ResourceTemplateManager.ResourceTemplateInfo existing : 
resourceTemplateManager) {
+            if (existing.serverNames().contains(McpServer.DEFAULT)
+                    && templatesOverlap(matcher, existing.uriTemplate())) {
+                throw new McpServerRefusedException(
+                        "Resource template '" + resourceTemplate.uriTemplate()
+                                + "' overlaps resource template '"
+                                + existing.uriTemplate() + "'");
+            }
+        }
+
+        ResourceTemplateManager.ResourceTemplateDefinition definition = 
resourceTemplateManager
+                .newResourceTemplate(resourceTemplate.name())
+                .setUriTemplate(resourceTemplate.uriTemplate())

Review Comment:
   **quarkus-mcp-server matches templates with looser rules than Camel, so 
templates that Camel accepts can clash or fail to register.** 
`ResourceTemplateManagerImpl#createMatcherFromUriTemplate` replaces `\{(\w+)\}` 
with `([^/]+)` and keeps the rest of the template as a raw regex. 
`AiResourceUriTemplate` quotes the literal text and allows dotted variable 
names. Both matchers on the same inputs:
   
   ```
   crm://api/v1.0/{id} vs crm://api/v1x0/{id}     Camel overlaps = false
   quarkus-mcp-server crm://api/v1.0/{id}         matches crm://api/v1x0/42 = 
true
   crm://customers/{customer.id}                  Camel accepts; 
quarkus-mcp-server: PatternSyntaxException: Illegal repetition near index 17
   crm://customers/42?view=full                   quarkus-mcp-server matches = 
true, Camel matches = false
   ```
   
   What this means here:
   
   - Camel accepts the two `v1.0` / `v1x0` templates as disjoint, but both 
match `crm://api/v1x0/42`, so that read fails with "Multiple resource templates 
match".
   - `{customer.id}` is refused with the regex error as the reason, because 
`PatternSyntaxException` is an `IllegalArgumentException`.
   - `?view=full` reaches the bridge, which answers not found, and line 400 
turns that into `INTERNAL_ERROR` instead of `RESOURCE_NOT_FOUND`. Camel Main 
also returns -32603 for this case today.
   
   Suggestion: before registering, refuse templates whose literal text contains 
regex metacharacters or whose variable names don't match `\w+`, with a message 
that says why. Alternatively, check the overlap with quarkus-mcp-server's own 
pattern. Either way, the restriction belongs in the docs.
   
   _Claude Code (Opus 5.5) on behalf of Federico Mariani_



##########
extensions/mcp-server/runtime/src/main/java/org/apache/camel/quarkus/component/mcp/server/QuarkusMcpServerEngine.java:
##########
@@ -191,6 +353,321 @@ public boolean supportsResources() {
         return true;
     }
 
+    @Override
+    public void resourceTemplateAdded(McpServerResourceTemplate 
resourceTemplate) {
+        AiResourceUriTemplate matcher;
+        try {
+            matcher = new 
AiResourceUriTemplate(resourceTemplate.uriTemplate());
+        } catch (IllegalArgumentException e) {
+            throw new McpServerRefusedException(
+                    "Unsupported MCP resource template '" + 
resourceTemplate.uriTemplate() + "'", e);
+        }
+
+        // Retry cleanup if a previous route stop failed to remove this 
template.
+        try {
+            removeRegisteredResourceTemplate(resourceTemplate.uriTemplate());
+        } catch (Exception e) {
+            throw new McpServerRefusedException(
+                    "Previously registered MCP resource template '" + 
resourceTemplate.uriTemplate()
+                            + "' could not be removed before re-registration",
+                    e);
+        }
+
+        // Multiple matching templates make resource reads ambiguous in 
quarkus-mcp-server.
+        // Definitions on other MCP servers are independent and must remain 
untouched.
+        for (ResourceTemplateManager.ResourceTemplateInfo existing : 
resourceTemplateManager) {
+            if (existing.serverNames().contains(McpServer.DEFAULT)
+                    && templatesOverlap(matcher, existing.uriTemplate())) {
+                throw new McpServerRefusedException(
+                        "Resource template '" + resourceTemplate.uriTemplate()
+                                + "' overlaps resource template '"
+                                + existing.uriTemplate() + "'");
+            }
+        }
+
+        ResourceTemplateManager.ResourceTemplateDefinition definition = 
resourceTemplateManager
+                .newResourceTemplate(resourceTemplate.name())
+                .setUriTemplate(resourceTemplate.uriTemplate())
+                .setMimeType(resourceTemplate.mimeType())
+                .setDescription(resourceTemplate.description());
+        if (resourceTemplate.title() != null && 
!resourceTemplate.title().isBlank()) {
+            definition.setTitle(resourceTemplate.title());
+        }
+        definition.setHandler(arguments -> {
+            String requestedUri = arguments.requestUri().value();
+            McpResourceReadResult result = 
resourceTemplate.handler().read(requestedUri);
+            if (result.isError()) {
+                throw new McpException(result.errorMessage(), 
JsonRpcErrorCodes.INTERNAL_ERROR);
+            }
+            // Keep Base64 unwrapped: BlobResourceContents.create(String, 
byte[]) inserts MIME line breaks.
+            ResourceContents contents = result.blob() != null
+                    ? new BlobResourceContents(requestedUri, 
Base64.getEncoder().encodeToString(result.blob()),
+                            resourceTemplate.mimeType())
+                    : new TextResourceContents(requestedUri, result.text(), 
resourceTemplate.mimeType());
+            return new ResourceResponse(List.of(contents));
+        });
+        try {
+            definition.register();
+        } catch (IllegalArgumentException e) {
+            throw new McpServerRefusedException(
+                    "Resource template '" + resourceTemplate.uriTemplate() + 
"' could not be registered: "
+                            + e.getMessage(),
+                    e);
+        }
+        registeredResourceTemplates.put(resourceTemplate.uriTemplate(), 
resourceTemplate.name());
+        LOG.debug("MCP resource template added: {}", 
resourceTemplate.uriTemplate());
+    }
+
+    @Override
+    public void resourceTemplateRemoved(String uriTemplate) {
+        try {
+            removeRegisteredResourceTemplate(uriTemplate);
+            LOG.debug("MCP resource template removed: {}", uriTemplate);
+        } catch (Exception e) {
+            // Keep the ownership entry so a later route start can retry the 
removal.
+            LOG.warn(
+                    "Failed to remove MCP resource template {}; ownership 
retained for retry",
+                    uriTemplate, e);
+        }
+    }
+
+    private void removeRegisteredResourceTemplate(String uriTemplate) throws 
Exception {
+        String name = registeredResourceTemplates.get(uriTemplate);
+        if (name == null) {
+            // Refused templates are not owned by this engine.
+            return;
+        }
+
+        resourceTemplateManager.removeResourceTemplate(name, 
McpServer.DEFAULT);
+        registeredResourceTemplates.remove(uriTemplate, name);
+    }
+
+    @Override
+    public boolean supportsResourceTemplates() {
+        return true;
+    }
+
+    /**
+     * Tests whether a Camel resource template overlaps another template when 
both use URI-template syntax
+     * understood by {@link AiResourceUriTemplate}. Quarkiverse MCP Server 
also accepts templates outside that
+     * syntax (for example, variables in query parameters); those templates 
are left to its matcher rather than
+     * causing otherwise unrelated Camel templates to be refused.
+     */
+    private static boolean templatesOverlap(AiResourceUriTemplate candidate, 
String existingTemplate) {
+        try {
+            return candidate.overlaps(new 
AiResourceUriTemplate(existingTemplate));
+        } catch (IllegalArgumentException e) {
+            LOG.debug(
+                    "Skipping overlap check against resource template '{}' 
because its URI-template syntax is "
+                            + "not supported by Camel's matcher",
+                    existingTemplate, e);
+            return false;
+        }
+    }
+
+    @Override
+    public void promptAdded(McpServerPrompt prompt) {
+        try {
+            removeRegisteredPrompt(prompt.name());
+        } catch (RuntimeException e) {
+            throw new McpServerRefusedException(
+                    "Previously registered MCP prompt '" + prompt.name()
+                            + "' could not be removed before re-registration",
+                    e);
+        }
+
+        // Do not replace a prompt registered directly by the application.
+        if (promptManager.getPrompt(prompt.name(), McpServer.DEFAULT) != null) 
{
+            throw new McpServerRefusedException(
+                    "MCP prompt '" + prompt.name() + "' is already registered 
by the application");
+        }
+
+        PromptManager.PromptDefinition definition = 
promptManager.newPrompt(prompt.name())
+                .setDescription(prompt.description());
+
+        if (prompt.title() != null && !prompt.title().isBlank()) {
+            definition.setTitle(prompt.title());
+        }
+
+        for (McpPromptArgument argument : prompt.arguments()) {
+            definition.addArgument(argument.name(), argument.description(), 
argument.required());
+        }
+
+        definition.setHandler(arguments -> {
+            Map<String, String> args = arguments.args() != null ? 
arguments.args() : Map.of();

Review Comment:
   **Non-string prompt arguments are converted, not rejected.** 
quarkus-mcp-server calls `toString()` on each argument before this handler runs 
(`PromptManagerImpl`: `args.put(e.getKey(), e.getValue().toString())`). So 
`{"name": 42}` runs the greeting route with `42`. Camel Main and Spring Boot 
answer -32602 (invalid params) for the same request (`McpPromptSdkSupport`).
   
   The original values are only in the raw request, so a fix may need support 
from quarkus-mcp-server; a note in the docs would also do. This one is from 
reading the code; I haven't run it.
   
   _Claude Code (Opus 5.5) on behalf of Federico Mariani_



##########
pom.xml:
##########
@@ -59,7 +59,8 @@
         <quarkiverse-jgit.version>4.0.0</quarkiverse-jgit.version><!-- 
https://repo1.maven.org/maven2/io/quarkiverse/jgit/quarkus-jgit/ -->
         <quarkiverse-jsch.version>4.0.0</quarkiverse-jsch.version><!-- 
https://repo1.maven.org/maven2/io/quarkiverse/jsch/quarkus-jsch/ -->
         
<quarkiverse-langchain4j.version>2.0.0.Beta4</quarkiverse-langchain4j.version><!--
 
https://repo1.maven.org/maven2/io/quarkiverse/langchain4j/quarkus-langchain4j-parent
 -->
-        
<quarkiverse-mcp-server.version>2.0.4</quarkiverse-mcp-server.version><!-- 
https://repo1.maven.org/maven2/io/quarkiverse/mcp/quarkus-mcp-server-parent/ -->
+        <!-- Quarkiverse MCP Server main (3.0.x compatibility line, Quarkus 
4). The upstream source POM is locally re-versioned as 3.0.0-SNAPSHOT by the 
installer below. -->
+        
<quarkiverse-mcp-server.version>3.0.0-SNAPSHOT</quarkiverse-mcp-server.version>

Review Comment:
   This is the CI blocker described in the review summary: `3.0.0-SNAPSHOT` 
isn't published anywhere CI can reach (the "installer below" isn't in the PR), 
and the flattened BOMs still say 2.0.4.
   
   _Claude Code (Opus 5.5) on behalf of Federico Mariani_



##########
extensions/mcp-server/runtime/src/main/doc/usage.adoc:
##########
@@ -45,6 +45,42 @@ in the AI Tool component documentation.
 In native mode, an `outputSchema` loaded from `classpath:` must be
 
xref:user-guide/native-mode.adoc#embedding-resource-in-native-executable[embedded
 in the native executable].
 
+=== Caller identity
+
+For authenticated HTTP requests, the MCP server reads the current Quarkus
+`SecurityIdentity` when a tool is invoked. The Camel MCP bridge puts the
+authenticated Java `Principal`, its name and its role names on the tool
+exchange as these properties:
+
+* `CamelMcpSecurityPrincipal` — the raw `java.security.Principal`.
+* `CamelMcpSecurityPrincipalName` — the principal name.
+* `CamelMcpSecurityPrincipalRoles` — the caller's role names as a collection.

Review Comment:
   **These two property names don't exist.** The bridge sets 
`McpToolCallContext.SECURITY_PRINCIPAL_NAME_PROPERTY` and 
`SECURITY_PRINCIPAL_ROLES_PROPERTY`, which are 
`CamelAiToolSecurityPrincipalName` and `CamelAiToolSecurityPrincipalRoles` 
(`AiToolConstants`). An `AuthorizationPolicy` written from this list reads 
`null` even for an authenticated caller. Only `CamelMcpSecurityPrincipal` has 
the `CamelMcp` prefix.
   
   The generated `docs/modules/ROOT/pages/reference/extensions/mcp-server.adoc` 
(lines 120-121) needs the same change.
   
   _Claude Code (Opus 5.5) on behalf of Federico Mariani_



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