fli
Provides search functionality for Google Flights, allowing users to search for flights, find cheapest dates, and filter by various criteria such as airlines, cabin class, stops, alliances, etc.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@flifind cheapest flights from JFK to LHR next week"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
š« Fli - Flight Search MCP Server and Library
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
MCP Server
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/
Connecting to Claude Desktop
{
"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.
MCP Tools Available
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 |
search_flights Parameters
Parameter | Type | Description |
| string | Departure airport IATA code(s) ā comma-separated for multi |
| string | Arrival airport IATA code(s) ā comma-separated for multi |
| string | Travel date in YYYY-MM-DD format |
| string | Return date for round trips (optional) |
| string | ECONOMY, PREMIUM_ECONOMY, BUSINESS, or FIRST |
| string | ANY, NON_STOP, ONE_STOP, or TWO_PLUS_STOPS |
| string | Time window in 'HH-HH' format (e.g., '6-20') |
| list | Filter by airline codes (e.g., ['BA', 'AA']) |
| list | Airline IATA codes to exclude (e.g., ['DL', 'B6']) |
| list | Restrict to alliances: ONEWORLD, SKYTEAM, STAR_ALLIANCE |
| list | Alliance names to exclude from results |
| int | Minimum layover duration in minutes (multi-stop only) |
| int | Maximum layover duration in minutes (multi-stop only) |
| string | ISO 4217 code (e.g. 'EUR', 'JPY') ā flows to |
| string | BCP-47 language code (e.g. 'en-GB') ā flows to |
| string | ISO 3166-1 alpha-2 country code (e.g. 'GB') for |
| string | CHEAPEST, DURATION, DEPARTURE_TIME, or ARRIVAL_TIME |
| int | Number of adult passengers |
search_dates Parameters
Parameter | Type | Description |
| string | Departure airport IATA code(s) ā comma-separated for multi |
| string | Arrival airport IATA code(s) ā comma-separated for multi |
| string | Start of date range in YYYY-MM-DD format |
| string | End of date range in YYYY-MM-DD format |
| int | Trip duration in days (for round-trips) |
| bool | Whether to search for round-trip flights |
| string | ECONOMY, PREMIUM_ECONOMY, BUSINESS, or FIRST |
| string | ANY, NON_STOP, ONE_STOP, or TWO_PLUS_STOPS |
| string | Time window in 'HH-HH' format (e.g., '6-20') |
| list | Filter by airline codes (e.g., ['BA', 'AA']) |
| list | Airline IATA codes to exclude |
| list | Restrict to alliances: ONEWORLD, SKYTEAM, STAR_ALLIANCE |
| list | Alliance names to exclude |
| int | Minimum layover duration in minutes |
| int | Maximum layover duration in minutes |
| string | ISO 4217 currency code (e.g. 'EUR', 'JPY') |
| string | BCP-47 language code (e.g. 'en-GB') |
| string | ISO 3166-1 alpha-2 country code (e.g. 'GB') |
| bool | Sort results by price (lowest first) |
| int | Number of adult passengers |
Quick Start
pip install flights# Install using pipx (recommended for CLI)
pipx install flights
# Get started with CLI
fli --help
Features
š Powerful Search
One-way flight searches
Multi-city flight searches
Flexible departure times
Multi-airline support
Cabin class selection
Stop preferences
Custom result sorting
šŗ Cabin Classes
Economy
Premium Economy
Business
First
šÆ Smart Sorting
Price
Duration
Departure Time
Arrival Time
š”ļø Built-in Protection
Rate limiting
Automatic retries
Comprehensive error handling
Input validation
CLI Usage
Search for Flights
# 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
# Alliance + exclude + locale (May-2026 filter additions)
fli flights JFK LHR 2026-10-25 \
--alliance ONEWORLD \
--exclude-airlines AA \
--min-layover 90 \
--max-layover 360 \
--currency EUR --language en-GB --country GBā ļø 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
Find Cheapest Dates
# 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
Multi-city Search
# 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 0CLI Options
Flights Command (fli flights)
Option | Description | Example |
| Return date |
|
| Departure time window |
|
| Airline IATA codes |
|
| Airline IATA codes to exclude |
|
| Restrict to alliance(s) |
|
| Alliance(s) to exclude |
|
| Minimum layover (minutes) |
|
| Maximum layover (minutes) |
|
| ISO 4217 currency code |
|
| BCP-47 language code (Google |
|
| ISO 3166-1 alpha-2 country ( |
|
| Cabin class |
|
| Maximum stops |
|
| Sort results by |
|
| Output format |
|
Dates Command (fli dates)
Option | Description | Example |
| Start date |
|
| End date |
|
| Trip duration in days |
|
| Round-trip search | (flag) |
| Airline IATA codes |
|
| Airline IATA codes to exclude |
|
| Restrict to alliance(s) |
|
| Alliance(s) to exclude |
|
| Minimum layover (minutes) |
|
| Maximum layover (minutes) |
|
| ISO 4217 currency code |
|
| BCP-47 language code |
|
| ISO 3166-1 alpha-2 country |
|
| Cabin class |
|
| Maximum stops |
|
| Departure time window |
|
| Sort by price | (flag) |
| Day filters |
|
| Output format |
|
Multi Command (fli multi)
Option | Description | Example |
| Flight leg (ORIGIN,DEST,DATE format) |
|
| Departure time window |
|
| Airline IATA codes |
|
| Cabin class |
|
| Maximum stops |
|
| Sort results by |
|
MCP Server Integration
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.
Running the MCP Server
# 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/Claude Desktop Configuration
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:
Restart Claude Desktop
You can now ask Claude to search for flights naturally:
"Find flights from JFK to LAX on December 25th"
"What are the cheapest dates to fly from NYC to London in January?"
"Search for business class flights from SFO to NRT with no stops"
Python API Usage
Basic Search Example
from datetime import datetime, timedelta
from fli.models import (
Airport,
PassengerInfo,
SeatType,
MaxStops,
SortBy,
FlightSearchFilters,
FlightSegment
)
from fli.search import SearchFlights
# Create search filters
filters = FlightSearchFilters(
passenger_info=PassengerInfo(adults=1),
flight_segments=[
FlightSegment(
departure_airport=[[Airport.JFK, 0]],
arrival_airport=[[Airport.LAX, 0]],
travel_date=(datetime.now() + timedelta(days=30)).strftime("%Y-%m-%d"),
)
],
seat_type=SeatType.ECONOMY,
stops=MaxStops.NON_STOP,
sort_by=SortBy.CHEAPEST,
)
# Search flights
search = SearchFlights()
flights = search.search(filters)
# Process results
for flight in flights:
print(f"š° Price: ${flight.price}")
print(f"ā±ļø Duration: {flight.duration} minutes")
print(f"āļø Stops: {flight.stops}")
for leg in flight.legs:
print(f"\nš« Flight: {leg.airline.value} {leg.flight_number}")
print(f"š From: {leg.departure_airport.value} at {leg.departure_datetime}")
print(f"š To: {leg.arrival_airport.value} at {leg.arrival_datetime}")Running Examples
Runnable examples live in examples/python/:
# Run examples with uv (recommended)
uv run python examples/python/basic_one_way_search.py
uv run python examples/python/round_trip_search.py
uv run python examples/python/date_range_search.py
# Or install dependencies first, then run directly
pip install pydantic curl_cffi httpx
python examples/python/basic_one_way_search.pyAvailable Examples:
basic_one_way_search.py- Simple one-way flight searchround_trip_search.py- Round-trip flight bookingdate_range_search.py- Find cheapest datesmulti_city_search.py- Multi-city itinerary across several legsadvanced_filters_search.py- Alliances, airline exclusions, layovers, localecomplex_flight_search.py- Advanced filtering and multi-passengertime_restrictions_search.py- Time-based filteringdate_search_with_preferences.py- Weekend filteringprice_tracking.py- Price monitoring over timeerror_handling_with_retries.py- Robust error handlingresult_processing.py- Data analysis with pandascomplex_round_trip_validation.py- Advanced round-trip with validationadvanced_date_search_validation.py- Complex date search with filtering
Examples
Examples are organized by language, with parallel scripts so you can compare the two APIs:
Python ā
examples/python/TypeScript ā
examples/typescript/
# Python
uv run python examples/python/complex_flight_search.py
# TypeScript (from examples/typescript, after `bun install`)
bun run multi_city_search.tsExample Categories:
Basic Usage: One-way, round-trip, date searches
Advanced Filtering: Time restrictions, airlines, alliances, seat classes, locale
Data Analysis: Price tracking, result processing with pandas
Error Handling: Retry logic, robust error management
Complex Scenarios: Multi-city, multi-passenger, validation, business rules
Each example is self-contained ā change the airports, dates, and filters at the top of the script to fit your search.
TypeScript / JavaScript
Fli is also available as a 1:1 TypeScript port, published to npm as
fli-js. Same models, same filter encoding,
same direct-API approach.
bun add fli-js # or: npm install fli-jsimport { Airport, FlightSearchFilters, FlightSegment, SearchFlights, SeatType } from "fli-js";
const inDays = (n: number) => new Date(Date.now() + n * 86_400_000).toISOString().slice(0, 10);
const filters = new FlightSearchFilters({
passenger_info: { adults: 1, children: 0, infants_in_seat: 0, infants_on_lap: 0 },
flight_segments: [
new FlightSegment({
departure_airport: [[[Airport.JFK, 0]]],
arrival_airport: [[[Airport.LAX, 0]]],
travel_date: inDays(30),
}),
],
seat_type: SeatType.ECONOMY,
});
const results = await new SearchFlights().search(filters, { currency: "USD" });The TypeScript source lives in fli-js/; see the
TypeScript Quick Start
for the full guide.
Development
# Clone the repository
git clone https://github.com/punitarani/fli.git
cd fli
# Install dependencies with uv
uv sync --all-extras
# Run tests
uv run pytest
# Run linting
uv run ruff check .
uv run ruff format .
# Build documentation
uv run mkdocs serve
# Or use the Makefile for common tasks
make install-all # Install all dependencies
make test # Run tests
make lint # Check code style
make format # Format codeDocker Development
# Build the devcontainer
docker build -t fli-dev -f .devcontainer/Dockerfile .
# Run CI inside the container
docker run --rm fli-dev make lint test-all
# Or run lint and tests separately
docker run --rm fli-dev make lint
docker run --rm fli-dev make test-allRunning CI Locally with act
To run GitHub Actions locally, install act:
brew install act
# Run CI locally (lint + tests on Python 3.10-3.13)
make ci
# Or run CI inside Docker (no local act installation needed)
make ci-dockerContributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the MIT License ā see the LICENSE file for details.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/punitarani/fli'
If you have feedback or need assistance with the MCP directory API, please join our Discord server