by punitarani
Google Flights MCP and Python Library
# Add to your Claude Code skills
git clone https://github.com/punitarani/fliGuides for using mcp servers skills like fli.
Last scanned: 4/24/2026
{
"issues": [],
"status": "PASSED",
"scannedAt": "2026-04-24T06:11:57.544Z",
"semgrepRan": false,
"npmAuditRan": true,
"pipAuditRan": true
}A powerful Python library that provides programmatic access to Google Flights data with an elegant CLI interface. Search flights, find the best deals, and filter results with ease.
🚀 What makes
flispecial? Unlike other flight search libraries that rely on web scraping, Fli directly interacts with Google Flights' API through reverse engineering. This means:
- Fast: Direct API access means faster, more reliable results
- Zero Scraping: No HTML parsing, no browser automation, just pure API interaction
- Reliable: Less prone to breaking from UI changes
- Modular: Extensible architecture for easy customization and integration
pipx install flights
# Run the MCP server on STDIO
fli-mcp
# Run the MCP server over HTTP (streamable)
fli-mcp-http # serves at http://127.0.0.1:8000/mcp/

{
"mcpServers": {
"fli": {
"command": "/Users/<user>/.local/bin/fli-mcp"
}
}
}
Note: Replace
<user>with your actual username. You can also find the path to the MCP server by runningwhich fli-mcpin your terminal.
The MCP server provides two main tools:
| Tool | Description | |----------------------|-------------------------------------------------------------| | | Search for flights on a specific date with detailed filters | | | Find the cheapest travel dates across a flexible date range |
No comments yet. Be the first to share your thoughts!
Top skills in this category by stars
search_flightssearch_datessearch_flights Parameters| Parameter | Type | Description |
|--------------------|--------|-----------------------------------------------------|
| origin | string | Departure airport IATA code (e.g., 'JFK') |
| destination | string | Arrival airport IATA code (e.g., 'LHR') |
| departure_date | string | Travel date in YYYY-MM-DD format |
| return_date | string | Return date for round trips (optional) |
| cabin_class | string | ECONOMY, PREMIUM_ECONOMY, BUSINESS, or FIRST |
| max_stops | string | ANY, NON_STOP, ONE_STOP, or TWO_PLUS_STOPS |
| departure_window | string | Time window in 'HH-HH' format (e.g., '6-20') |
| airlines | list | Filter by airline codes (e.g., ['BA', 'AA']) |
| sort_by | string | CHEAPEST, DURATION, DEPARTURE_TIME, or ARRIVAL_TIME |
| passengers | int | Number of adult passengers |
search_dates Parameters| Parameter | Type | Description |
|--------------------|--------|----------------------------------------------|
| origin | string | Departure airport IATA code (e.g., 'JFK') |
| destination | string | Arrival airport IATA code (e.g., 'LHR') |
| start_date | string | Start of date range in YYYY-MM-DD format |
| end_date | string | End of date range in YYYY-MM-DD format |
| trip_duration | int | Trip duration in days (for round-trips) |
| is_round_trip | bool | Whether to search for round-trip flights |
| cabin_class | string | ECONOMY, PREMIUM_ECONOMY, BUSINESS, or FIRST |
| max_stops | string | ANY, NON_STOP, ONE_STOP, or TWO_PLUS_STOPS |
| departure_window | string | Time window in 'HH-HH' format (e.g., '6-20') |
| airlines | list | Filter by airline codes (e.g., ['BA', 'AA']) |
| sort_by_price | bool | Sort results by price (lowest first) |
| passengers | int | Number of adult passengers |
pip install flights
# Install using pipx (recommended for CLI)
pipx install flights
# Get started with CLI
fli --help

