AI Resource
Expose a Camel route as a read-only resource that MCP clients list and read through the Camel MCP server.
What’s inside
-
AI Resource component, URI syntax:
ai-resource:resourceName
Please refer to the above links for usage and configuration details.
Maven coordinates
<dependency>
<groupId>org.apache.camel.springboot</groupId>
<artifactId>camel-ai-resource-starter</artifactId>
</dependency> Spring Boot Auto-Configuration
The starter supports 10 options, which are listed below.
| Name | Description | Default | Type |
|---|---|---|---|
camel.component.ai-resource.autowired-enabled | Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc. | true | Boolean |
camel.component.ai-resource.bridge-error-handler | Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. Important: This is only possible if the 3rd party component allows Camel to be alerted if an exception was thrown. Some components handle this internally only, and therefore bridgeErrorHandler is not possible. In other situations we may improve the Camel component to hook into the 3rd party component and make this possible for future releases. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored. | false | Boolean |
camel.component.ai-resource.configuration | The configuration that every endpoint starts from. The endpoint copies it, and the options of the endpoint URI replace its values. The option is a org.apache.camel.component.ai.resource.AiResourceConfiguration type. | AiResourceConfiguration | |
camel.component.ai-resource.description | The description of what the resource contains, which MCP clients see in resources/list, or in resources/templates/list for a uriTemplate. If not set or blank, the resource name is used. | String | |
camel.component.ai-resource.enabled | Whether to enable auto configuration of the ai-resource component. This is enabled by default. | Boolean | |
camel.component.ai-resource.mime-type | The MIME type of the content, which MCP clients see in the resource listing and in the read result. It also decides how the message body is converted: a text type (text/*, a +json, +xml or +yaml suffix, or application/json, xml, yaml, x-yaml, javascript, ecmascript, sql, graphql or x-www-form-urlencoded; parameters such as charset are ignored) is converted to a String and returned as text, and any other type is converted to a byte[] and returned as a Base64 blob. A blank value means text/plain. | text/plain | String |
camel.component.ai-resource.resource-uri | The fixed URI that clients read the resource by, for example camel:///config/app.json. It must not contain \{ or }: use uriTemplate for a URI with variables. Set either resourceUri or uriTemplate, not both. The route fails to start when another resource has the same URI under one of its tags, or in the default pool when it has no tags. The MCP server refuses to expose a second resource with a URI it already exposes. | String | |
camel.component.ai-resource.tags | A comma-separated list of tags to register the resource under. The MCP server exposes the resources whose tags match its tag patterns. Without tags, the resource goes into a default pool that the MCP server never exposes. | String | |
camel.component.ai-resource.title | The human-readable title of the resource, which MCP clients can show in the resource listing instead of the name. If not set or blank, the resource has no title. | String | |
camel.component.ai-resource.uri-template | A URI template (RFC 6570 level 1) for a family of resources, for example crm://customers/{id}. It needs a scheme, a path and at least one variable, and each variable must be a whole path segment; a query or fragment is not allowed. The route receives the URI that the client read in the CamelAiResourceUri header, and each variable in a CamelAiResourceTemplateVariable.NAME header. Set either uriTemplate or resourceUri, not both. The route fails to start when its template can match the same URI as the template of another route with tags. A URI that is also the resourceUri of a resource is read from that resource. | String |