ramu11 opened a new pull request, #29454:
URL: https://github.com/apache/camel/pull/29454
## CAMEL-26355: Add MCP prompts from Camel routes
### Motivation
Add support for exposing Apache Camel routes as Model Context Protocol (MCP)
prompts, allowing MCP clients to invoke reusable, parameterized prompts
implemented using Camel routes.
### Description
This PR introduces a new `camel-ai-prompt` component and integrates MCP
prompt support into the existing Camel MCP server infrastructure.
Key changes:
- **New `camel-ai-prompt` component**
- Exposes Camel routes as MCP prompts using the `ai-prompt` consumer
endpoint.
- Supports prompt names, titles, descriptions, tags, and configurable
arguments.
- Makes prompt arguments available to the Camel route as message headers.
- Supports returning a single string or multiple messages with user and
assistant roles.
- **MCP server integration**
- Adds prompt registration, discovery, execution, and removal to the MCP
server bridge.
- Supports exposing prompts selectively using the configured MCP tags.
- Handles duplicate prompt names across tags and promotes another matching
route when the currently published route is stopped.
- Adds prompt execution timeout handling and sanitized error responses.
- **Transport support**
- Integrates MCP prompts with the existing streamable HTTP and stdio
server engines.
- **Camel Main configuration and metadata**
- Adds `mcpPromptTimeout` configuration.
- Updates MCP configuration descriptions to include prompt support.
- Updates generated component metadata and catalog documentation.
### Tests
Added and extended tests covering:
- Prompt execution and argument handling.
- Multiple prompt messages and assistant responses.
- Required argument validation.
- Tag-based prompt selection.
- Duplicate prompt name handling and route lifecycle.
- Invalid prompt results and sanitized execution errors.
- Prompt execution timeout and interruption.
### Build verification
Successfully built and tested the relevant modules:
- `camel-ai-prompt`
- `camel-mcp-server-api`
- `camel-mcp-server`
- `camel-main`
--
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]