Write and load routes
This page shows how to write the Apache Camel routes that CIC serves as MCP tools, and how CIC gets the route files.
Design routes
Use a visual editor to design the routes, for example Kaoto or Camel Karavan. Save the routes in YAML format.
Write an ai-tool route
CIC serves a route as an MCP tool when the route starts with the ai-tool: URI. The tool name, the description, the parameters, and the tags are in the route:
- route:
id: get-employee-info
from:
uri: ai-tool:get-employee-info
parameters:
description: "Retrieve employee information by ID"
tags: wanaku
parameter.employeeId: string
parameter.employeeId.description: "The employee ID"
steps:
- toD: https://api.example.com/employees/${header.employeeId}ai-tool:<name>sets the tool name.descriptionis the tool description that the AI agent sees.- Each
parameter.<name>: <type>andparameter.<name>.descriptionpair defines one tool parameter. The route reads the parameter from the header with the same name, for example${header.employeeId}. tagscontrols the exposure of the tool. CIC serves only the routes whose tags match--mcp-tags. The default value of--mcp-tagsiswanaku. CIC never serves a route that has no tags.
Use standard routes
Routes that start with standard Camel URIs, for example direct: or timer:, are not MCP tools. An ai-tool: route can call them.
Add dependencies
CIC contains only a subset of the Apache Camel components. Put the other dependencies in a text file, as a comma-separated list of Maven coordinates:
org.apache.camel:camel-http:4.22.0,org.apache.camel:camel-jackson:4.22.0Then give the file to CIC with --dependencies:
--dependencies datastore://filename.txtfor a file in Wanaku Barn.--dependencies file:///path/to/filename.txtfor a local file, for example a file from Git initialization.
To use more Maven repositories, set --repositories to a comma-separated list of repository URLs.
Load routes
CIC gets the route files in one of these ways:
- From a service catalog in Wanaku Barn. A catalog contains the routes and the dependencies in one versioned artifact. This is the recommended way. See Service catalogs.
- From the Wanaku Barn data store, with
datastore://references. - From a Git repository, with
--init-from. CIC clones the repository when it starts. - From a local file, with
file://references. In Kubernetes, mount the files from a ConfigMap or a persistent volume, or clone them with an init container.
--registration-url sets the base URL of Wanaku Barn for datastore:// references and service catalogs.
Load routes from a service catalog
java -jar camel-integration-capability-main-*-jar-with-dependencies.jar \
--registration-url http://localhost:8180 \
--name employee-system \
--service-catalog employee-system-v2 \
--service-catalog-system employee-system--service-catalog cannot be used with --routes-ref or --dependencies. CIC gets all the resources from the catalog.
Load routes from the data store
java -jar camel-integration-capability-main-*-jar-with-dependencies.jar \
--registration-url http://localhost:8180 \
--name camel-core \
--routes-ref datastore://promote-employee.camel.yaml \
--dependencies datastore://promote-employee-dependencies.txt \
--data-dir /tmp/camel-dataLoad routes from Git
java -jar camel-integration-capability-main-*-jar-with-dependencies.jar \
--name camel-core \
--init-from git@github.com:wanaku-ai/wanaku-recipes.git \
--routes-ref file:///tmp/cloned-repo/routes/promote-employee.camel.yaml \
--dependencies file:///tmp/cloned-repo/dependencies/promote-employee-dependencies.txt \
--data-dir /tmpNext steps
- Service catalogs: package routes and dependencies as one versioned artifact.
- CLI reference: all the options of CIC.
- Deploy on Kubernetes: run CIC with the Wanaku Operator.