Airsc miễn phí cho tất cả. Nếu nó giúp bạn, hãy ủng hộ $2–$20.

Ủng hộ
MCP serverAn toànKết nối & tự động hoáDễ cho người mới

fli

punitarani · punitarani/fli

Máy chủ MCP và thư viện Python này cung cấp quyền truy cập lập trình vào dữ liệu Google Flights để tìm kiếm chuyến bay và ưu đãi.

MCP, CLI và Thư viện Python của Google Flights

3.2k sao401Giấy phép: MITCập nhật 28 ngày trước0 lượt mở

Xem kết quả thực tế

Kết quả tìm kiếm chuyến bay từ SFO đến ONT hiển thị trên terminal

Ảnh từ README của tác giảKết quả tìm kiếm chuyến bay từ SFO đến ONT hiển thị trên terminal

Ảnh từ README của tác giả punitarani ·Nguồn

Bạn có thể làm gì với nó

  • Tìm ngày bay rẻ nhất cho một khoảng thời gian du lịch linh hoạt.
  • Tìm kiếm chuyến bay với các bộ lọc cụ thể như ngày và hãng hàng không.
  • Xây dựng tác nhân lập kế hoạch du lịch tùy chỉnh bằng dữ liệu Google Flights.

Kiểm tra an toàn

An toàn

Không thấy dấu hiệu rủi ro trong các file đã quét.

Quét tự động các file trong repo. Luôn xem lại code trước khi chạy.

Trích từ README

🛫 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 fli special? 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 running which fli-mcp in your terminal.

MCP Tools Available

The MCP server provides two main tools:

ToolDescription
search_flightsSearch for flights on a specific date with detailed filters
search_datesFind the cheapest travel dates across a flexible date range

search_flights Parameters

ParameterTypeDescription
originstringDeparture airport IATA code(s) — comma-separated for multi
destinationstringArrival airport IATA code(s) — comma-separated for multi
departure_datestringTravel date in YYYY-MM-DD format
return_datestringReturn date for round trips (optional)
cabin_classstringECONOMY, PREMIUM_ECONOMY, BUSINESS, or FIRST
max_stopsstringANY, NON_STOP, ONE_STOP, or TWO_PLUS_STOPS
departure_windowstringTime window in 'HH-HH' format (e.g., '6-20')
airlineslistFilter by airline codes (e.g., ['BA', 'AA'])
exclude_airlineslistAirline IATA codes to exclude (e.g., ['DL', 'B6'])
alliancelistRestrict to alliances: ONEWORLD, SKYTEAM, STAR_ALLIANCE
exclude_alliancelistAlliance names to exclude from results
min_layoverintMinimum layover duration in minutes (multi-stop only)
max_layoverintMaximum layover duration in minutes (multi-stop only)
top_nintRound-trip only: outbound options expanded into return flights (default 5, 1-10)
currencystringISO 4217 code (e.g. 'EUR', 'JPY') — flows to curr= param
languagestringBCP-47 language code (e.g. 'en-GB') — flows to hl= param
countrystringISO 3166-1 alpha-2 country code (e.g. 'GB') for gl= param
sort_bystringCHEAPEST, DURATION, DEPARTURE_TIME, or ARRIVAL_TIME
passengersintNumber of adult passengers
childrenintNumber of children (ages 2-11)
infants_in_seatintNumber of infants (under 2) occupying their own seat
infants_on_lapintNumber of lap infants (under 2, no seat)

Total travelers (passengers + children + infants_in_seat + infants_on_lap) must be between 1 and 9, and infants_on_lap cannot exceed passengers.

A round trip costs 1 + top_n page fetches (one outbound search, plus one per outbound candidate expanded into return flights), so top_n is capped at 10. Round-trip results all from one airline? Raise top_n, or sort differently — the default sort only ever expands the cheapest top_n outbounds, which are often the same carrier.

search_dates Parameters

ParameterTypeDescription
originstringDeparture airport IATA code(s) — comma-separated for multi
destinationstringArrival airport IATA code(s) — comma-separated for multi
start_datestringStart of date range in YYYY-MM-DD format
end_datestringEnd of date range in YYYY-MM-DD format
trip_durationintTrip duration in days (for round-trips)
is_round_tripboolWhether to search for round-trip flights
cabin_classstringECONOMY, PREMIUM_ECONOMY, BUSINESS, or FIRST
max_stopsstringANY, NON_STOP, ONE_STOP, or TWO_PLUS_STOPS
departure_windowstringTime window in 'HH-HH' format (e.g., '6-20')
airlineslistFilter by airline codes (e.g., ['BA', 'AA'])
exclude_airlineslistAirline IATA codes to exclude
alliancelistRestrict to alliances: ONEWORLD, SKYTEAM, STAR_ALLIANCE
exclude_alliancelistAlliance names to exclude
min_layoverintMinimum layover duration in minutes
Xem mã nguồn trên GitHub