🔍 Powerful Search
💺 Cabin Classes
🎯 Smart Sorting
🛡️ Built-in Protection
# Basic flight search
fli flights JFK LHR 2026-10-25
# Advanced search with filters
fli flights JFK LHR 2026-10-25 \
--time 6-20 \ # Departure time window (6 AM - 8 PM)
--airlines BA,KL \ # Airlines (British Airways, KLM)
--class BUSINESS \ # Cabin class
--stops NON_STOP \ # Non-stop flights only
--sort DURATION # Sort by duration
⚠️ Experimental
--format jsonis experimental. The JSON schema may change while the machine-readable CLI contract settles.# Return machine-readable flight results fli flights JFK LHR 2026-10-25 --format json
# Basic date search
fli dates JFK LHR
# Advanced search with date range
fli dates JFK LHR \
--from 2026-01-01 \
--to 2026-02-01 \
--monday --friday # Only Mondays and Fridays
⚠️ Experimental
--format jsonis experimental for date searches as well.# Return machine-readable date search results fli dates JFK LHR --from 2026-01-01 --to 2026-02-01 --format json
# Two-leg multi-city trip
fli multi --leg SEA,HKG,2026-12-26 --leg PEK,SEA,2027-01-02
# Three-leg multi-city trip with filters
fli multi \
-l SEA,NRT,2026-12-26 \
-l NRT,HKG,2026-12-30 \
-l HKG,SEA,2027-01-05 \
--class BUSINESS \
--stops 0
fli flights)| Option | Description | Example |
|------------------|-----------------------|------------------------|
| --return, -r | Return date | 2026-10-30 |
| --time, -t | Departure time window | 6-20 |
| --airlines, -a | Airline IATA codes | BA,KL |
| --class, -c | Cabin class | ECONOMY, BUSINESS |
| --stops, -s | Maximum stops | NON_STOP, ONE_STOP |
| --sort, -o | Sort results by | CHEAPEST, DURATION |
| --format | Output format | text, json |
fli dates)| Option | Description | Example |
|--------------------|------------------------|------------------------|
| --from | Start date | 2026-01-01 |
| --to | End date | 2026-02-01 |
| --duration, -d | Trip duration in days | 3 |
| --round, -R | Round-trip search | (flag) |
| --airlines, -a | Airline IATA codes | BA,KL |
| --class, -c | Cabin class | ECONOMY, BUSINESS |
| --stops, -s | Maximum stops | NON_STOP, ONE_STOP |
| --time | Departure time window | 6-20 |
| --sort | Sort by price | (flag) |
| --[day] | Day filters | --monday, --friday |
| --format | Output format | text, json |
fli multi)| Option | Description | Example |
|------------------|--------------------------------------|--------------------------------|
| --leg, -l | Flight leg (ORIGIN,DEST,DATE format) | SEA,HKG,2026-12-26 |
| --time, -t | Departure time window | 6-20 |
| --airlines, -a | Airline IATA codes | DL CX |
| --class, -c | Cabin class | ECONOMY, BUSINESS |
| --stops, -s | Maximum stops | NON_STOP, ONE_STOP |
| --sort, -o | Sort results by | CHEAPEST, DURATION |
Fli includes a Model Context Protocol (MCP) server that allows AI assistants like Claude to search for flights directly. This enables natural language flight search through conversation.
# Run the MCP server on STDIO
fli-mcp
# Or with uv (for development)
uv run fli-mcp
# Or with make (for development)
make mcp
# Run the MCP server over HTTP (streamable)
fli-mcp-http # serves at http://127.0.0.1:8000/mcp/
To use the flight search capabilities in Claude Desktop, add this configuration to your claude_desktop_config.json:
Location: ~/Library/Application Support/Claude/claude_desktop_config.json (macOS)
{
"mcpServers": {
"flight-search": {
"command": "fli-mcp",
"args": []
}
}
}
After adding this configuration:
from datetime import datetime, timedelta
from fli.models import (
Airport,
PassengerInfo,
SeatType,
MaxStops,
SortBy,
FlightSearchFilters,
FlightSegment
)
from fli.search import SearchFligh