Skip to main content
Glama

Google 航班 MCP 服务器

该 MCP 服务器提供了使用捆绑的fast_flights库与 Google Flights 数据交互的工具。

特征

提供以下 MCP 工具:

  • get_flights_on_date :获取两个机场之间特定日期的可用单程航班。

    • 参数: origin (str)、 destination (str)、 date (str,YYYY-MM-DD)、 adults (int,可选)、 seat_type (str,可选)、 return_cheapest_only (bool,可选,默认False )。

  • get_round_trip_flights :获取特定出发和返回日期的可用往返航班。

    • 参数: origin (str)、 destination (str)、 departure_date (str,YYYY-MM-DD)、 return_date (str,YYYY-MM-DD)、 adults (int,可选)、 seat_type (str,可选)、 return_cheapest_only (bool,可选,默认False )。

  • find_all_flights_in_range :查找指定日期范围内的往返航班。可以选择仅返回每个日期范围内找到的最便宜航班。

    • 参数: origin (str)、 destination (str)、 start_date_str (str,YYYY-MM-DD)、 end_date_str (str,YYYY-MM-DD)、 min_stay_days (int,可选)、 max_stay_days (int,可选)、 adults (int,可选)、 seat_type (str,可选)、 return_cheapest_only (bool,可选,默认False )。

Related MCP server: searchAPI-mcp

设置

  1. 克隆存储库:

    git clone https://github.com/opspawn/Google-Flights-MCP-Server.git
    cd Google-Flights-MCP-Server
  2. 创建虚拟环境(推荐):

    python -m venv .venv
    source .venv/bin/activate  # On Windows use `.venv\Scripts\activate`
  3. 安装依赖项:

    pip install -r requirements.txt
  4. 安装 Playwright 浏览器( fast_flights需要):

    playwright install

运行服务器

您可以直接使用 Python 运行服务器:

python server.py

服务器默认使用 STDIO 传输。

与 MCP 客户端集成(例如 Cline、Claude Desktop)

将服务器添加到 MCP 客户端的配置文件中。例如, cline_mcp_settings.jsonclaude_desktop_config.json

{
  "mcpServers": {
    "google-flights": {
      "command": "/path/to/your/.venv/bin/python", // Use absolute path to venv python
      "args": [
        "/absolute/path/to/flight_mcp_server/server.py" // Use absolute path to server script
      ],
      "env": {},
      "disabled": false,
      "autoApprove": []
    }
    // ... other servers
  }
}

**重要提示:**commandargs中的路径替换为虚拟环境的 Python 可执行文件和系统上的server.py脚本的绝对路径。

笔记

  • 此服务器捆绑了fast_flights库(最初来自https://github.com/AWeirdDev/flights ),用于其核心航班数据抓取功能。请参阅随附的LICENSE文件了解其条款。

  • 根据 Google 航班信息的变化和网络状况,航班数据抓取有时会不可靠或缓慢。这些工具包含基本的错误处理功能。

  • find_all_flights_in_range工具可能会占用大量资源,因为它会检查许多日期组合。

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

No tool schema history has been recorded yet.

Related MCP Connectors

Related MCP Servers

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/opspawn/Google-Flights-MCP-Server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server