ramu11 opened a new pull request, #9509: URL: https://github.com/apache/camel-quarkus/pull/9509
## Summary This PR implements MCP feature parity improvements for Camel Quarkus as part of **CAMEL-26360**. It extends the Quarkus MCP Server integration with resource-template support, prompt support, and authenticated caller identity propagation. It also introduces a dedicated Camel Quarkus AI Prompt extension and adds integration-test coverage. ## Changes included ### 1. MCP resource-template support - Integrates Camel AI resource templates with Quarkiverse MCP Server's `ResourceTemplateManager`. - Registers and removes resource templates as Camel routes are added and removed. - Supports resource-template matching and lifecycle management. - Adds integration-test coverage for resource-template listing, reading and route lifecycle. This follows the resource-template implementation introduced in Camel PR [#9506](https://github.com/apache/camel-quarkus/pull/9506). ### 2. AI Prompt extension and MCP prompt support - Introduces a new `camel-quarkus-ai-prompt` extension. - Adds runtime and deployment modules. - Registers the Camel AI Prompt processor through Quarkus build-time integration. - Integrates Camel AI prompts with Quarkiverse MCP Server's `PromptManager`. - Handles prompt registration, removal, metadata and prompt-content conversion. - Adds documentation and an example for the new extension. - Adds MCP integration tests for prompt listing, retrieval, content conversion and route lifecycle. ### 3. Caller identity propagation - Integrates Quarkus `CurrentIdentityAssociation` and `SecurityIdentity` with the MCP tool invocation path. - Resolves the authenticated identity for each tool call. - Propagates the Java security principal, principal name and roles through Camel's `McpToolCallContext`. - Returns `McpToolCallContext.EMPTY` for anonymous callers. - Makes caller identity information available to Camel routes through the standard MCP exchange properties. - Adds authenticated and anonymous identity integration-test coverage. ### 4. OAuth and security integration tests Introduces real Keycloak-backed integration testing using the Quarkus Keycloak Testcontainers support. Coverage includes: - Anonymous requests. - Invalid access tokens. - Authenticated requests using a real Keycloak-issued access token. - Caller identity propagation into Camel routes. - Protected-resource metadata discovery. - Origin-header validation. ### 5. Documentation Updates the MCP Server extension documentation and usage guide, and adds documentation and examples for the AI Prompt extension. ## Testing performed The Quarkiverse MCP Server Quarkus 4 compatibility source was temporarily vendored locally at upstream commit: `c8c5b73bcae77ac78ff61b0b6ad3affcab05ff5d` This was used only for local testing. No vendored third-party source, local Maven profile or `999-SNAPSHOT` override is included in this PR. **Successful tests:** - MCP extension and vendored Quarkiverse MCP Server reactor compilation. - Keycloak-backed OAuth integration tests: **5 tests passed, 0 failures, 0 errors**. - Maven reactor build for the OAuth integration-test execution: **BUILD SUCCESS**. Command used for the OAuth tests: ```bash mvn -Pmcp-server-vendored \ -pl integration-tests/mcp-server -am \ -Dtest=McpServerOAuthTest \ -Dsurefire.failIfNoSpecifiedTests=false test ``` **Full reactor test run:** The broader `-am test` execution ran 498 tests and reported 2 failures and 8 errors in the vendored Quarkiverse MCP Server's own test classes: - `InvalidArgumentTypeProtocolErrorTest` - `InvalidArgumentTypeTest` - `DevUIJsonRPCServiceTest` The reported failures concern JSON-RPC error-code handling and recursive DevUI JSON-RPC response parsing. These are upstream Quarkiverse MCP Server tests, not the five Keycloak OAuth tests. The complete filtered Camel Quarkus MCP integration-test suite still needs a separate successful verification. ## Known dependency blocker The Quarkiverse MCP Server dependency currently needs its Quarkus 4 / Jackson 3 compatibility migration. The relevant upstream work is: - [Quarkiverse MCP Server PR #1149](https://github.com/quarkiverse/quarkus-mcp-server/pull/1149) - Compatibility commit: `c8c5b73bcae77ac78ff61b0b6ad3affcab05ff5d` (Move to Quarkus 4) The migration updates the Quarkiverse MCP Server implementation for Quarkus 4 and Jackson 3 compatibility. At the time of this PR, a compatible GA release is not yet available. For local testing, the upstream source was temporarily vendored and built in the Maven reactor using `999-SNAPSHOT`. This local testing infrastructure was deliberately excluded from the commit. **Merge dependency:** This PR needs to be validated against the official Quarkiverse MCP Server release containing the Quarkus 4 migration. Once that release is available, the dependency version should be updated and the MCP integration tests rerun without the local vendoring setup. ## Scope and remaining work The caller identity bridge currently propagates the security principal, principal name and roles through `McpToolCallContext`. OAuth-specific subject, scopes, claims and token-validation details are not yet propagated by this implementation. The full MCP integration suite and the final build against the published Quarkiverse MCP Server Quarkus 4-compatible release remain outstanding. -- 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]
