Flyan

io.github.victorlane由 GitHub 账号 victorlane 发布v0.4.4更新于 Oct 24, 2026

Search Ryanair flights from your AI agent. Unofficial.

概览

AI 生成的概览

非官方 MCP 服务器,让助手用自然语言搜索瑞安航空单程票价、可达目的地和最便宜出行日期。

可以做什么
  • 按出发机场、目的地机场或国家、日期范围、价格上限和出发时段搜索单程航班
  • 查询从某机场出发在指定价格以内能飞往哪里
  • 探索从某机场可达的目的地,并按国家或地区分组
  • 查询某条航线在一个月内最便宜的一天
  • 价格默认以欧元返回,也可配置为其他货币
适用场景
适合让助手回答瑞安航空票价问题,例如八月从都柏林飞西班牙的便宜航班,或某条航线最便宜的出行日,无需打开浏览器。
运行要求
以 Python 包形式本地运行,通过 uv 或 pipx 安装后提供 flyan-mcp 命令并写入 MCP 客户端配置。无需 API 密钥或账号。需要能访问瑞安航空接口的网络。可选环境变量 FLYAN_CURRENCY 用于设置计价货币。
安装前请注意
非官方项目,与瑞安航空无关联;README 提示自行承担风险并遵守瑞安航空服务条款。仅读取票价数据,不进行预订。票价为抽样结果,可能不完整或变动,未知货币代码会静默回退为欧元。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Flyan,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

Flyan SDK

[PyPI version] [Python versions] [CI] [CodeQL] [PyPI downloads] [License]

An open-source unofficial API wrapper to get flight data from Ryanair.

[!TIP] New: MCP server for AI agents. Plug Flyan into Claude Desktop, Claude Code, or Cursor and search Ryanair flights in natural language. Jump to the MCP Quickstart.

Contents

Installation

bash
pip install Flyan

Or using uv:

bash
uv add Flyan

Quick Start

python
from datetime import datetimefrom flyan import RyanAir, FlightSearchParams
# Initialize the clientclient = RyanAir(currency="EUR")
# Set up search parameterssearch_params = FlightSearchParams(    from_airport="DUB",  # Dublin    to_airport="BCN",    # Barcelona    from_date=datetime(2025, 8, 15),    to_date=datetime(2025, 8, 20),    max_price=200)
# Search for one-way flightsflights = client.get_oneways(search_params)
# Display resultsfor flight in flights:    print(f"Flight {flight.flight_number}: {flight.departure_airport.name} → {flight.arrival_airport.name}")    print(f"Departure: {flight.departure_date}")    print(f"Price: {flight.price} {flight.currency}")    print("---")

API Reference

RyanAir Class

Constructor
python
RyanAir(currency: str = "EUR")

Creates a new RyanAir client instance.

Parameters:

  • currency (str, optional): Preferred currency for pricing. Defaults to "EUR". Must be a valid currency code from the supported currencies list.

Example:

python
# Default EUR currencyclient = RyanAir()
# Specific currencyclient = RyanAir(currency="USD")
Methods
get_oneways(params: FlightSearchParams) -> list[Flight]

Search for one-way flights.

Parameters:

  • params (FlightSearchParams): Search parameters

Returns:

  • list[Flight]: List of available flights

FlightSearchParams Class

Parameters for searching flights.

python
FlightSearchParams(    from_airport: str,    from_date: datetime,    to_date: datetime,    destination_country: Optional[str] = None,    max_price: Optional[int] = None,    to_airport: Optional[str] = None,    departure_time_from: Optional[str] = "00:00",    departure_time_to: Optional[str] = "23:59")

Parameters:

  • from_airport (str): IATA code of departure airport (e.g., "DUB")
  • from_date (datetime): Earliest departure date
  • to_date (datetime): Latest departure date
  • destination_country (str, optional): Country code for destination
  • max_price (int, optional): Maximum price filter
  • to_airport (str, optional): IATA code of arrival airport
  • departure_time_from (str, optional): Earliest departure time (HH:MM format)
  • departure_time_to (str, optional): Latest departure time (HH:MM format)

Example:

python
from datetime import datetime
params = FlightSearchParams(    from_airport="DUB",    from_date=datetime(2025, 8, 15),    to_date=datetime(2025, 8, 20),    to_airport="BCN",    max_price=150,    departure_time_from="08:00",    departure_time_to="18:00")

ReturnFlightSearchParams Class

Extended parameters for return flight searches.

