The XTravels Sample for AI
The XTravels sample demonstrates how to integrate and use multiple MCP services and CAP-level agents in a cohesive travel booking scenario.
Overview
The XTravels sample provides a more comprehensive example of how to work with several MCP services. It comprises the following CAP services:
EventsService: to browse and book business or leisure events.HotelsService: to browse and book hotel accommodations.FlightsService: to browse airports, airlines and flights.TravelsAgentService: an MCP service for managing travel agent interactions.
Workspace Setup
To set up the workspace for the XTravels sample, follow these steps:
- Create a root directory to clone the samples into, e.g.
cap/samples:
mkdir -p cap/samples
cd cap/samples- Clone the individual sample repositories:
git clone https://github.com/capire/xtravels
git clone https://github.com/capire/xflights
git clone https://github.com/capire/common
git clone https://github.com/capire/s4- Add a
package.jsonfile to define the workspaces:
echo '{"workspaces":["*","*/apis/*"]}' > package.json- Install the necessary dependencies:
npm installThis will install all the dependencies, with the cloned sample repositories linked locally.
Run all-in-one
cds watch xtravelsUse in OpenCode
opencodeEnter a prompt, such as:
Plan a trip to sapphire 27 for Anne Pratt flying from FrankfurtYou should see something like this:


Run as separate services
If you like you can also start the individual services separately in different terminals as shown below – no code or config changes required for that, and also no change to the usage in AI chat clients.
Run each of the lines below in a separate terminal:
cds w xtravels/srv/events
cds w xtravels/srv/hotels
cds w s4
cds w xflights
cds w xtravels
opencode