- Home
- MCP servers
- Flights
Flights
- python
10
GitHub Stars
python
Language
6 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
You can access flight search capabilities via a dedicated MCP server that talks to the Aviasales Flight Search API. It lets you search flights, filter results, view detailed flight information, and generate booking links, all through structured MCP endpoints that you can call from your client or assistant.
How to use
You can connect to a remote MCP server that exposes flight search capabilities or run a local instance on your own machine. Start by choosing your preferred transport and then call the MCP tools to search, filter, inspect, and book flights.
How to install
Prerequisites you need before installation are the Aviasales API key, Python 3.12 or higher, and the UV package manager.
# 1) Clone the project
git clone <repository-url>
cd flights-mcp
# 2) Set environment variables (adjust values below)
export FLIGHTS_AVIASALES_API_TOKEN=YOUR_API_TOKEN
export FLIGHTS_AVIASALES_MARKER=YOUR_MARKER_ID
export FLIGHTS_TRANSPORT=stdio
export FLIGHTS_HTTP_PORT=4200
export FLIGHTS_HTTP_PATH=/mcp
# 3) Run the server locally
uv run src/flights-mcp/main.py
```} ,{
Configuration and runtime notes
The server requires the following environment variables to operate: an Aviasales API token and a marker ID. You can also configure the transport protocol (stdio, streamable_http, or SSE) and the HTTP port/path used when using HTTP/SSE transports.
Local storage is used to save performed searches so you can access past results without repeating requests.
MCP transport and endpoints
Two MCP connection methods are exposed: a remote HTTP/SSE endpoint you can call directly, and a local stdio server you run on your machine.
Typical usage pattern
- Search for flights with search_flights using flexible dates. 2) Browse and filter results with get_flight_options. 3) Retrieve detailed information with get_flight_option_details for user-selected options. 4) Generate a booking link with request_booking_link when the user decides to book.
Security and notes
Keep your Aviasales API key and marker ID secure. Only expose the MCP endpoints to trusted clients, especially if you are using HTTP transport. Adjust transport settings to SSE or stdio if your client ecosystem has limitations.
Available tools
search_flights
Searches for flights using the Aviasales Flight Search API and returns a search_id and a summary of options.
get_flight_options
Retrieves, filters, and sorts flight options from a previous search, returning a paginated list.
get_flight_option_details
Provides detailed information about a specific flight option, including segments, pricing, and terms.
request_booking_link
Generates a booking link for a selected flight option.