python
ReturnFlightSearchParams(    # All FlightSearchParams fields plus:    return_date_from: datetime,    return_date_to: datetime,    inbound_departure_time_from: Optional[str] = "00:00",    inbound_departure_time_to: Optional[str] = "23:59")

Data Models

Flight

Represents a single flight.

Attributes:

  • departure_airport (Airport): Departure airport information
  • arrival_airport (Airport): Arrival airport information
  • departure_date (datetime): Departure date and time
  • arrival_date (datetime): Arrival date and time
  • price (float): Flight price
  • currency (str): Price currency
  • flight_key (str): Unique flight identifier
  • flight_number (str): Flight number
  • previous_price (Optional[str | float]): Previous price if available

Airport

Represents airport information.

Attributes:

  • country_name (str): Country name
  • iata_code (str): IATA airport code
  • name (str): Airport name
  • seo_name (str): SEO-friendly name
  • city_name (str): City name
  • city_code (str): City code
  • city_country_code (str): Country code

ReturnFlight

Represents a return flight booking.

Attributes:

  • outbound (Flight): Outbound flight
  • inbound (Flight): Return flight
  • summary_price (float): Total price for both flights
  • summary_currency (str): Currency for total price
  • previous_price (str | float): Previous total price if available

NetworkAirport

Represents an airport in Ryanair's live network. Returned by the explore methods.

Attributes:

  • iata_code (str): IATA airport code
  • name (str): Airport name
  • seo_name (str): SEO-friendly name
  • country_code (str): Lowercase ISO2 country code (e.g. "ie", "es")
  • city_code (str): City code (e.g. "LONDON", "DUBLIN")
  • region_code (Optional[str]): Region code (e.g. "SCOTLAND", "ANDALUSIA")
  • currency_code (str): Local currency code
  • time_zone (str): IANA timezone (e.g. "Europe/Dublin")
  • base (bool): True if this is a Ryanair base
  • latitude (float), longitude (float): Coordinates
  • routes (list[str]): Raw route strings (year-round)
  • seasonal_routes (list[str]): Raw route strings (seasonal-only)
  • categories (list[str]): Marketing categories assigned by Ryanair
  • aliases (list[str]): Alternative names

Helpers: airport_routes(), country_routes(), seasonal_airport_routes(), typed_routes(), typed_seasonal_routes().

DestinationFare

Returned by explore_with_fares(). Pairs a reachable destination with its cheapest sampled fare, if one was returned by the price probe.

Attributes:

  • airport (NetworkAirport): The destination airport
  • fare (Optional[Flight]): The cheapest sampled fare in the window, or None if the route is in the network but no priced inventory came back (no flights in the window, sold out, etc.)

Examples

Search by Country

python
# Search flights to any airport in Spainparams = FlightSearchParams(    from_airport="DUB",    destination_country="ES",    from_date=datetime(2025, 9, 1),    to_date=datetime(2025, 9, 7))
flights = client.get_oneways(params)

Filter by Time and Price

python
# Morning flights under €100params = FlightSearchParams(    from_airport="STN",  # London Stansted    to_airport="DUB",    # Dublin    from_date=datetime(2025, 8, 1),    to_date=datetime(2025, 8, 5),    max_price=100,    departure_time_from="06:00",    departure_time_to="12:00")
flights = client.get_oneways(params)

Error Handling

python
from flyan import RyanairException
try:    flights = client.get_oneways(params)    if not flights:        print("No flights found for the given criteria")except RyanairException as e:    print(f"Ryanair API error: {e}")except Exception as e:    print(f"Unexpected error: {e}")

Explore Mode

Explore Mode answers the question "where can I actually fly from here?". It reads Ryanair's live network metadata once and exposes the reachable destinations from any airport, optionally grouped, filtered, or joined with the cheapest fare in a date window.

All methods below are available on both RyanAir and AsyncRyanAir.

List every destination

python
destinations = client.get_destinations("DUB")
for airport in destinations:    print(f"{airport.iata_code} {airport.name} ({airport.country_code})")

Filter by country, region or city

python
# All Scottish airports DUB flies toin_scotland = client.get_destinations_in_region("DUB", "SCOTLAND")
# All London airports DUB flies to (LGW, LTN, STN)in_london = client.get_destinations_in_city("DUB", "LONDON")
# All Spanish airports DUB flies toin_spain = client.get_destinations_in_country("DUB", "es")

Country codes are lowercase ISO2. Region and city codes come from the live network (uppercase, e.g. SCOTLAND, ANDALUSIA, COSTA_DE_SOL, LONDON, MILAN).

Group destinations

python
# {country_code: [airports]}by_country = client.explore_by_country("DUB")
print(f"DUB flies to {len(by_country)} countries")for country, airports in sorted(by_country.items()):    codes = ", ".join(a.iata_code for a in airports)    print(f"  {country}: {codes}")
python
# {region_code: [airports]}by_region = client.explore_by_region("DUB")

Airports without a region_code are collected under the empty-string key, so callers can decide whether to surface or drop them.

Seasonal-only destinations

python
seasonal = client.get_seasonal_destinations("DUB")

Ryanair's seasonalRoutes list is sparsely populated upstream, so this often returns [] outside of summer/winter schedule transitions. The method is provided so callers do not need to peek at the raw route strings.

Destinations with their cheapest fare

explore_with_fares() joins the network destinations with a oneWayFares probe, so each destination comes back with its cheapest sampled Flight (or None if no fare was returned for that route in the window). It costs one network call plus one fare call.

python
from datetime import datetime, timedelta
start = datetime.now() + timedelta(days=14)end = start + timedelta(days=7)
results = client.explore_with_fares("DUB", start, end, max_price=100)
priced = [d for d in results if d.fare is not None]cheapest_first = sorted(priced, key=lambda d: d.fare.price)
for d in cheapest_first[:10]:    print(f"{d.airport.iata_code} {d.airport.name}: "          f"{d.fare.price} {d.fare.currency}")

Async usage

AsyncRyanAir mirrors every explore method:

python
import asynciofrom flyan import AsyncRyanAir
async def main():    async with AsyncRyanAir() as client:        by_country = await client.explore_by_country("DUB")        print(f"{len(by_country)} countries reachable from DUB")
asyncio.run(main())

If you call multiple explore methods in a row, wrap the transport in CachingTransport so the network metadata is fetched once and reused.

Use with Claude, Cursor, and other MCP clients

[!IMPORTANT] Two commands and you're done:

bash
uv tool install "Flyan[mcp]"claude mcp add flyan flyan-mcp

Now your agent can search Ryanair flights in natural language. No API keys, no accounts.

Flyan ships an optional Model Context Protocol server so your agent can search Ryanair fares from natural-language prompts like "find me a cheap flight from Dublin to Spain in August under €150" or "what's the cheapest day in July to fly DUB to BCN".

Quickstart

1. Install Flyan with the MCP extra:

bash
uv tool install "Flyan[mcp]"

Or with pip:

bash
pipx install "Flyan[mcp]"

This installs a flyan-mcp console script on your PATH.

2. Add it to your agent:

Claude Code (one-liner):

bash
claude mcp add flyan flyan-mcp

Claude Desktop: open ~/Library/Application Support/Claude/claude_desktop_config.json on macOS (or %APPDATA%\Claude\claude_desktop_config.json on Windows) and add:

json
{  "mcpServers": {    "flyan": {      "command": "flyan-mcp"    }  }}

Then restart Claude Desktop.

Cursor: Settings → MCP → Add new server, name flyan, command flyan-mcp.

Currency

The server returns prices in EUR by default. To get them in another currency, set the FLYAN_CURRENCY env var to any supported ISO 4217 code before launching flyan-mcp:

bash
FLYAN_CURRENCY=GBP flyan-mcp

Or pass it through your agent's MCP config:

json
{  "mcpServers": {    "flyan": {      "command": "flyan-mcp",      "env": { "FLYAN_CURRENCY": "GBP" }    }  }}

Unknown or unsupported codes silently fall back to EUR.

3. Try it. Ask your agent:

"Find me a one-way from Dublin to anywhere in Spain in the first week of August under €150."

The agent should call find_flights with destination_country="es", then summarize the cheapest options.

Exposed tools

The server exposes four curated tools so the agent can pick reliably:

  • find_flights for one-way searches with optional country, IATA, or price filters
  • find_anywhere_under for "where can I go for under £X" prompts
  • explore_destinations for "what countries can I reach from X"
  • cheapest_per_day for "what's the cheapest day this month to fly X to Y"

No API keys, accounts, or rate-limit setup. Ryanair's API is anonymous and the server reuses a single RyanAir client across calls.

Supported Airports

The SDK supports all airports in Ryanair's network. Airport codes must be valid 3-letter IATA codes. The live list is fetched from Ryanair's aggregate endpoint via client.get_network(); iterate network.airports for the full set.

Popular airports include:

  • DUB - Dublin
  • STN - London Stansted
  • BCN - Barcelona
  • MAD - Madrid
  • FCO - Rome Fiumicino
  • BRU - Brussels
  • AMS - Amsterdam

Supported Currencies

The SDK supports multiple currencies. Some popular ones include:

  • EUR - Euro
  • USD - US Dollar
  • GBP - British Pound
  • CHF - Swiss Franc

See currencies.json for the complete list.

Rate Limiting

The SDK includes automatic retry logic with exponential backoff to handle rate limiting and temporary API issues. It will retry failed requests up to 5 times before giving up.

Contributing

This is an open-source project. Contributions are welcome!

Disclaimer

This is an unofficial API wrapper and is not affiliated with Ryanair. Use at your own risk and ensure you comply with Ryanair's terms of service.

来源:README.md,提交 8b8c7fc

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.4.4最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分