Skip to main content

flights-mcp

A flight-reconnaissance MCP server with one provider, one key, no KYC.

  • Search flights with full pricing, every segment, every carrier, every layover
  • Per-day price calendar (cheapest dates)
  • Layover-quality scoring (connection-time risk, terminal change, overnight, airport reputation)
  • Weighted multi-criteria ranking → "find the optimal flight path"
  • Airport autocomplete

The one API you need

Provider Free tier Signup
RapidAPI Sky-Scrapper 100 requests / month https://rapidapi.com/apiheya/api/sky-scrapper

Steps:

  1. Sign up at https://rapidapi.com/auth/sign-up (just email).
  2. Visit https://rapidapi.com/apiheya/api/sky-scrapper and click Subscribe to Test.
  3. Pick the Basic (Free) plan — no card required.
  4. Copy X-RapidAPI-Key from the code-snippets panel.

Quick start

git clone <repo> flights-mcp
cd flights-mcp
python -m venv .venv
.venv\Scripts\activate
pip install -e .
copy .env.example .env
# open .env and paste your RAPIDAPI_KEY
python -m flights_mcp                       # stdio MCP server

Wire it into your MCP client

Claude Desktop

Edit claude_desktop_config.json (macOS: ~/Library/Application Support/Claude/; Windows: %APPDATA%\Claude\):

{
  "mcpServers": {
    "flights": {
      "command": "python",
      "args": ["-m", "flights_mcp"],
      "env": {
        "PYTHONPATH": "C:/path/to/flights-mcp/src",
        "RAPIDAPI_KEY": "your_rapidapi_key_here"
      }
    }
  }
}

Full example: examples/claude_desktop_config.json.

Cursor / Continue / Cline / generic MCP clients

Most clients accept the mcp.json form. The ${RAPIDAPI_KEY} placeholder there is not a real key — the client substitutes it from your shell env or its secret store at launch. Real keys live in .env (gitignored) or your client's secret store.

Tools

Tool Purpose
search_airports City/airport → IATA, name, country
search_flights Search w/ full segments, carriers, durations, layovers, prices
cheapest_dates Per-day price calendar across upcoming dates
analyze_layovers Score each layover: MCT, terminal change, overnight, airport quality
rank_options Multi-criteria weighted scoring on a set of offer IDs
find_optimal_path One-shot: search + rank + return top N with rationale
compare_offers Side-by-side comparison table

Ranking model

Each criterion is normalised to [0, 1] across the candidate set (1 = best), then combined with caller-tunable weights:

Criterion Default Meaning
price 0.40 Lower total → higher score
duration 0.25 Shorter total travel time → higher
stops 0.15 Non-stop > 1 stop > 2 stops
layover_quality 0.15 Connection time, terminal change, overnight, airport reputation
seat_quality 0.05 Best-effort: cabin class signal from search results

Override per call:

find_optimal_path(
  origin="SFO", destination="SIN", departure_date="2026-07-04",
  weight_price=0.10, weight_layover_quality=0.40, weight_duration=0.30
)

Weights are auto-normalised, so any positive numbers work.

Layover heuristics

analyze_layovers and the layover_quality criterion penalise:

Connection length Penalty
< 45 min heavy — below most carriers' Minimum Connection Time
45–60 min moderate (tight)
60–180 min none (sweet spot)
180–360 min small (long wait)
> 360 min moderate (very long)

Plus penalty for overnight and terminal-change layovers. Small bonus for premium hubs (SIN, HKG, ICN, DOH, DXB, ZRH, AMS, CPH, HEL, MUC, FRA, ATL…); small penalty for delay-prone hubs (EWR, LGA, ORD, PHL, MIA, FCO, MAD).

Project layout

flights-mcp/
├── README.md
├── mcp.json                       # MCP manifest — env-var placeholders only
├── pyproject.toml
├── .env.example                   # one signup URL, one key
├── src/flights_mcp/
│   ├── __main__.py                # python -m flights_mcp
│   ├── server.py                  # FastMCP server, 7 tools
│   ├── config.py
│   ├── models.py                  # Airport / FlightOffer / Itinerary / Segment / Layover
│   ├── ranking.py                 # weighted multi-criteria scoring
│   ├── cache.py
│   └── providers/
│       ├── base.py
│       └── rapidapi.py            # Sky-Scrapper client + normaliser
├── examples/
│   ├── claude_desktop_config.json
│   └── sample_queries.md
└── tests/test_ranking.py

Development

pip install -e ".[dev]"
$env:PYTHONPATH = "src"
pytest                                       # Windows PowerShell
# PYTHONPATH=src pytest                      # macOS / Linux
python tests\_live_smoke.py                  # live RapidAPI call (uses one quota credit)

Security note

API keys live in .env (gitignored) or your MCP client's secret store. The mcp.json in this repo contains only ${VAR_NAME} placeholders — never literal keys.

License

MIT.

Metadata

Release files for flight-recon-mcp 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for flight-recon-mcp 0.1.1
File Size Uploaded
flight_recon_mcp-0.1.1.tar.gz 21.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for flight-recon-mcp 0.1.1
File Interpreter ABI Platform
flight_recon_mcp-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 45.9 kB

Release files / flight_recon_mcp-0.1.1.tar.gz

Download URL flight_recon_mcp-0.1.1.tar.gz
Size 21.5 kB
Tags Source
SHA-256 checksum
How to use checksums
e456b3206a92a232980f47beb86f22e07f5ee6528a12ef002f441960cf689811
BLAKE2b-256 checksum
How to use checksums
a265cbb277a462fe98fa66707add62480a05adc67cd67b2abd238e08d344adf6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.9

Release files / flight_recon_mcp-0.1.1-py3-none-any.whl

Download URL flight_recon_mcp-0.1.1-py3-none-any.whl
Size 24.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
089a7b8f801bd663927f1a8c0d3c2436495d092810938db23819cdcb449fac12
BLAKE2b-256 checksum
How to use checksums
c81135ceea4cac05c13c0f68f09a582a9a60752398551fde247a2840e8c14d59
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.9

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page