Context7
Feeds AI the latest docs for libraries and frameworks before it answers, so code it writes does not use outdated, removed functions.
Description from the maker (original English)
Flexible multi-leg, multi-airport flight search - cheapest valid combination across an itinerary.
These three are never merged into one score: opinions, measurements and popularity are different things.
We have not written a plain-language summary for this one yet. Below are the facts we read from the registry.
Pick the AI app you use, then copy the settings.
TRAVELPAYOUTS_TOKEN, SERPAPI_KEY, RIHLA_PROFILEValues marked secret are keys to your account. Never share them or paste them into a chat.
You need
Which app do you use?
Pick your app above. We remember it, so next time the button says “Install in …”.
Open Claude Desktop → Settings → Developer → Edit Config, and paste this into claude_desktop_config.json
{
"mcpServers": {
"rihla": {
"command": "uvx",
"args": [
"rihla-mcp"
],
"env": {
"TRAVELPAYOUTS_TOKEN": "your-value",
"SERPAPI_KEY": "your-value",
"RIHLA_PROFILE": "your-value"
}
}
}
}Run this in your terminal
claude mcp add rihla --env TRAVELPAYOUTS_TOKEN=your-value --env SERPAPI_KEY=your-value --env RIHLA_PROFILE=your-value -- uvx rihla-mcpFill in the empty values before running it.
Paste into .cursor/mcp.json in your project, or ~/.cursor/mcp.json
{
"mcpServers": {
"rihla": {
"command": "uvx",
"args": [
"rihla-mcp"
],
"env": {
"TRAVELPAYOUTS_TOKEN": "your-value",
"SERPAPI_KEY": "your-value",
"RIHLA_PROFILE": "your-value"
}
}
}
}Your browser asks to open the app, then the app shows the settings and asks you to confirm. Key values are left empty for you to fill in.
Paste into .vscode/mcp.json in your project
{
"servers": {
"rihla": {
"type": "stdio",
"command": "uvx",
"args": [
"rihla-mcp"
],
"env": {
"TRAVELPAYOUTS_TOKEN": "your-value",
"SERPAPI_KEY": "your-value",
"RIHLA_PROFILE": "your-value"
}
}
}
}Your browser asks to open the app, then the app shows the settings and asks you to confirm. Key values are left empty for you to fill in.
This one runs on your computer, and ChatGPT can only connect to servers on the internet. Pick another app.
Your choice stays on this device in a cookie; no account needed.
RIHLA_PROFILE envThese settings are generated from the maker’s registry entry. If the README says otherwise, follow the README.
Runs on your computer; the tool list appears in your AI app after you install it.
We check information anyone can see; we have not read the code. Checks that do not apply are left out of the count. · Checked Nov 7, 2026
The registry name was verified with the GitHub account leojg, which owns the repo
We have not read this repo from GitHub yet
We have not read this repo from GitHub yet
This one runs on your computer; there is no internet endpoint
Runs on your computer and uses local settings instead
Runs on your computer; we can only read tool lists from internet endpoints
Compared with every active server in this category in the registry. Stars count only when the publisher owns the repo.
It passed 1 of 1 applicable basic checks. We have not read the code. Before adding a key or token, see what access the server asks for and use a key with only the permissions you need.
You need to fill in: TRAVELPAYOUTS_TOKEN, SERPAPI_KEY
It runs on your computer. Your AI app starts it when needed, and data does not pass through the maker’s servers (unless it calls an online service itself).
The GitHub repo last changed –, and the latest version (0.1.0) reached the registry 4 months ago.
Apps that support MCP, such as Claude Desktop, Claude Code, Cursor and VS Code. You also need Python (uv) on your computer.
In the same category: Context7, Codebase Memory, Exa
Servers in the same category from other makers, sorted by stars.
Reading a card:★ GitHub starsiThree pillars: reviews · checks · usageiUpdated = latest version published to the registryi
Feeds AI the latest docs for libraries and frameworks before it answers, so code it writes does not use outdated, removed functions.
Codebase knowledge graph for AI agents — 162 languages, sub-ms queries, 99% fewer tokens.
Connect AI agents to Exa for web search, content fetching, and multi-step research.
Copied from the maker’s repo as written. PopNx MCP has not reviewed or endorsed it. HTML, images and scripts are removed. Links lead off this site.
Rihla (رحلة), *"the journey."* Named for Ibn Battuta's 14th-century travelogue —
the record of history's farthest-traveling explorer, who left Tangier for Mecca and
kept going for 29 years and 75,000 miles.
Flexible multi-leg, multi-airport flight search that finds the cheapest route across an entire itinerary — available as a CLI and as an MCP server for AI agents.
Consumer flight sites price one leg at a time. Rihla treats the whole trip as a single optimization problem:
*"Leave Montevideo — or Buenos Aires, it's a ferry ride away — around September 15
for Europe. Stay 20–30 days, then Japan for 15, then home. What's the cheapest
combination?"*
That query has three legs, flexible airports on both ends of each, a flexible departure window, and stay-duration constraints linking the legs. Rihla prices each leg's date×airport grid once, then finds the cheapest valid combinations in pure local compute — so even a 3–4 leg flexible query costs only a handful of API calls.
1. 1,297 USD (44 days door-to-door)
MVD -> AMS 2026-09-08 $ 383 [mock, cached] AA AA127 FRA -> NRT 2026-10-07 $ 481 [mock, cached] KL KL411 HND -> EZE 2026-10-22 $ 433 [mock, cached] AZ AZ933
Note the airport substitution at work: it enters Europe through Amsterdam, leaves from Frankfurt, and flies home into Buenos Aires — each leg independently picks the cheapest airport pair from its sets.
Requires Python ≥ 3.10.
pip install rihla # CLI
pip install "rihla[mcp]" # CLI + MCP server
Runs offline out of the box (no keys needed — a deterministic mock data source):
RIHLA_PROFILE=mock rihla # the canonical demo trip above
rihla examples/queries/canonical.json # same trip, from a query file rihla -i # build a query interactively
For live prices, copy .env.example to .env and add at least a Travelpayouts token (free). See Data sources.
A query is a small JSON file: your origin airports, the ordered stops, a departure window for the first leg, and how long to stay at each stop. Downstream date windows are derived — you never hand-compute "if I leave Sep 15 and stay 20–30 days, when do I fly to Tokyo?"
{
"origins": ["MVD", "EZE", "AEP"], "stops": ["EUROPE", ["NRT", "HND"], "MVD_AREA"], "earliest": "2026-09-08", "latest": "2026-09-22", "stays": [[20, 30], [15, 15]], "date_step": 3, "top": 5 }
EUROPE (MAD, BCN, LIS, CDG, FCO, AMS, FRA), TOKYO (NRT, HND), MVD_AREA (MVD, EZE, AEP). Make the last stop your origin set to fly home.[min, max] nights at each intermediate stop (len(stays) == len(stops) - 1).USD).rihla -i walks you through these questions and prints the resulting JSON to save for reuse. Add --links to any run to show booking URLs.
Rihla is honest about data quality rather than pretending everything is bookable:
cached when the price is indicative (Travelpayouts data is aggregated search history, not a live fare) versus a real, bookable fare (SerpApi / Google Flights).Ranking is price-only in v0.1. Open-jaw within a region is allowed by default (enter Europe at one city, leave from another); the cost of repositioning inside the region is not modeled.
| Source | Role | Cost | Notes |
|---|---|---|---|
| Travelpayouts / Aviasales | Primary | Free | Cached, redistribution-licensed. A month of prices per call, so the call budget stays tiny. Prices indicative; coverage follows route popularity. |
| SerpApi (Google Flights) | Fill | 250 free searches/mo (BYO key) | Real bookable fares; fills routes Travelpayouts misses. Only spent on uncovered routes. |
| Mock | Offline | — | Deterministic fake prices for development and demos. |
Configure via .env (see .env.example) or environment variables: TRAVELPAYOUTS_TOKEN, SERPAPI_KEY, and RIHLA_PROFILE:
local (default) — every source whose key is set, including SerpApi.hosted — redistribution-licensed sources only (SerpApi disabled: it scrapes Google, so do not serve it from a public hosted instance).mock — force the offline fetcher, no network.With no keys set, Rihla falls back to the mock source and says so.
Rihla ships an MCP server (stdio) so agents like Claude can run trip searches:
pip install "rihla[mcp]"
claude mcp add rihla -- rihla-mcp # Claude Code
or in any MCP client config:
{
"mcpServers": { "rihla": { "command": "rihla-mcp", "env": { "TRAVELPAYOUTS_TOKEN": "your-token", "SERPAPI_KEY": "your-key" } } } }
(The server also loads a .env from its working directory, so env is optional if you run it from a checkout.)
It exposes two read-only tools with an enforced etiquette:
mcp-name: io.github.leojg/rihla
Leg prices are independent — the MVD→Europe fare doesn't depend on the Tokyo dates. So Rihla fetches each leg's date×airport grid once, then enumerates valid date combinations (respecting the stay constraints) entirely in memory. The combinatorial explosion lives in local compute, not in API calls.
core.py data model + the pure optimizer (no I/O)
fetchers/ PriceFetcher protocol: Mock / Travelpayouts / SerpApi + merge places.py airport sets / regions api.py search_trip: serializable query in, result dict out cli.py thin CLI over search_trip mcp_server.py thin MCP wrapper over the same seam
Adding a data source (Duffel, Kiwi, …) is one more class implementing a one-method protocol: quote(origin, dest, day) -> Quote.
Scope (v0.1): flight search only — no lodging, no booking or payments, single adult, one cabin. Search returns booking links, never handles the transaction.
git clone https://github.com/leojg/rihla && cd rihla
pip install -e ".[dev,mcp]" pytest # offline, no keys needed ruff check .
Licensed under the Apache License 2.0 — see LICENSE.